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

arcships/dim

Measured 17 November 2026, 12:39 UTC, at code version 99dd516

First survey, so nothing to compare with yet
CAI score 56.6out of 100 Adequate
CriticalWeakAdequateStrongExemplary

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

A large codebase: 387,428 lines of product code in 31 projects, tests not counted · Estimated rebuild effort: about 4.5 person-years · Weakest lens: Production Readiness, 49.2

Findings by how serious they are

51 critical 2462 serious 103 minor

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

This survey was produced by

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

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

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

88of 88 dimensions measured by tools.
2581of 2616 findings point to an exact file and line, so you can open each one in the code. The other 35 concern the repository as a whole, such as missing documentation.
88dimensions across 9 lenses, read from 387,428 lines of product code in 31 projects.
Chapters

Executive summary

arcships/dim falls short of our standard for a preview release, held back most by its Production Readiness lens, the way the code is tested, built, released and run. It scores 56.6 out of 100 and is rated Adequate, and nine of its 51 critical findings are security problems.

Production Readiness, at 49.2, is the weakest lens and counts most in the score. The best first step is protecting outgoing calls with timeouts, worth about 3.0 points. Automating dependency updates comes next, worth about 1.9 points. Raising Production Readiness to 62 would lift the score to about 61.7.

Three known security holes in the packages the code depends on can be used by attackers. Three secrets can leak from the build pipeline, and three weaknesses in the code could be used by an attacker. Updating the vulnerable packages, limiting each secret to its own step and fixing the weaknesses the scanner points to would close these risks. The loop of files that import each other needs breaking.

The product code is 387,428 lines, about €650,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.
Production Readiness 49.2 · counts for 45%Code Health 59.7 · counts for 25%Performance 60.0 · counts for 14%Architecture 64.0 · counts for 8%Accessibility 68.4 · counts for 4%Event-Driven 68.9 · counts for 2%Security and Compliance 82.5 · counts for 1%Maturity 95.1 · counts for 1%Event Sourcing 100.0 · counts for 0%

If Production Readiness rose from 49.2 to 62, the lowest score rated Strong, the score would rise from 56.6 to about 61.7.

Code composition: what the lines of code are
Product code 55%Tests 45%
Rebuild cost: about €650,000 · Estimate
Cost to rebuild€220,000 to €1,100,000, for 3,603 to 11,431 hours of work, about 4.5 person-years for 2 to 9 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.
SizeLarge: 387,428 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Raises the score by about 3.0 points · Medium effort · Outbound HTTP resilience
2
Enable Dependabot/Renovate or a dependency-review gate.
Raises the score by about 1.9 points · Medium effort · Security & performance tooling
3
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Raises the score by about 1.9 points · Medium effort · DR & Backup

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 €650,000 to build again, about 4.5 person-years of work. Its weakest lens is Production Readiness, at 49.2 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail. Of all the actions in this report, it raises the score most for the work it takes: about 3.0 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 1,427,238 lines over the last 90 days, which is about 5,788,243 lines a year. At that pace, the extra work comes to an estimated 756.7 to 4540.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 our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch dim-agent-aimux dim-agent-aimux dim-agent-capabilities dim-agent-capabilities dim-agent-aimux->dim-agent-capabilities dim-agent-runtime dim-agent-runtime dim-agent-aimux->dim-agent-runtime dim-agent-types dim-agent-types dim-agent-aimux->dim-agent-types dim-agent-attachments dim-agent-attachments dim-agent-attachments->dim-agent-capabilities dim-agent-attachments->dim-agent-runtime dim-agent-attachments->dim-agent-types dim-agent-capabilities->dim-agent-runtime dim-agent-capabilities->dim-agent-types dim-agent-questions dim-agent-questions dim-agent-questions->dim-agent-capabilities dim-agent-questions->dim-agent-runtime dim-agent-questions->dim-agent-types dim-agent-runtime->dim-agent-types dim-agent-scheduler dim-agent-scheduler dim-agent-scheduler->dim-agent-capabilities dim-agent-scheduler->dim-agent-runtime dim-agent-scheduler->dim-agent-types dim-app-server dim-app-server dim-agent-scheduler->dim-app-server dim-app-server->dim-agent-aimux dim-app-server->dim-agent-attachments dim-app-server->dim-agent-capabilities dim-app-server->dim-agent-questions dim-app-server->dim-agent-runtime dim-app-server->dim-agent-types dim-cli dim-cli dim-cli->dim-agent-capabilities dim-cli->dim-agent-types dim-migration dim-migration dim-cli->dim-migration dim-event-hub dim-event-hub dim-event-hub->dim-agent-capabilities dim-event-hub->dim-agent-runtime dim-event-hub->dim-agent-types dim-event-hub->dim-app-server dim-goal dim-goal dim-goal->dim-agent-capabilities dim-goal->dim-agent-runtime dim-goal->dim-agent-types dim-goal->dim-app-server dim-image-understanding dim-image-understanding dim-image-understanding->dim-agent-capabilities dim-image-understanding->dim-agent-runtime dim-image-understanding->dim-agent-types dim-modality dim-modality dim-image-understanding->dim-modality dim-migration->dim-agent-capabilities dim-migration->dim-agent-runtime dim-migration->dim-agent-types dim-migration->dim-app-server dim-modality->dim-agent-capabilities dim-modality->dim-agent-runtime dim-modality->dim-agent-types dim-modality->dim-app-server dim-modality-aimux dim-modality-aimux dim-modality-aimux->dim-agent-aimux dim-modality-aimux->dim-agent-capabilities dim-modality-aimux->dim-agent-runtime dim-modality-aimux->dim-agent-types dim-modality-aimux->dim-modality dim-oauth dim-oauth dim-oauth->dim-agent-capabilities dim-oauth->dim-agent-runtime dim-oauth->dim-app-server dim-session-title dim-session-title dim-oauth->dim-session-title dim-report dim-report dim-report->dim-agent-capabilities dim-report->dim-agent-runtime dim-report->dim-agent-types dim-report->dim-app-server dim-session-title->dim-agent-capabilities dim-session-title->dim-agent-runtime dim-session-title->dim-agent-types dim-session-title->dim-app-server dimcode (Cargo) dimcode (Cargo) dimcode (Cargo)->dim-agent-capabilities dimcode (Cargo)->dim-agent-runtime dimcode (Cargo)->dim-agent-scheduler dimcode (Cargo)->dim-app-server dimcode (Cargo)->dim-cli dimcode (Cargo)->dim-event-hub dimcode (Cargo)->dim-goal dimcode (Cargo)->dim-image-understanding dimcode (Cargo)->dim-modality dimcode (Cargo)->dim-modality-aimux dimcode (Cargo)->dim-oauth dimcode (Cargo)->dim-report dimcode (Cargo)->dim-session-title xtask xtask xtask->dim-agent-aimux xtask->dim-agent-attachments xtask->dim-agent-capabilities xtask->dim-agent-questions xtask->dim-agent-runtime xtask->dim-agent-scheduler xtask->dim-agent-types xtask->dim-app-server xtask->dim-event-hub xtask->dim-goal xtask->dim-image-understanding xtask->dim-modality xtask->dim-report xtask->dim-session-title __more__ +10 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.

735 modules, with 2371 dependencies between them. 19 loops run through 153 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 695 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 dim_agent_runtime.scope2 dim_agent_types.content3 dim_agent_types.profile4 dim_cli.ui.terminal.input5 dim_cli.ui.theme.palette6 dim_agent_runtime.config7 dim_agent_runtime.error8 dim_agent_types.tool9 dim_cli.model.session10 dim_cli.ui.list_panel11 dim_agent_types.model12 dim_cli.ui.prompts13 dim_agent_types.events14 dim_agent_runtime.timeline_query.properties15 dim_agent_runtime.core.timeline16 dim_agent_runtime.assembly17 dim_agent_runtime.names18 dim_agent_capabilities.tool_registry19 dim_agent_capabilities.host20 dim_agent_capabilities.context_usage21 dim_agent_capabilities.context_policy22 dim_agent_capabilities.file_storage23 dim_agent_capabilities.methods24 dim_agent_capabilities.timeline_tree25 dim_agent_capabilities.host_platform26 dim_app_server.protocol27 dim_app_server.settings28 dim_app_server.outbound29 dim_app_server.collaboration30 dim_migration31 dim_app_server.connection32 dim_app_server.storage.timeline33 dim_app_server.storage.face34 dim_app_server.mcp.auth.store35 dim_app_server.provider36 dim_cli.args37 dim_cli.ui.tui38 xtask.scenario_eval39 dim_app_server.agents40 dim_cli.session_host
1 dim_agent_runtime.scope
2 dim_agent_types.content
3 dim_agent_types.profile
4 dim_cli.ui.terminal.input
5 dim_cli.ui.theme.palette
6 dim_agent_runtime.config11
7 dim_agent_runtime.error1
8 dim_agent_types.tool2
9 dim_cli.model.session1
10 dim_cli.ui.list_panel11
11 dim_agent_types.model1211
12 dim_cli.ui.prompts552
13 dim_agent_types.events266
14 dim_agent_runtime.timeline_query.properties1
15 dim_agent_runtime.core.timeline261
16 dim_agent_runtime.assembly2621
17 dim_agent_runtime.names1
18 dim_agent_capabilities.tool_registry127151
19 dim_agent_capabilities.host33429312
20 dim_agent_capabilities.context_usage133221113
21 dim_agent_capabilities.context_policy6171442103
22 dim_agent_capabilities.file_storage1
23 dim_agent_capabilities.methods1111
24 dim_agent_capabilities.timeline_tree225142214124
25 dim_agent_capabilities.host_platform1211
26 dim_app_server.protocol51742
27 dim_app_server.settings11311
28 dim_app_server.outbound1
29 dim_app_server.collaboration1615142131331131165
30 dim_migration11
31 dim_app_server.connection2112228162115
32 dim_app_server.storage.timeline41141122122
33 dim_app_server.storage.face41432
34 dim_app_server.mcp.auth.store31
35 dim_app_server.provider32131211213
36 dim_cli.args2
37 dim_cli.ui.tui3513271
38 xtask.scenario_eval442412451
39 dim_app_server.agents4211511121141
40 dim_cli.session_host219122131133
Uses a module listed above itPart of a loopThe module itself
1 dim_agent_runtime.scope2 dim_agent_types.content3 dim_agent_types.profile4 dim_cli.ui.terminal.input5 dim_cli.ui.theme.palette6 dim_agent_runtime.config7 dim_agent_runtime.error8 dim_agent_types.tool9 dim_cli.model.session10 dim_cli.ui.list_panel11 dim_agent_types.model12 dim_cli.ui.prompts13 dim_agent_types.events14 dim_agent_runtime.timeline_query.properties15 dim_agent_runtime.core.timeline16 dim_agent_runtime.assembly17 dim_agent_runtime.names18 dim_agent_capabilities.tool_registry19 dim_agent_capabilities.host20 dim_agent_capabilities.context_usage21 dim_agent_capabilities.context_policy22 dim_agent_capabilities.file_storage23 dim_agent_capabilities.methods24 dim_agent_capabilities.timeline_tree25 dim_agent_capabilities.host_platform26 dim_app_server.protocol27 dim_app_server.settings28 dim_app_server.outbound29 dim_app_server.collaboration30 dim_migration31 dim_app_server.connection32 dim_app_server.storage.timeline33 dim_app_server.storage.face34 dim_app_server.mcp.auth.store35 dim_app_server.provider36 dim_cli.args37 dim_cli.ui.tui38 xtask.scenario_eval39 dim_app_server.agents40 dim_cli.session_hostdim_agent_runtime.scope1dim_agent_types.content2dim_agent_types.profile3dim_cli.ui.terminal.input4dim_cli.ui.theme.palette5dim_agent_runtime.config6dim_agent_runtime.error7dim_agent_types.tool8dim_cli.model.session9dim_cli.ui.list_panel10dim_agent_types.model11dim_cli.ui.prompts12dim_agent_types.events13dim_agent_runtime.timeline_query.properties14dim_agent_runtime.core.timeline15dim_agent_runtime.assembly16dim_agent_runtime.names17dim_agent_capabilities.tool_registry18dim_agent_capabilities.host19dim_agent_capabilities.context_usage20dim_agent_capabilities.context_policy21dim_agent_capabilities.file_storage22dim_agent_capabilities.methods23dim_agent_capabilities.timeline_tree24dim_agent_capabilities.host_platform25dim_app_server.protocol26dim_app_server.settings27dim_app_server.outbound28dim_app_server.collaboration29dim_migration30dim_app_server.connection31dim_app_server.storage.timeline32dim_app_server.storage.face33dim_app_server.mcp.auth.store34dim_app_server.provider35dim_cli.args36dim_cli.ui.tui37xtask.scenario_eval38dim_app_server.agents39dim_cli.session_host401112111121155226612612621112715133429312133221113617144210311111225142214124121151742113111161514213133113116511211222816211541141122122414323132131211213235132714424124514211511121141219122131133+695 more modules (most-connected shown)

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

At a glance — Architecture · 64.0 · Adequate · gated by R11 ·

At a glance — Maturity · 95.1 · Exemplary ·

At a glance — Readiness · 49.2 · Adequate · gated by P7 ·

At a glance — Security · 82.5 · Adequate · gated by D29 ·

At a glance — Event-Driven · 68.9 · Strong ·

At a glance — Event Sourcing · 100.0 · Exemplary ·

At a glance — Accessibility · 68.4 · Strong ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures21High / Critical
A05:2025 — Injection11High / Critical

Roadmap

Top priorities: Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail; Enable Dependabot/Renovate or a dependency-review gate; Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).

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

Do thisHelpsEffortDimension
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+3.0 ptsMediumOutbound HTTP resilience
Enable Dependabot/Renovate or a dependency-review gate.+1.9 ptsMediumSecurity & performance tooling
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+1.9 ptsMediumDR & Backup
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.+1.4 ptsMediumAsync & latency hygiene
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+1.3 ptsMediumRelease Hygiene
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+1.3 ptsMediumDependency Hygiene
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.+0.8 ptsMediumCancellation propagation
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.+0.8 ptsMediumImport Boundaries

File quality

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

FileScoreBandWorst signal
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.3MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.7MixedDependency Vulnerabilities: Medium advisory (unmaintained): REDACTED
crates/dim-app-server/src/connection.rs4.8MixedCyclomatic Complexity: Connection::handle (cyclomatic 117)
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: High CVE: REDACTED
crates/dim-cli/src/session_host.rs5.5MixedCyclomatic Complexity: Worker::command (cyclomatic 173)
crates/dim-cli/src/ui/prompts.rs5.5MixedCyclomatic Complexity: AskUserPrompt::handle_key (cyclomatic 30)
crates/dim-agent-capabilities/src/host_platform.rs5.5MixedCyclomatic Complexity: dim_agent_capabilities::host_platform::windows::collect (cyclomatic 21)
crates/dim-agent-runtime/src/agent.rs5.5MixedCyclomatic Complexity: Agent::create (cyclomatic 17)
crates/dim-cli/src/input.rs5.6MixedCyclomatic Complexity: Input::line (cyclomatic 21)
crates/dim-agent-aimux/src/plugin.rs5.9MixedCode Duplication: Edited copies of one member (3 members, 7+ corresponding lines)
REDACTED6.2MixedDependency Vulnerabilities: Medium CVE: REDACTED
crates/dim-agent-runtime/src/memory_timeline_store.rs6.3MixedCode Duplication: Duplicated block (8 lines × 2)
crates/dim-cli/src/ui/tui.rs7.0Near-cleanCyclomatic Complexity: App::apply (cyclomatic 182)
crates/dim-acp/src/gateway.rs7.0Near-cleanCyclomatic Complexity: Gateway::work (cyclomatic 162)
crates/dim-app-server/src/storage/query.rs7.0Near-cleanCyclomatic Complexity: Compiler::physical_filter_for (cyclomatic 83)
crates/dim-app-server/src/storage/members.rs7.0Near-cleanCyclomatic Complexity: dim_app_server::storage::members::candidates_for (cyclomatic 75)

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

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

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

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

Could not be resolved — 9

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

Methodology & how to trust this report

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

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

What we checked — 88 dimensions across the health lenses
D1D2D3D4D5D6D7D10D12D13D14D15D16D17D19D20D23D24D26D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX5AX8AX9C2ED1ES1ES2GD1IC1M1M2M3M4P1P10P2P3P4P5P6P7PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X16X17X18X2X21X22X23X25X27X28X29X30X4X5

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, 2581 of 2616 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1e985-5bdd-799b-9d56-9ac6af139b15.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .ts, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 71.6% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 364 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 335 test source file(s) (.py, .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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (node:test via `npm ci --ignore-scripts` in web/ (42 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D20 ADR Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `npm/branch-services.d.ts`, `npm/plugin.d.ts`, `runtime/plugins/workflow/store.ts`, `web/src/i18n/en.ts`, `web/src/projection.ts`, … (+3 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The dev server kept running but no port it opened served a page in the time allowed. (rule: no-answer). The renderer reported: the dev server (`npm run dev` in web/) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> dim-web@0.0.0 dev / > vite / VITE v6.4.4 ready in 457 ms / ➜ Local: http://localhost:5173/ / ➜ Network: use --host to expose" No runtime evidence was gathered.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev` in web/) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> dim-web@0.0.0 dev / > vite / VITE v6.4.4 ready in 457 ms / ➜ Local: http://localhost:5173/ / ➜ Network: use --host to expose" No runtime evidence was gathered.
  • ED1 Handler temporal coupling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 334 further occurrence(s) are not listed individually; the score already reflects all 374.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R11 Import Boundaries — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 46 further occurrence(s) are not listed individually; the score already reflects all 86.
  • X17 Uncapped recursion over a caller-supplied document — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 68 further occurrence(s) are not listed individually; the score already reflects all 108.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X25 Inert configuration knob — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 3 further occurrence(s) are not listed individually; the score already reflects all 43.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1092 further occurrence(s) are not listed individually; the score already reflects all 1132.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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 REDACTED, 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 Dockerfile (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.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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 Complexity3.3 / 10Weak✓ 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 3.3 / 10 · rule-coverage 100% · ceiling Prevented

371 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Options::parse at 328. A further 85 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 dim_cli::ui::i18n::zh_cn::chrome::lookup at 526 — they are counted neither in the figure above nor in this dimension's score. 76 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/dim-cli/src/ui/i18n/zh_cn/chrome.rs (dim_cli::ui::i18n::zh_cn::chrome::lookup at 526), crates/dim-cli/src/ui/i18n/zh_hant/chrome.rs (dim_cli::ui::i18n::zh_hant::chrome::lookup at 463), crates/dim-cli/src/ui/i18n/de/chrome.rs (dim_cli::ui::i18n::de::chrome::lookup at 456), crates/dim-cli/src/ui/i18n/es/chrome.rs (dim_cli::ui::i18n::es::chrome::lookup at 456), crates/dim-cli/src/ui/i18n/fr/chrome.rs (dim_cli::ui::i18n::fr::chrome::lookup at 456), and 71 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.

dim_app_server::serve (cyclomatic 81) · ×41crates/dim-app-server/src/lib.rs:464
dim_cli::ui::tui::run_terminal (cyclomatic 152) · ×36crates/dim-cli/src/ui/tui.rs:234
dim_agent_capabilities::recall::search::index (cyclomatic 42) · ×26crates/dim-agent-capabilities/src/recall/search.rs:1102
App::apply (cyclomatic 182) · ×14crates/dim-cli/src/ui/tui.rs:2247
dim_migration::settings::permissions::import (cyclomatic 43) · ×14crates/dim-migration/src/settings/permissions.rs:41

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

What to do

  1. Bring the 1 body over 240 down to 240 or less in Cyclomatic Complexity — start with Options::parse (cyclomatic 328). — Refactoring it lifts Cyclomatic Complexity from 3.3 to about 3.7/10.

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

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

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

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

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

574 method(s) exceeded the cognitive complexity threshold of 15; the worst was Options::parse at 400.

dim_app_server::storage::members::candidates_for (cognitive 164) · ×58crates/dim-app-server/src/storage/members.rs:1109
dim_cli::session::wait_turn (cognitive 334) · ×52crates/dim-cli/src/session.rs:633
dim_agent_capabilities::recall::search::index (cognitive 83) · ×45crates/dim-agent-capabilities/src/recall/search.rs:1102
App::apply (cognitive 242) · ×20crates/dim-cli/src/ui/tui.rs:2247
xtask::scenario_eval::drive (cognitive 105) · ×19xtask/src/scenario_eval.rs:4538

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

What to do

  1. Bring the 16 bodies over 120 down to 120 or less in Cognitive Complexity — start with Options::parse (cognitive 400), Gateway::work (cognitive 390), dim_cli::session::wait_turn (cognitive 334). — 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 16 together lifts Cognitive Complexity from 2.0 to about 3.1/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes7.7 / 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 7.7 / 10 · rule-coverage 100% · ceiling Prevented

424 god class(es) detected.

FileTooLong: ui/tui.rs · ×135crates/dim-cli/src/ui/tui.rs
MethodTooLong: Options.parse · ×129REDACTED:616
FunctionTooLong: dim_app_server::serve · ×89crates/dim-app-server/src/lib.rs:464
ClassTooLong: App · ×46crates/dim-cli/src/ui/tui.rs:1053
TooManyMethods: App · ×20crates/dim-cli/src/ui/tui.rs:1053

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

What to do

  1. Resolve the 135 FileTooLong finding(s) in God Classes — start with lib.rs (5), session.rs (4), query.rs (2). — One of this dimension's main actionable groups (135 warning-level).
  2. Resolve the 129 MethodTooLong finding(s) in God Classes — start with tui.rs (8), session_host.rs (5), query.rs (5). — One of this dimension's main actionable groups (129 warning-level).
  3. Resolve the 89 FunctionTooLong finding(s) in God Classes — start with query.rs (5), scenario_eval.rs (5), pending.rs (5). — One of this dimension's main actionable groups (89 warning-level).

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

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

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

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

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

343 duplicated block group(s) detected. 3.8 % of the production lines (14,650 of 387,428) are in a reported copy. A further 205 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (8 lines × 2) · ×38crates/dim-agent-capabilities/src/agent_loop.rs:1897
Duplicated block (9 lines × 2) · ×32crates/dim-acp/src/gateway.rs:588
Duplicated block (10 lines × 2) · ×29crates/dim-agent-capabilities/src/agent_loop.rs:561
Duplicated block (6 lines × 2) · ×29crates/dim-acp/src/gateway.rs:708
Duplicated block (7 lines × 2) · ×22crates/dim-agent-aimux/src/driver.rs:342

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

What to do

  1. Resolve the 38 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with context_preparation.rs (3), exec.rs (2), config.rs (2). — One of this dimension's main actionable groups (38 warning-level).
  2. Resolve the 32 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with context_policy.rs (3), gateway.rs (2), file_storage.rs (2). — One of this dimension's main actionable groups (32 warning-level).
  3. Resolve the 29 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with agent_loop.rs (3), pending.rs (3), context_preparation.rs (2). — One of this dimension's main actionable groups (29 warning-level).

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

D5 · Coupling8.7 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

30 production modules (Cargo+npm+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 5 module(s) off the main sequence, with abstractness counted on 28 of the 30 (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: dim-agent-types · ×5

What to do

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

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 6 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.9 / 10 · rule-coverage 100% · ceiling Verified

6 of 629 classes have LCOM4 above 3.

Low cohesion: ConnectionHub (LCOM4 5) · ×6crates/dim-app-server/src/connection.rs:1997

What to do

  1. Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with connection.rs, host_platform.rs, testing.rs. — One of this dimension's main actionable groups (6 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 1 serious finding✓ 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, 1 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 364 tests. Measured on the JavaScript/TypeScript suite only — at least 335 test source file(s) (.py, .rs) went unread, so its test quality is unmeasured and is not in these counts.

Fixed-sleep synchronisation: two concurrent updates serialize on the stage lockscripts/release.test.mjs:348

What to do

  1. Resolve the 1 Fixed-sleep synchronisation finding(s) in Test Quality — start with release.test.mjs. — One of this dimension's main actionable groups (1 warning-level).

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

D12 · Dependency Hygiene9.0 8.8 / 10Strong✓ Tool-verified

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

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

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

21 outdated, 0 yanked direct Cargo dependencies. 79 of 80 direct crates were graded against crates.io (0 not published there, 1 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: croner · ×21

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 542 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 a Python pyproject.toml/requirements.txt (pip/uv/Poetry) and REDACTED, and the licences of those dependency graphs 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 Hotspots8.8 / 10Strong✓ 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 8.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: crates/dim-cli/src/ui/tui.rs (352×182=64064); crates/dim-cli/src/session_host.rs (222×173=38406); REDACTED (112×328=36736) Repeated repair below the complexity floor: web/tests/chat-input.mjs (13 of 22 changes were fixes); crates/dim-cli/src/update.rs (11 of 21 changes were fixes); crates/dim-event-hub/src/publish.rs (10 of 14 changes were fixes)

Hotspot: crates/dim-cli/src/ui/tui.rs · ×170crates/dim-cli/src/ui/tui.rs:2247
Repeated repair: web/tests/chat-input.mjs · ×28web/tests/chat-input.mjs:22

What to do

  1. Resolve the 170 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), query.rs (3), mod.rs (3). — One of this dimension's main actionable groups (170 warning-level).
  2. Resolve the 28 Repeated repair finding(s) in Churn × Complexity Hotspots — start with chat-input.mjs, update.rs, publish.rs. — One of this dimension's main actionable groups (28 warning-level).

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

D16 · Bus Factor9.6 / 10Exemplary✓ 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 9.6 / 10 · rule-coverage 100% · ceiling Documented

23 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/dim-agent-aimux/src/request/tests.rs. Counted over 617 of the 770 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)

✓ On the Gold path — maintain.

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality9.5 / 10Exemplary✓ Tool-verified

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 9.5 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 documentation facets pass in full; short on: F2 example. 299 document(s) read across 31 unit(s).

Documentation: no build, run or usage examplecrates/dim-client/README.md:1

✓ On the Gold path — maintain.

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

D20 · ADR Quality9.6 / 10Exemplary✓ Tool-verified

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

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

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

3 of 21 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

ADR superseded but its status says otherwise · ×3docs/adr/001-harness-foundation.md:10detected by adr-integrity

✓ On the Gold path — maintain.

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

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

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

No domain types leak across context boundaries (2 contexts). Contexts: xai-grok-markdown, xai-ratatui-inline.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value10.0 9.9 / 10Exemplary○ Nothing flagged

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

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

0 of 93 judged comments only repeat the code they sit on (0.0 %). 1 comment(s) in another language or script were not judged.

doc comments repeat the namesweb/src/rpc/read.ts:216

✓ On the Gold path — maintain.

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

D26 · Project Cohesion6.8 / 10Adequate✓ 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.

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

5 of 31 build units (Cargo, Python, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×5crates/dim-cli/Cargo.toml:1

What to do

  1. Resolve the 5 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml (5). — One of this dimension's main actionable groups (5 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)3.1 / 10Weak✓ Tool-verified

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

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

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

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

11 finding(s): 0 critical, 6 high, 2 medium, 3 low. semgrep hit a parse error in 27 file(s) — `benchmarks/host/nightly.sh` (line 23, line 68, line 158), `benchmarks/officeqa/corpus-image/build.sh` (line 12), `benchmarks/officeqa/template/solution/solve.sh` (lines 3–5), `crates/dim-agent-capabilities/src/file_storage/windows.rs` (line 665), `REDACTED` (line 254), … (+22 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

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  3. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

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

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

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

21 finding(s): 0 critical, 3 high, 11 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 7 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 2 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

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

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 617 of the 770 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.4 / 10Stronggated by 13 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.4 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: memory_timeline_store.rs↔REDACTED 100%; ChatPage.vue↔en.ts 75%; ChatPage.vue↔zh-CN.ts 75%

Change coupling: memory_timeline_store.rs ↔ REDACTED · ×9crates/dim-agent-runtime/src/memory_timeline_store.rs:1
Change-coupling hub: en.ts → ChatPage.vue, ComposerPanel.vue, read.ts, chat.ts · ×4web/src/i18n/en.ts

What to do

  1. Resolve the 9 Change coupling finding(s) in Change Coupling — start with memory_timeline_store.rs, connection.rs, agent.rs. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 4 Change-coupling hub finding(s) in Change Coupling — start with en.ts, zh-CN.ts, timeline_query.rs. — One of this dimension's main actionable groups (4 warning-level).

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

D36 · Supply-chain Provenance & Signing10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Build pipeline generates provenance, signs artifacts and produces an SBOM.

✓ On the Gold path — maintain.

Detailed fixes: d36_recommendation.md.

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 3 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

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.

AC2 · Forms & labels4.6 / 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.

  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×6) — web/src/features/settings/McpSettings.vue:602, web/src/features/settings/PermissionsSettings.vue:130, web/src/features/settings/PluginSettings.vue:81, …

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 structure7.2 / 10Strong✓ 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>. — web/index.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.
AC4 · Keyboard semantics10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

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 safety5.5 / 10Adequate✓ Tool-verified

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.

  • `[data-route-heading]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/global.css:304
  • `.composer-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/features/chat/ComposerPanel.vue:842
  • `.command-menu-item` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/features/chat/ComposerPanel.vue:847

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition9.5 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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.

ED1 · Handler temporal coupling6.9 / 10Strong✓ Tool-verified

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

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

  • `ModelConfigFile.load` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-aimux/src/config.rs:19
  • `recording.secure` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::set_permissions`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/dim-agent-aimux/src/recording.rs:249, crates/dim-agent-aimux/src/recording.rs:265
  • `file_access.existing_directory` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/file_access.rs:731
  • `host_platform.platform_roots` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform.rs:187
  • `host_platform.collect` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform.rs:1572
  • `isolation.bubblewrap` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform/isolation.rs:21
  • `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform/isolation.rs:511
  • `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform/isolation.rs:513
  • `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::set_permissions`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform/isolation.rs:514
  • `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/host_platform/isolation.rs:541
  • `ShellSession.run_background` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/shell_session.rs:1263
  • `shell_session.file_tail` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/shell_session.rs:1613
  • `install.walk` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:24
  • `install.walk` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:34
  • `install.hash_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:65
  • `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:136
  • `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:137
  • `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:145
  • `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:149
  • `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/dim-agent-capabilities/src/skills/install.rs:189, crates/dim-agent-capabilities/src/skills/install.rs:196
  • `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:197
  • `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×3) — crates/dim-agent-capabilities/src/skills/install.rs:200, crates/dim-agent-capabilities/src/skills/install.rs:212, crates/dim-agent-capabilities/src/skills/install.rs:214
  • `install.occupied` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:224
  • `install.remove` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:246
  • `install.remove` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:257
  • `install.real_dir` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-capabilities/src/skills/install.rs:265
  • `memory.rss_kb` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-agent-runtime/src/memory.rs:18
  • `catalog.build` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-app-server/build/catalog.rs:27
  • `catalog.build` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/dim-app-server/build/catalog.rs:168, crates/dim-app-server/build/catalog.rs:169
  • `cli.model_profile` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-app-server/src/cli.rs:176
  • `cli.run_with` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `block_on`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/dim-app-server/src/cli.rs:246, crates/dim-app-server/src/cli.rs:309
  • `cli.run_with` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/dim-app-server/src/cli.rs:394, crates/dim-app-server/src/cli.rs:441
  • `cli.run_with` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/dim-app-server/src/cli.rs:442

What to do

  • Use the awaited twin of each blocking call, or move the work off the loop with `tokio::task::spawn_blocking` — a synchronous handler cannot simply `.await` in place.
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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs6.8 / 10Strong✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `warn_dropped` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-agent-aimux/src/request.rs:969
  • `cancelled` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-agent-capabilities/src/approval.rs:484
  • `sync_directory` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/dim-agent-capabilities/src/file_storage/windows.rs:235
  • `boundary` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/dim-agent-capabilities/src/history.rs:891
  • `failed` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/dim-agent-capabilities/src/prompt_suggestion.rs:1273
  • `settle` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-agent-capabilities/src/shell_session.rs:890
  • `rebuild` does real work, but one of its branches is `unreachable!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×2) — crates/dim-agent-capabilities/src/workspace_tools/background.rs:739, crates/dim-agent-capabilities/src/workspace_tools/background.rs:743
  • `restore` does real work, but one of its branches is `unreachable!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/dim-app-server/src/collaboration.rs:3811
  • `changed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-app-server/src/runtime_manager.rs:687
  • `restart` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-cli/src/mcp_command.rs:226
  • `send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — crates/dim-cli/src/session_host.rs:164, crates/dim-cli/src/session_host.rs:4883
  • `write` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-cli/src/ui/composer/history.rs:122
  • `paste` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-cli/src/ui/isolation_panel.rs:123
  • `push_move` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — crates/dim-cli/src/ui/render/fullscreen.rs:2287, crates/dim-cli/src/ui/render/screen.rs:808
  • `finished` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-cli/src/update/staged.rs:75
  • `print_json` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/dim-cli/src/worktree_command.rs:324
  • `history` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — crates/dim-migration/src/native.rs:850
  • `record_confined` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/dim-modality/src/engine.rs:710

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
M1 · Documentation (README)8.9 / 10Exemplary✓ Tool-verified

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

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

M2 · Architecture documentation10.0 / 10Exemplary✓ 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.

  • `docs/design/clients.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode-plugin-runtime`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/design/clients.md:12
  • `docs/design/web-workspace.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode-plugin-runtime`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/design/web-workspace.md:10
  • `docs/design/plugins/RemoteGateway.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/design/plugins/RemoteGateway.md:12
  • `docs/zh/design/clients.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode-plugin-runtime`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/zh/design/clients.md:12
  • `docs/architecture/rust-agent/generated/modules.mmd` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode`, `dim-codemode`, `dim-event-hub`, `dim-modality-aimux`, `dim-oauth`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/rust-agent/generated/modules.mmd:3

What to do

  • Update docs/design/clients.md so it draws the parts the code has today: add dimcode-plugin-runtime.
  • Update docs/design/web-workspace.md so it draws the parts the code has today: add dimcode-plugin-runtime.
  • Update docs/design/plugins/RemoteGateway.md so it draws the parts the code has today: add dimcode.
  • Update docs/zh/design/clients.md so it draws the parts the code has today: add dimcode-plugin-runtime.
  • Update docs/architecture/rust-agent/generated/modules.mmd so it draws the parts the code has today: add dimcode, dim-codemode, dim-event-hub, dim-modality-aimux, dim-oauth.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability6.8 / 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 9/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/dim-cli`, `crates/dim-client`, `crates/dimcode`, `npm` and 1 more.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.

  • `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:6

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 & Rollback7.0 / 10Strong✓ 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 Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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.

  • `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/dim-agent-aimux/src/driver.rs:284
  • `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×6) — crates/dim-app-server/src/cli.rs:530, xtask/src/app_server.rs:214, xtask/src/main.rs:101, …

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • `apply` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — crates/dim-cli/src/plugins.rs:106
  • `existsSync` in `apply` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — runtime/fixtures/guide-entries.ts:37
  • `appendFileSync` in `callback to ctx.effect` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — runtime/fixtures/session-observer.ts:42

What to do

  • Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety6.3 / 10Adequate✓ 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.

  • 107 typed · 63 plain JS — the untyped files are runtime/light-ocr-helper.test.mjs, runtime/light-ocr-row.test.mjs, runtime/permission-policy.test.mjs, runtime/plugin-sdk.test.mjs, runtime/plugins/light-ocr/helper.cjs, scripts/adr-check.mjs (+57 more).
R10 · Code Duplication8.6 / 10Strong✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • web/src/features/settings/AgentSettings.vue:84 · web/src/features/settings/ModalitySettings.vue:92 — the two spans are one implementation copied and then locally edited — 83 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. — web/src/features/settings/AgentSettings.vue:84
  • scripts/update-provider-catalog.ts:527 · scripts/update-provider-catalog.ts:617 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/update-provider-catalog.ts:527
  • web/src/features/lines/EndLineDialog.vue:9 · web/src/features/lines/NewLineDialog.vue:12 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — web/src/features/lines/EndLineDialog.vue:9
  • web/src/features/lines/LineConversation.vue:13 · web/src/features/lines/LinesPanel.vue:10 — the two spans are one implementation copied and then locally edited — 90 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. — web/src/features/lines/LineConversation.vue:13
  • web/src/features/settings/AgentSettings.vue:85 · web/src/features/settings/DiagnosticsSettings.vue:36 — the two spans are one implementation copied and then locally edited — 63 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. — web/src/features/settings/AgentSettings.vue:85
  • web/src/features/settings/ProviderAuthFlow.vue:96 · web/src/features/settings/ProviderSettings.vue:139 — the two spans are one implementation copied and then locally edited — 59 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. — web/src/features/settings/ProviderAuthFlow.vue:96
  • web/src/lines.ts:132 · web/src/lines.ts:147 — 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. — web/src/lines.ts:132
  • web/src/rpc/general-settings.ts:13 · web/src/rpc/management.ts:45 · web/src/rpc/scheduler.ts:27 — the 3 copies are spread across 3 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. — web/src/rpc/general-settings.ts:13
  • scripts/update-provider-catalog.ts:316 · scripts/update-provider-catalog.ts:639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/update-provider-catalog.ts:316
  • web/src/features/settings/ProviderConnectionForm.vue:17 · web/src/features/settings/ProviderModels.vue:26 · web/src/features/settings/ProviderSettings.vue:26 — the 3 copies are spread across 3 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — web/src/features/settings/ProviderConnectionForm.vue:17
  • web/src/features/settings/ProviderSettings.vue:29 · web/src/features/settings/ScheduledSettings.vue:26 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — web/src/features/settings/ProviderSettings.vue:29
  • web/src/rpc/read.ts:58 · web/src/rpc/read.ts:85 — 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. — web/src/rpc/read.ts:58
  • scripts/collect-release.mjs:28 · scripts/collect-release.mjs:50 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/collect-release.mjs:28
  • web/src/features/lines/LinesPanel.vue:10 · web/src/features/lines/LinesTree.vue:7 — the two spans are one implementation copied and then locally edited — 78 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. — web/src/features/lines/LinesPanel.vue:10
  • web/src/features/settings/AgentSettings.vue:63 · web/src/features/settings/ModalitySettings.vue:79 · web/src/features/settings/PermissionsSettings.vue:48 — the 3 copies are spread across 3 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. — web/src/features/settings/AgentSettings.vue:63
  • web/src/features/settings/DiagnosticsSettings.vue:12 · web/src/features/settings/ProviderAuthFlow.vue:18 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — web/src/features/settings/DiagnosticsSettings.vue:12
  • web/src/features/settings/DiagnosticsSettings.vue:21 · web/src/features/settings/PermissionsSettings.vue:46 — 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. — web/src/features/settings/DiagnosticsSettings.vue:21
  • web/src/features/settings/McpSettings.vue:168 · web/src/features/settings/ProviderModels.vue:116 — 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. — web/src/features/settings/McpSettings.vue:168
  • web/src/features/settings/McpSettings.vue:489 · web/src/features/settings/SkillSettings.vue:50 — 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. — web/src/features/settings/McpSettings.vue:489
  • web/src/features/settings/PluginSettings.vue:14 · web/src/features/settings/ProviderSettings.vue:28 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — web/src/features/settings/PluginSettings.vue:14
  • web/src/rpc/read.ts:161 · web/src/rpc/read.ts:432 — 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. — web/src/rpc/read.ts:161
  • runtime/plugins/workflow/engine.ts:300 · runtime/plugins/workflow/engine.ts:364 · runtime/plugins/workflow/engine.ts:374 — 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. — runtime/plugins/workflow/engine.ts:300
  • runtime/plugins/workflow/engine.ts:317 · runtime/plugins/workflow/engine.ts:350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/plugins/workflow/engine.ts:317
  • scripts/build-all.mjs:12 · scripts/publish-alpha.mjs:5 — the two spans are one implementation copied and then locally edited — 51 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/build-all.mjs:12
  • web/src/features/chat/ApprovalPrompt.vue:55 · web/src/features/chat/TimelineWorkItem.vue:35 — the two spans are one implementation copied and then locally edited — 73 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. — web/src/features/chat/ApprovalPrompt.vue:55
  • scripts/check-alpha-registry.mjs:69 · scripts/publish-npm.mjs:133 — 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. — scripts/check-alpha-registry.mjs:69
  • scripts/stage-plugins.mjs:273 · scripts/stage-plugins.mjs:329 — the two spans are one implementation copied and then locally edited — 84 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. — scripts/stage-plugins.mjs:273
  • scripts/update-provider-catalog.ts:307 · scripts/update-provider-catalog.ts:636 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/update-provider-catalog.ts:307
  • web/src/features/chat/ChatPage.vue:118 · web/src/features/lines/LineConversation.vue:91 — 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. — web/src/features/chat/ChatPage.vue:118
  • web/src/features/settings/AccountSettings.vue:91 · web/src/features/settings/ProviderSettings.vue:131 — 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. — web/src/features/settings/AccountSettings.vue:91
  • web/src/projection.ts:277 · web/src/projection.ts:286 — 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. — web/src/projection.ts:277
  • web/src/rpc/read.ts:998 · web/src/rpc/read.ts:1014 — 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. — web/src/rpc/read.ts:998
  • scripts/pack-release.mjs:21 · scripts/stage-image.mjs:102 — 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. — scripts/pack-release.mjs:21
  • scripts/pack-release.mjs:39 · scripts/stage-web.mjs:25 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — scripts/pack-release.mjs:39
  • scripts/pack-release.mjs:49 · scripts/stage-web.mjs:63 — 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. — scripts/pack-release.mjs:49
  • web/src/features/settings/ProviderSettings.vue:72 · web/src/features/settings/ProviderSettings.vue:86 — 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. — web/src/features/settings/ProviderSettings.vue:72

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.
R11 · Import Boundaries0.0 / 10Critical✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • scripts/check-alpha-registry.mjs:19 reaches into another package with a relative path (../npm/package.json) — import the package by name instead. — scripts/check-alpha-registry.mjs:19
  • web/src/auto-imports.d.ts:11 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineLocale) — import the package by name instead. — web/src/auto-imports.d.ts:11
  • web/src/auto-imports.d.ts:12 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineShortcuts) — import the package by name instead. — web/src/auto-imports.d.ts:12
  • web/src/auto-imports.d.ts:13 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineLocale) — import the package by name instead. — web/src/auto-imports.d.ts:13
  • web/src/auto-imports.d.ts:14 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineShortcuts) — import the package by name instead. — web/src/auto-imports.d.ts:14
  • web/src/auto-imports.d.ts:15 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/vue/composables/useAppConfig.js) — import the package by name instead. — web/src/auto-imports.d.ts:15
  • web/src/auto-imports.d.ts:16 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useContentSearch) — import the package by name instead. — web/src/auto-imports.d.ts:16
  • web/src/auto-imports.d.ts:17 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useFileUpload) — import the package by name instead. — web/src/auto-imports.d.ts:17
  • web/src/auto-imports.d.ts:18 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useFormField) — import the package by name instead. — web/src/auto-imports.d.ts:18
  • web/src/auto-imports.d.ts:19 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useKbd) — import the package by name instead. — web/src/auto-imports.d.ts:19
  • web/src/auto-imports.d.ts:20 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useOverlay) — import the package by name instead. — web/src/auto-imports.d.ts:20
  • web/src/auto-imports.d.ts:21 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useResizable) — import the package by name instead. — web/src/auto-imports.d.ts:21
  • web/src/auto-imports.d.ts:22 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useScrollShadow) — import the package by name instead. — web/src/auto-imports.d.ts:22
  • web/src/auto-imports.d.ts:23 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useScrollspy) — import the package by name instead. — web/src/auto-imports.d.ts:23
  • web/src/auto-imports.d.ts:24 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useToast) — import the package by name instead. — web/src/auto-imports.d.ts:24
  • web/src/auto-imports.d.ts:25 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useTour) — import the package by name instead. — web/src/auto-imports.d.ts:25
  • web/src/components.d.ts:22 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Alert.vue) — import the package by name instead. — web/src/components.d.ts:22
  • web/src/components.d.ts:23 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/App.vue) — import the package by name instead. — web/src/components.d.ts:23
  • web/src/components.d.ts:24 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Badge.vue) — import the package by name instead. — web/src/components.d.ts:24
  • web/src/components.d.ts:25 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Button.vue) — import the package by name instead. — web/src/components.d.ts:25
  • web/src/components.d.ts:26 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Checkbox.vue) — import the package by name instead. — web/src/components.d.ts:26
  • web/src/components.d.ts:27 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Collapsible.vue) — import the package by name instead. — web/src/components.d.ts:27
  • web/src/components.d.ts:28 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Drawer.vue) — import the package by name instead. — web/src/components.d.ts:28
  • web/src/components.d.ts:29 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/DropdownMenu.vue) — import the package by name instead. — web/src/components.d.ts:29
  • web/src/components.d.ts:30 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/FormField.vue) — import the package by name instead. — web/src/components.d.ts:30
  • web/src/components.d.ts:31 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/vue/components/Icon.vue) — import the package by name instead. — web/src/components.d.ts:31
  • web/src/components.d.ts:32 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Input.vue) — import the package by name instead. — web/src/components.d.ts:32
  • web/src/components.d.ts:33 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Modal.vue) — import the package by name instead. — web/src/components.d.ts:33
  • web/src/components.d.ts:34 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Popover.vue) — import the package by name instead. — web/src/components.d.ts:34
  • web/src/components.d.ts:35 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Progress.vue) — import the package by name instead. — web/src/components.d.ts:35
  • web/src/components.d.ts:36 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Select.vue) — import the package by name instead. — web/src/components.d.ts:36
  • web/src/components.d.ts:37 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/SelectMenu.vue) — import the package by name instead. — web/src/components.d.ts:37
  • web/src/components.d.ts:38 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Tabs.vue) — import the package by name instead. — web/src/components.d.ts:38
  • web/src/components.d.ts:39 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Textarea.vue) — import the package by name instead. — web/src/components.d.ts:39
  • web/src/components.d.ts:40 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Tooltip.vue) — import the package by name instead. — web/src/components.d.ts:40
  • web/src/failures.ts:7 reaches into another package with a relative path (../../npm/client-protocol) — import the package by name instead. — web/src/failures.ts:7
  • web/src/features/extensions/ExtensionPanel.vue:4 reaches into another package with a relative path (../../../../npm/ui) — import the package by name instead. — web/src/features/extensions/ExtensionPanel.vue:4
  • web/src/features/extensions/context.ts:1 reaches into another package with a relative path (../../../../npm/ui) — import the package by name instead. — web/src/features/extensions/context.ts:1
  • web/src/rpc/protocol.ts:1 reaches into another package with a relative path (../../../npm/client-protocol) — import the package by name instead. — web/src/rpc/protocol.ts:1
  • web/src/rpc/read.ts:895 reaches into another package with a relative path (../../../npm/ui) — import the package by name instead. — web/src/rpc/read.ts:895

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity6.6 / 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.

  • content has cyclomatic complexity 48 and cognitive complexity 45; 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. — web/src/rpc/read.ts:602
  • apply has cyclomatic complexity 45 and cognitive complexity 52; 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. — web/src/projection.ts:113
  • executeStage has cyclomatic complexity 41 and cognitive complexity 68; 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. — runtime/plugins/workflow/engine.ts:261
  • save has cyclomatic complexity 38 and cognitive complexity 48; 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. — web/src/features/settings/ProviderModels.vue:120
  • read has cyclomatic complexity 36 and cognitive complexity 73; 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. — runtime/plugins/workflow/history.ts:25
  • submit has cyclomatic complexity 36 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/features/chat/ComposerPanel.vue:434
  • update has cyclomatic complexity 33 and cognitive complexity 51; 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. — web/src/features/settings/SchedulePlan.vue:44
  • onKeydown has cyclomatic complexity 31 and cognitive complexity 34; 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. — web/src/features/chat/ComposerPanel.vue:638
  • askQuestion has cyclomatic complexity 31 and cognitive complexity 32; 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. — web/src/rpc/read.ts:733
  • sync has cyclomatic complexity 29 and cognitive complexity 37; 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. — web/src/stores/chat.ts:181
  • applyNotification has cyclomatic complexity 29 and cognitive complexity 33; 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. — web/src/stores/chat.ts:273
  • edit has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — web/src/features/settings/McpSettings.vue:315
  • updateLocked has cyclomatic complexity 21 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/stage-plugins.mjs:256
  • runCommand has cyclomatic complexity 21 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. — web/src/features/chat/ComposerPanel.vue:614
  • patch has cyclomatic complexity 20 and cognitive complexity 29; 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. — web/src/features/settings/mcp-form.ts:36
  • (anonymous) has cyclomatic complexity 20 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 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. — web/src/features/extensions/ExtensionPanel.vue:51
  • readNotification has cyclomatic complexity 20 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. — web/src/rpc/read.ts:822
  • save 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. — web/src/features/settings/AgentSettings.vue:88
  • generateBundle has cyclomatic complexity 18 and cognitive complexity 33; 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. — web/vite.config.ts:41
  • loadHistory has cyclomatic complexity 18 and cognitive complexity 28; 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. — web/src/stores/chat.ts:481
  • (anonymous) 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. — web/src/features/chat/TimelineWorkItem.vue:56
  • patch has cyclomatic complexity 18 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/features/settings/ProviderConnectionForm.vue:81
  • validatePolicy has cyclomatic complexity 18 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. — scripts/update-provider-catalog.ts:74
  • action has cyclomatic complexity 18 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. — web/src/features/settings/McpSettings.vue:411
  • reasoningMetadataFromModel has cyclomatic complexity 18 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/update-provider-catalog.ts:915
  • syncProvider has cyclomatic complexity 17 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/update-provider-catalog.ts:177
  • poll has cyclomatic complexity 17 and cognitive complexity 22; 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. — web/src/features/settings/ProviderAuthFlow.vue:49
  • release 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. — scripts/stage-image.test.mjs:71
  • move has cyclomatic complexity 17 and cognitive complexity 15; 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. — web/src/features/settings/McpSettings.vue:451
  • saveExecution has cyclomatic complexity 17 and cognitive complexity 15; 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. — web/src/features/settings/PermissionsSettings.vue:89
  • load has cyclomatic complexity 17 and cognitive complexity 13; 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. — web/src/features/settings/AgentSettings.vue:63
  • validateCatalog has cyclomatic complexity 16 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/update-provider-catalog.ts:828
  • resolveToolDisplay has cyclomatic complexity 16 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. — web/src/features/chat/tool-display.ts:27
  • readPersisted has cyclomatic complexity 16 and cognitive complexity 15; 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. — web/src/stores/ui.ts:42
  • push has cyclomatic complexity 16 and cognitive complexity 13; 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. — web/src/history-window.ts:41
  • save has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/features/settings/ScheduledSettings.vue:195
  • applyEvent has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/stores/chat.ts:351
  • approvalKeyDecision has cyclomatic complexity 16 and cognitive complexity 11; 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. — web/src/features/lines/line-state.ts:71
  • summarize has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/update-provider-catalog.ts:360
  • main 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. — scripts/update-provider-catalog.ts:121
R3 · Large Files7.2 / 10Strong✓ 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.

  • scripts/update-provider-catalog.ts has 1110 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — scripts/update-provider-catalog.ts:1
  • web/src/rpc/read.ts has 983 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/rpc/read.ts:1
  • web/src/stores/chat.ts has 846 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/stores/chat.ts:1
  • web/src/features/chat/ComposerPanel.vue has 824 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/features/chat/ComposerPanel.vue:1
  • web/src/features/settings/McpSettings.vue has 739 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/features/settings/McpSettings.vue:1
  • runtime/plugins/workflow/engine.ts has 471 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/plugins/workflow/engine.ts:1
  • web/src/features/settings/ScheduledSettings.vue has 426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/features/settings/ScheduledSettings.vue:1
  • web/src/projection.ts has 403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/projection.ts:1
  • web/src/features/chat/ChatPage.vue has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/features/chat/ChatPage.vue:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.9 / 10Exemplary✓ 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. — runtime/spikes/session-part.ts:1

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.9 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Nothing imports this binding — it is safe to review for removal. — web/src/rpc/read.ts:358
R8 · Dependency Hygiene5.0 / 10Adequate✓ 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.

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. — web/src/main.ts:8
  • Declared in REDACTED 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. — REDACTED:12
  • Declared in REDACTED 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. (×5) — REDACTED:16, REDACTED:17, REDACTED:18, …

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports8.1 / 10Strong✓ 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.

  • web/src/stores/chat.ts → web/src/stores/connection.ts → web/src/stores/chat.ts (one verified cycle inside a mutually-dependent group of 4 files) — web/src/stores/chat.ts:14

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture7.0 / 10Strong✓ 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 serves HTTP itself (`axum::serve(` (xtask/src/scenario_eval.rs:3841)), 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.

  • 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: `axum::serve(` (xtask/src/scenario_eval.rs:3841).
  • Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options. Missing: Strict-Transport-Security, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−1.0 on this card.) The server: `axum::serve(` (xtask/src/scenario_eval.rs:3841).

What to do

  • 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.
  • Add Strict-Transport-Security, X-Frame-Options beside the headers the Rust server already sets.
X1 · Async correctness8.0 / 10Strong✓ Tool-verified

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.

  • This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`. — crates/dim-cli/src/plugins.rs:152

What to do

  • Blocking `thread::sleep` inside an `async` body
X12 · Unreachable branch8.0 / 10Strong✓ Tool-verified

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.

  • `let count = unsafe { document.pageCount() };` follows `{ return Err(HelperError::encrypted_pdf()); }` (line 37) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/dim-ocr/src/pdf.rs:40
  • `stream` follows `{ return Err(io::Error::new(io::ErrorKind::PermissionDenied, "Daemon belongs …` (line 144) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/dim-client/src/lib.rs:150
  • `let cancel = matches !(request.call, Call::Catalog(_) | Call::Summaries(_)).t…` follows `{ return Err(RpcError::app(- 32000, "connection_busy", "Connection request li…` (line 587) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/dim-app-server/src/connection.rs:594
  • `let step = CompactionStep { turn_id : Some(source.turn_id.clone()), request_i…` follows `{ return Ok(PreparedRequest { request : view.prepared.clone(), estimate : Som…` (line 1237) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/dim-agent-capabilities/src/context_policy.rs:1246
  • `return self.record(machine, at, Summary { configuration : Some(next), .. Defa…` follows `{ return Ok(()); }` (line 777) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/dim-agent-capabilities/src/context_usage/sources.rs:780

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
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.

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 document1.1 / 10Critical✓ 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.

  • `current` is public and takes a `Changes` as its receiver from its caller, and it calls itself at line 94 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `current` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-goal/src/branch.rs:94
  • `change` is public and takes a `Changes` as its receiver from its caller, and it calls itself at line 110 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `change` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-goal/src/branch.rs:110
  • `uses` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 513 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `uses` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/agents.rs:513
  • `members` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 554 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `members` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/agents.rs:554
  • `close` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 1878 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `close` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/agents.rs:1878
  • `delete` is public and takes a `AgentIndex` as its receiver from its caller, and it recurses at line 1467 through `release_owned`, `remove_locked` and back with a piece of the document (and at line 1518, line 1522, line 1559, line 1695) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `delete` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/agents.rs:1467
  • `forget` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 2052 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `forget` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/agents.rs:2052
  • `closed` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 783 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `closed` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/agents.rs:783
  • `close` is public and takes a `ConnectionHub` as its receiver from its caller, and it calls itself at line 2242 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `close` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/connection.rs:2242
  • `state` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 333 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `state` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:333
  • `failure` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 337 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `failure` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:337
  • `generation` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 342 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `generation` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:342
  • `discovered` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 347 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `discovered` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:347
  • `subscribe` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 355 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `subscribe` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:355
  • `tool_changes` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 358 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tool_changes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:358
  • `credential_changes` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 362 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `credential_changes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:362
  • `tools` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 365 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tools` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:365
  • `call` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 373 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `call` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:373
  • `call_result` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 381 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `call_result` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:381
  • `resource` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 388 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `resource` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:388
  • `disconnect` is public and takes a `McpService` as its receiver from its caller, and it calls itself at line 507 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:507
  • `application` is public and takes a `McpService` as its receiver from its caller, and it calls itself at line 513 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `application` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:513
  • `clear_secret_if` is public and takes a `McpService` as its receiver from its caller, and it recurses at line 961 through `remove_secret_if`, `set_project_enabled`, `write`, `update` and back with a piece of the document (and at line 1096, line 1100, line 1385, line 1405, line 1426, line 1445, line 1458, line 1736, line 1766) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clear_secret_if` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/mcp.rs:961
  • `send` is public and takes a `Sender` as its receiver from its caller, and it recurses at line 83 through `push` and back with a piece of the document (and at line 117) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/outbound.rs:83
  • `register` is public and takes a `SettingsService` as its receiver from its caller, and it recurses at line 213 through `insert` and back with a piece of the document (and at line 287) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `register` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/settings.rs:213
  • `authorize_project` is public, takes a document from its caller (line 290) and hands it to `emit`, which calls itself at line 353 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `emit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/settings.rs:353
  • `read` is public, takes a document from its caller (line 392) and hands it to `path`, which recurses at line 363 through `locate` and back with a piece of the document (and at line 381) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `path` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/settings.rs:363
  • `read` is public and takes a `SettingsService` as its receiver from its caller, and it recurses at line 399 through `read_source` and back with a piece of the document (and at line 432) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `read` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/settings.rs:399
  • `update` is public, takes a document from its caller (line 401) and hands it to `replace`, which calls itself at line 469 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `replace` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/settings.rs:469
  • `finished` is public, takes a document from its caller (line 115) and hands it to `remove`, which recurses at line 276 through `forget` and back with a piece of the document (and at line 260) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `remove` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/ui_host.rs:276
  • `session_config` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 25 with a piece of the document (and at line 267) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `session_config` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:25
  • `query` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 33 with a piece of the document (and at line 276) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `query` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:33
  • `catalog` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 45 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `catalog` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:45
  • `add_grant` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 54 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `add_grant` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:54
  • `remove_grant` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 61 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `remove_grant` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:61
  • `grants` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 64 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `grants` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:64
  • `set_session_language` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 71 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `set_session_language` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:71
  • `creation_record` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 77 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `creation_record` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:77
  • `owner` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 80 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `owner` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:80
  • `has_records` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 83 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `has_records` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dim-app-server/src/storage/face.rs:83

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 correctness7.7 / 10Strong✓ Tool-verified

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.

  • `output` (line 55) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — crates/dim-cli/src/export.rs:55
  • `worker` (line 446) is a `Worker` this function owns and never releases: no `run()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Worker` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/dim-cli/src/session_host.rs:446
  • `out` (line 245) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends. — crates/dim-app-server/src/cli.rs:245
  • `source` (line 264) is a `Source` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Source` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/dim-app-server/src/collaboration/approvals.rs:264
  • `source` (line 347) is a `Source` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Source` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/dim-app-server/src/collaboration/approvals.rs:347

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X2 · Cancellation propagation4.0 / 10Weak✓ 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 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) 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.
  • `diagnoseRefusal` 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 })`. — web/src/rpc/client.ts:154
  • `exchangeBootstrapToken` 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 })`. — web/src/rpc/client.ts:224

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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 guard8.0 / 10Strong✓ Tool-verified

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. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`. In Rust, where a guard or permit releases when it is dropped, whether a release written BY HAND — `add_permits` after a forgotten permit, `force_unlock` after a leaked guard, a raw lock's `unlock` — matches the state the function's own acquisitions put the primitive in: not after a try or timed acquire whose failure does not leave, not from a cleanup set up before an acquire that can fail, not skipped by a `?`, `return`, `break` or `continue`, and not on top of a guard that still releases itself.

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.

  • `require_unowned` tries to take `admission` on line 81, but a failure does not leave: `unlock` on line 82 runs on the failure path too, giving back a permit that was never taken (the pool grows past its limit) or unlocking a lock this thread does not hold. Leave on failure (`let Ok(p) = … else { return … }`, `?`), or release only inside the branch that took it. — crates/dim-app-server/src/storage/prompt_migration.rs:82

What to do

  • Each finding names the return, the `finally` guard it disagrees with, and the flag state the method's own assignments put it in at that point. Confirm from the three, then make the two statements of ownership agree: the flag and the returned value both say whether the caller now owns the primitive, so a return reporting success must leave the guard skipping the release, and a return reporting failure must leave it performing one. Setting the flag immediately before the return that reports success — never after it, and never on a path that goes on to report failure — is what keeps the pair readable.
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.

X25 · Inert configuration knob7.4 / 10Strong✓ Tool-verified

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.

  • `PutParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-attachments/src/lib.rs:33
  • `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. (×11) — crates/dim-agent-capabilities/src/agent_loop/read.rs:15, crates/dim-agent-capabilities/src/input_queue/pending.rs:13, crates/dim-agent-capabilities/src/tool_executor/read.rs:15, …
  • `WithdrawParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-capabilities/src/input_queue.rs:635
  • `RequestParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-capabilities/src/prompt_suggestion.rs:681
  • `RespondParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-capabilities/src/prompt_suggestion.rs:689
  • `RunParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-capabilities/src/shell_input.rs:77
  • `StopParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-capabilities/src/shell_input.rs:92
  • `ListParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-capabilities/src/shell_input.rs:100
  • `OptionInput._description` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-questions/src/lib.rs:101
  • `CatalogCapabilities.structured_output` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:104
  • `ModelReasoning.level` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:187
  • `ModelReasoning.level_options` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:189
  • `ModelReasoning.verbosity` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:191
  • `ModelReasoning.verbosity_options` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:193
  • `ModelReasoning.interleaved` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:195
  • `RequestMetadata.trace_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/model.rs:862
  • `ToolMetadata.author` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/tool.rs:347
  • `ToolMetadata.docs_url` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/tool.rs:353
  • `ToolMetadata.source_plugin_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/tool.rs:359
  • `ToolFileChangeDeclaration.pre_execute_paths` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/tool.rs:390
  • `ToolFileChangeDeclaration.post_execute_paths` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-agent-types/src/tool.rs:396
  • `RequiredServers._mcp_servers` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/mcp/config.rs:315
  • `Attach._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/mcp/temporary.rs:54
  • `Address._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/mcp/temporary.rs:62
  • `ModelMetadata.metadata_source` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/model_catalog.rs:132
  • `ModelMetadata.match_score` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/model_catalog.rs:140
  • `ModelMetadata.metadata_match_reason` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/model_catalog.rs:142
  • `ModelIdentification.narrowed_by_display_name` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/model_catalog.rs:160
  • `ResourcePageRequest._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-app-server/src/ui_extensions/resources.rs:168
  • `Updated._version` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/dim-cli/src/permission.rs:68

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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.

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.

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 logging7.6 / 10Strong✓ Tool-verified

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 `REDACTED` 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.

  • `warn!` at line 1617 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/dim-app-server/src/agents.rs:1617
  • `info!` at line 446 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/dim-app-server/src/session_typescript.rs:446

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types8.8 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.

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

  • `PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `root` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:116
  • `root.root_view()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `process_rows` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:213
  • `snapshot["plugins"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — xtask/src/main.rs:244, xtask/src/main.rs:255
  • `p["id"].as_u64()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:245
  • `p["name"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:249
  • `p["resolved"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:256
  • `edge["provider"].as_u64()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:257
  • `edge["service"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:261
  • `d.plugins.iter().find(|p|p.name==name)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:280
  • `d.plugins.iter().find(|p|Some(p.id)==scope.parent).map(|p|p.instance)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:285
  • `metadata["packages"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:358
  • `p["name"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:359
  • `p["dependencies"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:360
  • `d["name"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/main.rs:361
  • `d.plugins.iter().find(|p|p.name==name)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/plugins.rs:247
  • `d.plugins.iter().find(|p|Some(p.id)==scope.parent).map(|p|p.instance)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/plugins.rs:252
  • `process.root_view()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/plugins.rs:259
  • `file.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `write` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/plugins.rs:294
  • `settings.unix_path.clone()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `serve_one` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/prompt_eval.rs:433
  • `arms.get_mut(arm)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `report` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — xtask/src/prompt_eval.rs:1839, xtask/src/prompt_eval.rs:1844
  • `absolute.ancestors().last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve_output` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:1481
  • `absolute.strip_prefix(root)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve_output` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:1487
  • `path.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `set_member` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:1616
  • `target.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `set_member` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — xtask/src/scenario_eval.rs:1623, xtask/src/scenario_eval.rs:1631
  • `socket.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run_once` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:3475
  • `params_path.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `isolate_run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:3614
  • `socket.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `native_probe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:3680
  • `target.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `augment_model_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:3776
  • `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_preflight` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:3841
  • `std::env::current_exe()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `child_command` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:3849
  • `params.env_home.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `child_environment` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×4) — xtask/src/scenario_eval.rs:3925, xtask/src/scenario_eval.rs:3932, xtask/src/scenario_eval.rs:3941, …
  • `serde_json::to_string(&line)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `judge_view` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:5970
  • `judged.get(&probe.id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `verdicts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:6241
  • `std::fs::read_dir(directory)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `walk` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — xtask/src/scenario_eval.rs:7193

What to do

  • Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 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
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 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.2, 2.1.4, 2.2.2, 2.3.1, 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.7Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture64.0Adequate — gated by R11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity95.1ExemplarySolid.
Readiness49.2Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security82.5Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven68.9StrongSolid.
Event Sourcing100.0ExemplaryStrongest area.
Accessibility68.4StrongSolid.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 32 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 13 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 40 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.

  • 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; 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 TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. 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)
  • AX6 Interface segregation — AX6 reached only 7% of this repository's production lines — rust (369,780 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run dev` in web/) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> dim-web@0.0.0 dev / > vite / VITE v6.4.4 ready in 457 ms / ➜ Local: http://localhost:5173/ / ➜ Network: use --host to expose" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — 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 scored — polyglot repository, one half's runner produced no measurement
  • 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 — D21 withholds its case and prefix conventions rows: 21 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
  • D25 ADR Conformance — None of 8 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.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) — 8 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 178 value object(s); 22 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
  • 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • 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 — coverage data present for 5 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • 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.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X24 Document value interpolated into markup unescaped — X24 reached only 7% of this repository's production lines — rust (369,780 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 7% of this repository's production lines — rust (369,780 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 51 finding(s)
ED1 · Handler temporal coupling · Blocking call on the event loop · ×40
  • Blocking call on the event loop: ModelConfigFile.load calls `std::fs::read` crates/dim-agent-aimux/src/config.rs:19 — `ModelConfigFile.load` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: recording.secure calls `std::fs::set_permissions` crates/dim-agent-aimux/src/recording.rs:249 — `recording.secure` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::set_permissions`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: recording.secure calls `std::fs::set_permissions` crates/dim-agent-aimux/src/recording.rs:265 — `recording.secure` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::set_permissions`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: file_access.existing_directory calls `std::fs::metadata` crates/dim-agent-capabilities/src/file_access.rs:731 — `file_access.existing_directory` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: host_platform.platform_roots calls `std::fs::canonicalize` crates/dim-agent-capabilities/src/host_platform.rs:187 — `host_platform.platform_roots` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: host_platform.collect calls `std::fs::read_dir` crates/dim-agent-capabilities/src/host_platform.rs:1572 — `host_platform.collect` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: isolation.bubblewrap calls `std::fs::metadata` crates/dim-agent-capabilities/src/host_platform/isolation.rs:21 — `isolation.bubblewrap` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off calls `std::fs::create_dir_all` crates/dim-agent-capabilities/src/host_platform/isolation.rs:511 — `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off calls `std::fs::write` crates/dim-agent-capabilities/src/host_platform/isolation.rs:513 — `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off calls `std::fs::set_permissions` crates/dim-agent-capabilities/src/host_platform/isolation.rs:514 — `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::set_permissions`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off calls `std::fs::remove_dir_all` crates/dim-agent-capabilities/src/host_platform/isolation.rs:541 — `isolation.bubblewrap_unshares_the_network_only_when_the_switch_is_off` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: ShellSession.run_background calls `std::fs::read_to_string` crates/dim-agent-capabilities/src/shell_session.rs:1263 — `ShellSession.run_background` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: shell_session.file_tail calls `std::fs::read` crates/dim-agent-capabilities/src/shell_session.rs:1613 — `shell_session.file_tail` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.walk calls `std::fs::read_dir` crates/dim-agent-capabilities/src/skills/install.rs:24 — `install.walk` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.walk calls `std::fs::symlink_metadata` crates/dim-agent-capabilities/src/skills/install.rs:34 — `install.walk` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.hash_file calls `File::open` crates/dim-agent-capabilities/src/skills/install.rs:65 — `install.hash_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.copy_tree calls `std::fs::create_dir_all` crates/dim-agent-capabilities/src/skills/install.rs:136 — `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.copy_tree calls `std::fs::read_dir` crates/dim-agent-capabilities/src/skills/install.rs:137 — `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.copy_tree calls `std::fs::symlink_metadata` crates/dim-agent-capabilities/src/skills/install.rs:145 — `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.copy_tree calls `std::fs::copy` crates/dim-agent-capabilities/src/skills/install.rs:149 — `install.copy_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.place calls `std::fs::create_dir_all` crates/dim-agent-capabilities/src/skills/install.rs:189 — `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.place calls `std::fs::create_dir_all` crates/dim-agent-capabilities/src/skills/install.rs:196 — `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.place calls `std::fs::symlink_metadata` crates/dim-agent-capabilities/src/skills/install.rs:197 — `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.place calls `std::fs::rename` crates/dim-agent-capabilities/src/skills/install.rs:200 — `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: install.place calls `std::fs::rename` crates/dim-agent-capabilities/src/skills/install.rs:212 — `install.place` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • + 15 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '@iconify/vue' · ×1
  • Unlisted import '@iconify/vue' web/src/main.ts:8 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) web/src/stores/chat.ts:14 — web/src/stores/chat.ts → web/src/stores/connection.ts → web/src/stores/chat.ts (one verified cycle inside a mutually-dependent group of 4 files)
Serious — 2462 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×170
  • Hotspot: crates/dim-cli/src/ui/tui.rs crates/dim-cli/src/ui/tui.rs:2247 — crates/dim-cli/src/ui/tui.rs changed 352 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 182 in App::apply at line 2247. 154 of those changes were fix/bug commits, and the other 198 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/tui.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/dim-cli/src/session_host.rs crates/dim-cli/src/session_host.rs:1285 — crates/dim-cli/src/session_host.rs changed 222 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 173 in Worker::command at line 1285. 81 of those changes were fix/bug commits, and the other 141 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/session_host.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:616 — REDACTED changed 112 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 328 in Options::parse at line 616. 19 of those changes were fix/bug commits, and the other 93 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/dim-app-server/src/lib.rs crates/dim-app-server/src/lib.rs:464 — crates/dim-app-server/src/lib.rs changed 193 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in dim_app_server::serve at line 464. 20 of those changes were fix/bug commits, and the other 173 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/lib.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/dim-app-server/src/connection.rs crates/dim-app-server/src/connection.rs:899 — crates/dim-app-server/src/connection.rs changed 126 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 117 in Connection::handle at line 899. 24 of those changes were fix/bug commits, and the other 102 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/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/dim-cli/src/session.rs crates/dim-cli/src/session.rs:633 — crates/dim-cli/src/session.rs changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in dim_cli::session::wait_turn at line 633. 10 of those changes were fix/bug commits, and the other 48 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/session.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: xtask/src/scenario_eval.rs xtask/src/scenario_eval.rs:4538 — xtask/src/scenario_eval.rs changed 121 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in xtask::scenario_eval::drive at line 4538. 62 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- xtask/src/scenario_eval.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/dim-cli/src/lib.rs crates/dim-cli/src/lib.rs:660 — crates/dim-cli/src/lib.rs changed 99 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in dim_cli::act at line 660. 23 of those changes were fix/bug commits, and the other 76 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/lib.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/dim-cli/src/projection.rs crates/dim-cli/src/projection.rs:204 — crates/dim-cli/src/projection.rs changed 93 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in Projection::fold at line 204. 32 of those changes were fix/bug commits, and the other 61 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/projection.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: REDACTED REDACTED:1268 — REDACTED changed 84 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in SqliteStorage::open_reporting at line 1268. 25 of those changes were fix/bug commits, and the other 59 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/dim-acp/src/gateway.rs crates/dim-acp/src/gateway.rs:1224 — crates/dim-acp/src/gateway.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in Gateway::work at line 1224. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-acp/src/gateway.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/dim-app-server/src/cli.rs crates/dim-app-server/src/cli.rs:215 — crates/dim-app-server/src/cli.rs changed 51 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in dim_app_server::cli::run_with at line 215. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/cli.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/dim-app-server/src/provider.rs crates/dim-app-server/src/provider.rs:840 — crates/dim-app-server/src/provider.rs changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in dim_app_server::provider::validate_static_record at line 840. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/provider.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/dim-cli/src/ui/render/fullscreen.rs crates/dim-cli/src/ui/render/fullscreen.rs:904 — crates/dim-cli/src/ui/render/fullscreen.rs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in FullScreen::mouse at line 904. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/render/fullscreen.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/dim-cli/src/client.rs crates/dim-cli/src/client.rs:845 — crates/dim-cli/src/client.rs changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in dim_cli::client::connect_inner at line 845. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/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.
  • Hotspot: crates/dim-agent-capabilities/src/agent_loop.rs crates/dim-agent-capabilities/src/agent_loop.rs:1361 — crates/dim-agent-capabilities/src/agent_loop.rs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in AgentLoop::on_event at line 1361. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-agent-capabilities/src/agent_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.
  • Hotspot: crates/dim-app-server/src/transport.rs crates/dim-app-server/src/transport.rs:644 — crates/dim-app-server/src/transport.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in dim_app_server::transport::run_connection at line 644. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/transport.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/dim-agent-capabilities/src/timeline_tree.rs crates/dim-agent-capabilities/src/timeline_tree.rs:4183 — crates/dim-agent-capabilities/src/timeline_tree.rs changed 80 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in dim_agent_capabilities::timeline_tree::line_read_items at line 4183. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-agent-capabilities/src/timeline_tree.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/dim-app-server/src/mcp/management.rs crates/dim-app-server/src/mcp/management.rs:661 — crates/dim-app-server/src/mcp/management.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in dim_app_server::mcp::management::provide at line 661. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/mcp/management.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/dim-app-server/src/collaboration.rs crates/dim-app-server/src/collaboration.rs:1464 — crates/dim-app-server/src/collaboration.rs changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in CollaborationSession::read at line 1464. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/collaboration.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/dim-agent-capabilities/src/context_policy.rs crates/dim-agent-capabilities/src/context_policy.rs:992 — crates/dim-agent-capabilities/src/context_policy.rs changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in ContextPolicy::prepare at line 992. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-agent-capabilities/src/context_policy.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: REDACTED REDACTED:1880 — REDACTED changed 134 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in dim_app_server::storage::timeline::write_batch at line 1880. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/dim-cli/src/ui/prompts.rs crates/dim-cli/src/ui/prompts.rs:1303 — crates/dim-cli/src/ui/prompts.rs changed 73 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in AskUserPrompt::handle_key at line 1303. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/prompts.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/dim-app-server/src/connection/tree.rs crates/dim-app-server/src/connection/tree.rs:180 — crates/dim-app-server/src/connection/tree.rs changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Connection::history at line 180. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/connection/tree.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/dim-app-server/src/agents.rs crates/dim-app-server/src/agents.rs:1511 — crates/dim-app-server/src/agents.rs changed 110 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in AgentIndex::remove_locked at line 1511. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/agents.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.
  • + 145 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×135
  • FileTooLong: ui/tui.rs crates/dim-cli/src/ui/tui.rs — FileTooLong — 6433 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: App (3 blocks, 1053-8480), declaring 39 free functions. The bar is 500 significant lines; this is 5933 over it, 12.87× 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: src/scenario_eval.rs xtask/src/scenario_eval.rs — FileTooLong — 4339 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 115 free functions. The bar is 500 significant lines; this is 3839 over it, 8.68× 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/session_host.rs crates/dim-cli/src/session_host.rs — FileTooLong — 3887 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: Worker (2 blocks, 259-4886). The bar is 500 significant lines; this is 3387 over it, 7.77× 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: src/timeline_tree.rs crates/dim-agent-capabilities/src/timeline_tree.rs — FileTooLong — 3379 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 2879 over it, 6.76× 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/collaboration.rs crates/dim-app-server/src/collaboration.rs — FileTooLong — 2876 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 2376 over it, 5.75× 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: storage/query.rs crates/dim-app-server/src/storage/query.rs — FileTooLong — 2789 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 2289 over it, 5.58× 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/provider.rs crates/dim-app-server/src/provider.rs — FileTooLong — 2531 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 2031 over it, 5.06× 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: REDACTED REDACTED — FileTooLong — 2323 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 1823 over it, 4.65× 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/gateway.rs crates/dim-acp/src/gateway.rs — FileTooLong — 2235 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: Gateway (2 blocks, 257-2737). The bar is 500 significant lines; this is 1735 over it, 4.47× 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: src/connection.rs crates/dim-app-server/src/connection.rs — FileTooLong — 1974 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: Connection (2 blocks, 63-1937). The bar is 500 significant lines; this is 1474 over it, 3.95× 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: src/context_policy.rs crates/dim-agent-capabilities/src/context_policy.rs — FileTooLong — 1966 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 1466 over it, 3.93× 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: workspace_tools/exec.rs crates/dim-agent-capabilities/src/workspace_tools/exec.rs — FileTooLong — 1937 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 48 free functions. The bar is 500 significant lines; this is 1437 over it, 3.87× 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/engine.rs crates/dim-modality/src/engine.rs — FileTooLong — 1933 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 1433 over it, 3.87× 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: transcript/tool_group.rs crates/dim-cli/src/ui/transcript/tool_group.rs — FileTooLong — 1834 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 67 free functions. The bar is 500 significant lines; this is 1334 over it, 3.67× 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/prompt_eval.rs xtask/src/prompt_eval.rs — FileTooLong — 1709 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 1209 over it, 3.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/events.rs crates/dim-agent-types/src/events.rs — FileTooLong — 1673 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 1173 over it, 3.35× 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: hooks/runner.rs crates/dim-agent-capabilities/src/hooks/runner.rs — FileTooLong — 1647 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 1147 over it, 3.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/projection.rs crates/dim-cli/src/projection.rs — FileTooLong — 1647 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: Projection (2 blocks, 44-1933). The bar is 500 significant lines; this is 1147 over it, 3.29× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1627 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: Options (3 blocks, 561-2189). The bar is 500 significant lines; this is 1127 over it, 3.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/agents.rs crates/dim-app-server/src/agents.rs — FileTooLong — 1621 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: AgentIndex (2 blocks, 366-2054). The bar is 500 significant lines; this is 1121 over it, 3.24× 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: src/assembly.rs crates/dim-agent-runtime/src/assembly.rs — FileTooLong — 1603 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 1103 over it, 3.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/file_storage.rs crates/dim-agent-capabilities/src/file_storage.rs — FileTooLong — 1595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 40 free functions. The bar is 500 significant lines; this is 1095 over it, 3.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: src/plugin_manager.rs crates/dim-app-server/src/plugin_manager.rs — FileTooLong — 1581 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 1081 over it, 3.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/host_platform.rs crates/dim-agent-capabilities/src/host_platform.rs — FileTooLong — 1572 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 1072 over it, 3.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: render/fullscreen.rs crates/dim-cli/src/ui/render/fullscreen.rs — FileTooLong — 1535 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: FullScreen (2 blocks, 325-1824). The bar is 500 significant lines; this is 1035 over it, 3.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • + 110 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×129
  • MethodTooLong: Options.parse REDACTED:616 — MethodTooLong — parse runs 899 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 799 over it, 8.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: Worker.command crates/dim-cli/src/session_host.rs:1285 — MethodTooLong — command runs 803 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 703 over it, 8.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Gateway.work crates/dim-acp/src/gateway.rs:1224 — MethodTooLong — work runs 615 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 515 over it, 6.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: App.frame crates/dim-cli/src/ui/tui.rs:5696 — MethodTooLong — frame runs 595 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 495 over it, 5.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.apply crates/dim-cli/src/ui/tui.rs:2247 — MethodTooLong — apply runs 562 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 462 over it, 5.62× 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: Gateway.request crates/dim-acp/src/gateway.rs:454 — MethodTooLong — request runs 541 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 441 over it, 5.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentLoop.rebuild crates/dim-agent-capabilities/src/agent_loop.rs:559 — MethodTooLong — rebuild runs 472 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 372 over it, 4.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Connection.handle crates/dim-app-server/src/connection.rs:899 — MethodTooLong — handle runs 407 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 307 over it, 4.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.apply_effect crates/dim-cli/src/ui/tui.rs:3960 — MethodTooLong — apply_effect runs 340 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 240 over it, 3.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentLoop.on_event crates/dim-agent-capabilities/src/agent_loop.rs:1361 — MethodTooLong — on_event runs 313 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 213 over it, 3.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.
  • MethodTooLong: Projection.fold crates/dim-cli/src/projection.rs:204 — MethodTooLong — fold runs 304 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 204 over it, 3.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: SqliteStorage.open_reporting REDACTED:1268 — MethodTooLong — open_reporting runs 295 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 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Compiler.physical_filter_for crates/dim-app-server/src/storage/query.rs:933 — MethodTooLong — physical_filter_for runs 287 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 187 over it, 2.87× 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: ToolExecutorPlugin.apply crates/dim-agent-capabilities/src/tool_executor.rs:282 — MethodTooLong — apply 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: App.transcript crates/dim-cli/src/ui/tui.rs:6745 — MethodTooLong — transcript runs 279 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 179 over it, 2.79× 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: Narrative.fold crates/dim-agent-capabilities/src/recall.rs:423 — MethodTooLong — fold runs 271 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 171 over it, 2.71× 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: ContextPolicy.prepare crates/dim-agent-capabilities/src/context_policy.rs:992 — MethodTooLong — prepare runs 250 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 150 over it, 2.50× 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: FullScreen.mouse crates/dim-cli/src/ui/render/fullscreen.rs:904 — MethodTooLong — mouse runs 249 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 149 over it, 2.49× 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: Projection.load crates/dim-agent-capabilities/src/prompt/recovery.rs:946 — MethodTooLong — load runs 246 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 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InputQueue.rebuild crates/dim-agent-capabilities/src/input_queue/recovery.rs:121 — MethodTooLong — rebuild runs 244 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 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.run_command crates/dim-cli/src/ui/tui.rs:5313 — MethodTooLong — run_command runs 244 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 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Source.session crates/dim-migration/src/source.rs:515 — MethodTooLong — session runs 232 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 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContextPolicy.compact_step crates/dim-agent-capabilities/src/context_policy.rs:1328 — MethodTooLong — compact_step runs 226 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 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ModalityTasks.submit crates/dim-modality/src/engine.rs:886 — MethodTooLong — submit runs 222 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SkillsCatalogPlugin.apply crates/dim-app-server/src/skills_management.rs:626 — MethodTooLong — apply runs 219 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 119 over it, 2.19× 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.
  • + 104 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×89
  • FunctionTooLong: dim_app_server::serve crates/dim-app-server/src/lib.rs:464 — FunctionTooLong — dim_app_server::serve runs 735 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 635 over it, 7.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: chat.useChatStore web/src/stores/chat.ts:123 — FunctionTooLong — useChatStore runs 603 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 503 over it, 6.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_cli::session::wait_turn crates/dim-cli/src/session.rs:633 — FunctionTooLong — dim_cli::session::wait_turn runs 488 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 388 over it, 4.88× 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: dim_app_server::storage::query::execute crates/dim-app-server/src/storage/query.rs:2962 — FunctionTooLong — dim_app_server::storage::query::execute runs 464 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 364 over it, 4.64× 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: dim_app_server::storage::query::sources crates/dim-app-server/src/storage/query.rs:1873 — FunctionTooLong — dim_app_server::storage::query::sources runs 457 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 357 over it, 4.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_app_server::mcp::management::provide crates/dim-app-server/src/mcp/management.rs:661 — FunctionTooLong — dim_app_server::mcp::management::provide runs 455 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 355 over it, 4.55× 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: dim_cli::ui::tui::run_terminal crates/dim-cli/src/ui/tui.rs:234 — FunctionTooLong — dim_cli::ui::tui::run_terminal runs 448 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 348 over it, 4.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: dim_app_server::cli::run_with crates/dim-app-server/src/cli.rs:215 — FunctionTooLong — dim_app_server::cli::run_with runs 328 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 228 over it, 3.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_agent_aimux::request::native::apply crates/dim-agent-aimux/src/request/native.rs:206 — FunctionTooLong — dim_agent_aimux::request::native::apply runs 313 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 213 over it, 3.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: dim_app_server::storage::members::candidates_for crates/dim-app-server/src/storage/members.rs:1109 — FunctionTooLong — dim_app_server::storage::members::candidates_for runs 313 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 213 over it, 3.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: dim_cli::act crates/dim-cli/src/lib.rs:660 — FunctionTooLong — dim_cli::act runs 293 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 193 over it, 2.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_app_server::collaboration::restore crates/dim-app-server/src/collaboration.rs:3678 — FunctionTooLong — dim_app_server::collaboration::restore 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: dim_cli::session::chat crates/dim-cli/src/session.rs:202 — FunctionTooLong — dim_cli::session::chat runs 260 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 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_oauth::models::project crates/dim-oauth/src/models.rs:338 — FunctionTooLong — dim_oauth::models::project runs 254 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 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: xtask::scenario_eval::drive xtask/src/scenario_eval.rs:4538 — FunctionTooLong — xtask::scenario_eval::drive runs 254 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 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_agent_capabilities::recall::search::index crates/dim-agent-capabilities/src/recall/search.rs:1102 — FunctionTooLong — dim_agent_capabilities::recall::search::index runs 241 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 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: xtask::scenario_eval::preflight_checks xtask/src/scenario_eval.rs:3082 — FunctionTooLong — xtask::scenario_eval::preflight_checks 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: dim_app_server::transport::run_connection crates/dim-app-server/src/transport.rs:644 — FunctionTooLong — dim_app_server::transport::run_connection 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.
  • FunctionTooLong: dim_app_server::provider::legacy::convert_legacy_provider crates/dim-app-server/src/provider/legacy.rs:319 — FunctionTooLong — dim_app_server::provider::legacy::convert_legacy_provider runs 221 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 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: dim_agent_aimux::request::convert crates/dim-agent-aimux/src/request.rs:49 — FunctionTooLong — dim_agent_aimux::request::convert runs 219 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 119 over it, 2.19× 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: dim_migration::native::history crates/dim-migration/src/native.rs:606 — FunctionTooLong — dim_migration::native::history runs 218 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 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dim_app_server::provider::management::provide crates/dim-app-server/src/provider/management.rs:103 — FunctionTooLong — dim_app_server::provider::management::provide runs 211 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 111 over it, 2.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.
  • FunctionTooLong: dim_cli::client::connect_inner crates/dim-cli/src/client.rs:845 — FunctionTooLong — dim_cli::client::connect_inner runs 200 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 100 over it, 2.00× 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: dim_cli::ui::transcript::tool_group::append_interactive crates/dim-cli/src/ui/transcript/tool_group.rs:539 — FunctionTooLong — dim_cli::ui::transcript::tool_group::append_interactive 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.
  • FunctionTooLong: dim_agent_runtime::memory_timeline_store::query::execute crates/dim-agent-runtime/src/memory_timeline_store/query.rs:631 — FunctionTooLong — dim_agent_runtime::memory_timeline_store::query::execute 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.
  • + 64 more in this group — see findings.md.
D2 · Cognitive Complexity · dim_app_server · ×58
  • dim_app_server::storage::members::candidates_for (cognitive 164) crates/dim-app-server/src/storage/members.rs:1109 — dim_app_server::storage::members::candidates_for has cognitive complexity 164 (threshold 15). Drivers by points: if/else 43 (106 pts), loops 14 (34 pts), boolean chains 22, match/switch 1 (2 pts) (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::storage::query::sources (cognitive 139) crates/dim-app-server/src/storage/query.rs:1873 — dim_app_server::storage::query::sources has cognitive complexity 139 (threshold 15). Drivers by points: if/else 45 (75 pts), loops 14 (37 pts), boolean chains 20, match/switch 5 (7 pts) (nesting depth added 55). Of this number, 116 points are the body's own statements and 23 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::storage::query::execute (cognitive 120) crates/dim-app-server/src/storage/query.rs:2962 — dim_app_server::storage::query::execute has cognitive complexity 120 (threshold 15). Drivers by points: if/else 52 (81 pts), match/switch 6 (14 pts), boolean chains 13, loops 6 (12 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::serve (cognitive 112) crates/dim-app-server/src/lib.rs:464 — dim_app_server::serve has cognitive complexity 112 (threshold 15). Drivers by points: if/else 54 (72 pts), match/switch 16 (21 pts), boolean chains 10, loops 5 (9 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.
  • dim_app_server::transport::run_connection (cognitive 107) crates/dim-app-server/src/transport.rs:644 — dim_app_server::transport::run_connection has cognitive complexity 107 (threshold 15). Drivers by points: if/else 24 (67 pts), match/switch 9 (27 pts), boolean chains 11, loops 2 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::mcp::management::provide (cognitive 85) crates/dim-app-server/src/mcp/management.rs:661 — dim_app_server::mcp::management::provide has cognitive complexity 85 (threshold 15). Drivers by points: if/else 24 (57 pts), match/switch 7 (17 pts), boolean chains 7, loops 1 (4 pts) (nesting depth added 46). 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.
  • dim_app_server::web::content::html_fragment_to_markdown (cognitive 77) crates/dim-app-server/src/web/content.rs:363 — dim_app_server::web::content::html_fragment_to_markdown has cognitive complexity 77 (threshold 15). Drivers by points: if/else 19 (60 pts), boolean chains 7, loops 2 (6 pts), match/switch 1 (4 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::cli::run_with (cognitive 76) crates/dim-app-server/src/cli.rs:215 — dim_app_server::cli::run_with has cognitive complexity 76 (threshold 15). Drivers by points: if/else 42 (54 pts), boolean chains 13, match/switch 3 (6 pts), loops 2 (3 pts) (nesting depth added 16). 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.
  • dim_app_server::mcp::session::discover (cognitive 64) crates/dim-app-server/src/mcp/session.rs:693 — dim_app_server::mcp::session::discover has cognitive complexity 64 (threshold 15). Drivers by points: if/else 11 (36 pts), match/switch 7 (21 pts), loops 2 (4 pts), boolean chains 3 (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.
  • dim_app_server::provider::validate_static_record (cognitive 63) crates/dim-app-server/src/provider.rs:840 — dim_app_server::provider::validate_static_record has cognitive complexity 63 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 21, match/switch 3 (5 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.
  • dim_app_server::collaboration::restore (cognitive 57) crates/dim-app-server/src/collaboration.rs:3678 — dim_app_server::collaboration::restore has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (45 pts), loops 8 (12 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::provider::persistence::read (cognitive 55) crates/dim-app-server/src/provider/persistence.rs:218 — dim_app_server::provider::persistence::read has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 6 (16 pts), match/switch 2 (7 pts), boolean chains 2 (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.
  • dim_app_server::storage::query::kind_positions (cognitive 55) crates/dim-app-server/src/storage/query.rs:2682 — dim_app_server::storage::query::kind_positions has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (45 pts), loops 3 (8 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.
  • dim_app_server::storage::members::event_profiles (cognitive 54) crates/dim-app-server/src/storage/members.rs:579 — dim_app_server::storage::members::event_profiles has cognitive complexity 54 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (18 pts), match/switch 2 (9 pts), boolean chains 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.
  • dim_app_server::mcp::session::reconcile (cognitive 52) crates/dim-app-server/src/mcp/session.rs:596 — dim_app_server::mcp::session::reconcile has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (35 pts), loops 4 (9 pts), match/switch 3 (6 pts), boolean chains 2 (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.
  • dim_app_server::provider::legacy::convert_legacy_provider (cognitive 51) crates/dim-app-server/src/provider/legacy.rs:319 — dim_app_server::provider::legacy::convert_legacy_provider has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 8, match/switch 5 (6 pts), loops 4 (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.
  • dim_app_server::connection::tree::turn_window (cognitive 46) crates/dim-app-server/src/connection/tree.rs:723 — dim_app_server::connection::tree::turn_window has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (44 pts), loops 1 (2 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.
  • dim_app_server::collaboration::pending::finished (cognitive 41) crates/dim-app-server/src/collaboration/pending.rs:233 — dim_app_server::collaboration::pending::finished has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (9 pts), match/switch 3 (6 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.
  • dim_app_server::web::content::format_json_preserving_numbers (cognitive 36) crates/dim-app-server/src/web/content.rs:176 — dim_app_server::web::content::format_json_preserving_numbers has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 4 (8 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.
  • dim_app_server::connection::tree::scan_keys (cognitive 35) crates/dim-app-server/src/connection/tree.rs:954 — dim_app_server::connection::tree::scan_keys has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (6 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.
  • dim_app_server::mcp::management::patch_configuration (cognitive 35) crates/dim-app-server/src/mcp/management.rs:292 — dim_app_server::mcp::management::patch_configuration has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_app_server::mcp::import::plan (cognitive 33) crates/dim-app-server/src/mcp/import.rs:331 — dim_app_server::mcp::import::plan has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
  • dim_app_server::provider::rewrite_stored_limits (cognitive 33) crates/dim-app-server/src/provider.rs:1489 — dim_app_server::provider::rewrite_stored_limits has cognitive complexity 33 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 5 (13 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • dim_app_server::model_catalog::merge_entry (cognitive 32) crates/dim-app-server/src/model_catalog.rs:1089 — dim_app_server::model_catalog::merge_entry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (4 pts), match/switch 2 (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.
  • dim_app_server::provider::persistence::adopt (cognitive 32) crates/dim-app-server/src/provider/persistence.rs:905 — dim_app_server::provider::persistence::adopt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 33 more in this group — see findings.md.
D2 · Cognitive Complexity · dim_cli · ×52
  • dim_cli::session::wait_turn (cognitive 334) crates/dim-cli/src/session.rs:633 — dim_cli::session::wait_turn has cognitive complexity 334 (threshold 15). Drivers by points: if/else 81 (244 pts), match/switch 13 (37 pts), boolean chains 34, loops 6 (19 pts) (nesting depth added 200). 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.
  • dim_cli::ui::tui::run_terminal (cognitive 250) crates/dim-cli/src/ui/tui.rs:234 — dim_cli::ui::tui::run_terminal has cognitive complexity 250 (threshold 15). Drivers by points: if/else 62 (161 pts), boolean chains 46, match/switch 15 (38 pts), loops 3 (5 pts) (nesting depth added 124). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_cli::ui::transcript::tool_group::append_interactive (cognitive 120) crates/dim-cli/src/ui/transcript/tool_group.rs:539 — dim_cli::ui::transcript::tool_group::append_interactive has cognitive complexity 120 (threshold 15). Drivers by points: if/else 38 (99 pts), match/switch 3 (9 pts), boolean chains 6, loops 3 (6 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.
  • dim_cli::session::chat (cognitive 80) crates/dim-cli/src/session.rs:202 — dim_cli::session::chat has cognitive complexity 80 (threshold 15). Drivers by points: if/else 28 (54 pts), match/switch 8 (15 pts), boolean chains 9, loops 2 (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.
  • dim_cli::act (cognitive 75) crates/dim-cli/src/lib.rs:660 — dim_cli::act has cognitive complexity 75 (threshold 15). Drivers by points: if/else 36 (63 pts), match/switch 4 (7 pts), loops 1 (3 pts), boolean chains 2 (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.
  • dim_cli::client::connect_inner (cognitive 72) crates/dim-cli/src/client.rs:845 — dim_cli::client::connect_inner has cognitive complexity 72 (threshold 15). Drivers by points: if/else 35 (51 pts), match/switch 6 (14 pts), boolean chains 5, loops 2 (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.
  • dim_cli::migration_command::run (cognitive 67) crates/dim-cli/src/migration_command.rs:57 — dim_cli::migration_command::run has cognitive complexity 67 (threshold 15). Drivers by points: if/else 29 (50 pts), boolean chains 12, match/switch 2 (4 pts), loops 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.
  • dim_cli::composer::edit (cognitive 63) crates/dim-cli/src/composer.rs:941 — dim_cli::composer::edit has cognitive complexity 63 (threshold 15). Drivers by points: if/else 14 (43 pts), match/switch 5 (15 pts), loops 2 (3 pts), boolean chains 2 (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.
  • dim_cli::ui::render::markdown::wrap_cells_row (cognitive 58) crates/dim-cli/src/ui/render/markdown.rs:382 — dim_cli::ui::render::markdown::wrap_cells_row has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 6 (16 pts), boolean chains 9, match/switch 1 (2 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.
  • dim_cli::session_host::run (cognitive 49) crates/dim-cli/src/session_host.rs:425 — dim_cli::session_host::run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 3 (9 pts), boolean chains 3, 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.
  • dim_cli::mcp_command::sign_in (cognitive 43) crates/dim-cli/src/mcp_command.rs:73 — dim_cli::mcp_command::sign_in has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 5 (12 pts), boolean chains 2, 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.
  • dim_cli::ui::transcript::blocks::render_block (cognitive 42) crates/dim-cli/src/ui/transcript/blocks.rs:621 — dim_cli::ui::transcript::blocks::render_block has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 4 (9 pts), boolean chains 3 (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.
  • dim_cli::management::mcp::perform (cognitive 41) crates/dim-cli/src/management/mcp.rs:1051 — dim_cli::management::mcp::perform has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (34 pts), match/switch 4 (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.
  • dim_cli::ui::transcript::tool_group::project (cognitive 41) crates/dim-cli/src/ui/transcript/tool_group.rs:370 — dim_cli::ui::transcript::tool_group::project has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 11, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_cli::realtime_command::run_with (cognitive 39) crates/dim-cli/src/realtime_command.rs:74 — dim_cli::realtime_command::run_with has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 8 (21 pts), if/else 6 (16 pts), boolean chains 1, loops 1 (nesting depth added 23). 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.
  • dim_cli::management::models::descriptor (cognitive 37) crates/dim-cli/src/management/models.rs:766 — dim_cli::management::models::descriptor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22 (34 pts), loops 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.
  • dim_cli::session::render (cognitive 34) crates/dim-cli/src/session.rs:1263 — dim_cli::session::render has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, loops 1 (3 pts), match/switch 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.
  • dim_cli::ui::transcript::tool_group::append_section (cognitive 34) crates/dim-cli/src/ui/transcript/tool_group.rs:1208 — dim_cli::ui::transcript::tool_group::append_section has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 6 (12 pts), match/switch 2 (4 pts) (nesting depth added 19). 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.
  • dim_cli::clipboard::read (cognitive 30) crates/dim-cli/src/clipboard/mod.rs:340 — dim_cli::clipboard::read has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (6 pts) (nesting depth added 13). Of this number, 28 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_cli::management::mcp::view (cognitive 30) crates/dim-cli/src/management/mcp.rs:1437 — dim_cli::management::mcp::view has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 3 (13 pts), if/else 4 (12 pts), loops 3 (5 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.
  • dim_cli::ui::render::panel::strip_escapes (cognitive 30) crates/dim-cli/src/ui/render/panel.rs:33 — dim_cli::ui::render::panel::strip_escapes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (17 pts), loops 3 (9 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_cli::ui::transcript::tool_group::lay_out_group (cognitive 30) crates/dim-cli/src/ui/transcript/tool_group.rs:2149 — dim_cli::ui::transcript::tool_group::lay_out_group has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 1 (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.
  • dim_cli::ui::transcript::tool_group::layout (cognitive 30) crates/dim-cli/src/ui/transcript/tool_group.rs:2275 — dim_cli::ui::transcript::tool_group::layout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (6 pts), boolean chains 1, 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.
  • dim_cli::ui::render::fullscreen::highlight (cognitive 29) crates/dim-cli/src/ui/render/fullscreen.rs:1972 — dim_cli::ui::render::fullscreen::highlight has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_cli::ui::transcript::tool_group::highlight_command (cognitive 27) crates/dim-cli/src/ui/transcript/tool_group.rs:1898 — dim_cli::ui::transcript::tool_group::highlight_command has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 2 (4 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.
  • + 27 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×46
  • ClassTooLong: App crates/dim-cli/src/ui/tui.rs:1053 — ClassTooLong — 5040 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 148 methods, 3 blocks, lines 1053-8480. The bar is 400 significant lines; this is 4640 over it, 12.60× 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: Worker crates/dim-cli/src/session_host.rs:259 — ClassTooLong — 3165 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 134 methods, 2 blocks, lines 259-4886. The bar is 400 significant lines; this is 2765 over it, 7.91× 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: Gateway crates/dim-acp/src/gateway.rs:257 — ClassTooLong — 1859 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 257-2737. The bar is 400 significant lines; this is 1459 over it, 4.65× 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: Projection crates/dim-cli/src/projection.rs:44 — ClassTooLong — 1367 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 44-1933. The bar is 400 significant lines; this is 967 over it, 3.42× 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: TimelineTree crates/dim-agent-capabilities/src/timeline_tree.rs:81 — ClassTooLong — 1335 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 81-2168. The bar is 400 significant lines; this is 935 over it, 3.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Connection crates/dim-app-server/src/connection.rs:63 — ClassTooLong — 1291 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 2 blocks, lines 63-1937. The bar is 400 significant lines; this is 891 over it, 3.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CollaborationSession crates/dim-app-server/src/collaboration.rs:945 — ClassTooLong — 1256 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 2 blocks, lines 945-2704. The bar is 400 significant lines; this is 856 over it, 3.14× 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: AgentLoop crates/dim-agent-capabilities/src/agent_loop.rs:126 — ClassTooLong — 1246 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 3 blocks, lines 126-1776. The bar is 400 significant lines; this is 846 over it, 3.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: Owner crates/dim-goal/src/branch.rs:375 — ClassTooLong — 1142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 2 blocks, lines 375-2031. The bar is 400 significant lines; this is 742 over it, 2.86× 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: Options REDACTED:561 — ClassTooLong — 1133 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, 3 blocks, lines 561-2189. The bar is 400 significant lines; this is 733 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentIndex crates/dim-app-server/src/agents.rs:366 — ClassTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 70 methods, 2 blocks, lines 366-2054. The bar is 400 significant lines; this is 729 over it, 2.82× 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: ContextPolicy crates/dim-agent-capabilities/src/context_policy.rs:105 — ClassTooLong — 1105 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 105-1854. The bar is 400 significant lines; this is 705 over it, 2.76× 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: FullScreen crates/dim-cli/src/ui/render/fullscreen.rs:325 — ClassTooLong — 1044 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 2 blocks, lines 325-1824. The bar is 400 significant lines; this is 644 over it, 2.61× 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: Shared crates/dim-modality/src/engine.rs:464 — ClassTooLong — 1021 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 464-2805. The bar is 400 significant lines; this is 621 over it, 2.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Compiler crates/dim-app-server/src/storage/query.rs:224 — ClassTooLong — 991 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 224-1558. The bar is 400 significant lines; this is 591 over it, 2.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ProviderService crates/dim-app-server/src/provider.rs:1408 — ClassTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 3 blocks, lines 1408-2939. The bar is 400 significant lines; this is 558 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Service crates/dim-app-server/src/managed_oauth.rs:229 — ClassTooLong — 830 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 3 blocks, lines 229-1257. The bar is 400 significant lines; this is 430 over it, 2.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: Composer crates/dim-cli/src/ui/composer/mod.rs:115 — ClassTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 56 methods, 2 blocks, lines 115-1358. The bar is 400 significant lines; this is 418 over it, 2.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: ShellSession crates/dim-agent-capabilities/src/shell_session.rs:301 — ClassTooLong — 816 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 3 blocks, lines 301-1424. The bar is 400 significant lines; this is 416 over it, 2.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: Manager crates/dim-app-server/src/plugin_manager.rs:677 — ClassTooLong — 805 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 2 blocks, lines 677-2284. The bar is 400 significant lines; this is 405 over it, 2.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Branch crates/dim-agent-capabilities/src/hooks/runner.rs:1133 — ClassTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 1133-2162. The bar is 400 significant lines; this is 365 over it, 1.91× 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: BranchLine crates/dim-agent-capabilities/src/timeline_tree.rs:2652 — ClassTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 2 blocks, lines 2652-3653. The bar is 400 significant lines; this is 323 over it, 1.81× 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: Source crates/dim-migration/src/source.rs:95 — ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 95-1102. The bar is 400 significant lines; this is 287 over it, 1.72× 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: Timeline crates/dim-agent-runtime/src/core/timeline.rs:92 — ClassTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 40 methods. The bar is 400 significant lines; this is 247 over it, 1.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Inner crates/dim-oauth/src/lib.rs:215 — ClassTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 3 blocks, lines 215-1061. The bar is 400 significant lines; this is 235 over it, 1.59× 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.
  • + 21 more in this group — see findings.md.
D2 · Cognitive Complexity · dim_agent_capabilities · ×45
  • dim_agent_capabilities::recall::search::index (cognitive 83) crates/dim-agent-capabilities/src/recall/search.rs:1102 — dim_agent_capabilities::recall::search::index has cognitive complexity 83 (threshold 15). Drivers by points: if/else 32 (67 pts), match/switch 2 (7 pts), loops 4 (5 pts), boolean chains 4 (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.
  • dim_agent_capabilities::output::parse_output (cognitive 66) crates/dim-agent-capabilities/src/output.rs:557 — dim_agent_capabilities::output::parse_output has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (54 pts), match/switch 4 (9 pts), boolean chains 2, loops 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.
  • dim_agent_capabilities::timeline_tree::line_read_items (cognitive 56) crates/dim-agent-capabilities/src/timeline_tree.rs:4183 — dim_agent_capabilities::timeline_tree::line_read_items has cognitive complexity 56 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 6 (20 pts), loops 5 (10 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.
  • dim_agent_capabilities::history::settled_output::settled_request_output (cognitive 45) crates/dim-agent-capabilities/src/history/settled_output.rs:62 — dim_agent_capabilities::history::settled_output::settled_request_output has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 5 (7 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.
  • dim_agent_capabilities::hooks::document::handlers (cognitive 43) crates/dim-agent-capabilities/src/hooks/document.rs:251 — dim_agent_capabilities::hooks::document::handlers has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 3 (11 pts), loops 3 (6 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.
  • dim_agent_capabilities::recall::search::run (cognitive 42) crates/dim-agent-capabilities/src/recall/search.rs:679 — dim_agent_capabilities::recall::search::run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 5 (8 pts), match/switch 1 (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.
  • dim_agent_capabilities::tool_executor::rebuild (cognitive 40) crates/dim-agent-capabilities/src/tool_executor.rs:942 — dim_agent_capabilities::tool_executor::rebuild has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 3 (7 pts), loops 3 (4 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.
  • dim_agent_capabilities::skills::discovery::parse_simple_yaml (cognitive 38) crates/dim-agent-capabilities/src/skills/discovery.rs:258 — dim_agent_capabilities::skills::discovery::parse_simple_yaml has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 2 (4 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.
  • dim_agent_capabilities::workspace_tools::files::read::stream_text (cognitive 38) crates/dim-agent-capabilities/src/workspace_tools/files/read.rs:370 — dim_agent_capabilities::workspace_tools::files::read::stream_text has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, match/switch 3 (4 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.
  • dim_agent_capabilities::context_methods::compact (cognitive 37) crates/dim-agent-capabilities/src/context_methods.rs:80 — dim_agent_capabilities::context_methods::compact has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (30 pts), match/switch 2 (6 pts), 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.
  • dim_agent_capabilities::model_provider::recovery::invoke (cognitive 37) crates/dim-agent-capabilities/src/model_provider/recovery.rs:66 — dim_agent_capabilities::model_provider::recovery::invoke has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_capabilities::file_storage::remove_tree (cognitive 34) crates/dim-agent-capabilities/src/file_storage.rs:1224 — dim_agent_capabilities::file_storage::remove_tree has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 4 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_capabilities::workspace_tools::files::write::write_target (cognitive 33) crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:296 — dim_agent_capabilities::workspace_tools::files::write::write_target has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 5 (8 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.
  • dim_agent_capabilities::input_queue::pending::read (cognitive 32) crates/dim-agent-capabilities/src/input_queue/pending.rs:21 — dim_agent_capabilities::input_queue::pending::read has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 4 (8 pts), loops 3 (6 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.
  • dim_agent_capabilities::context_policy::digest_entries (cognitive 31) crates/dim-agent-capabilities/src/context_policy.rs:1988 — dim_agent_capabilities::context_policy::digest_entries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (9 pts), boolean chains 3, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_capabilities::history::replay (cognitive 30) crates/dim-agent-capabilities/src/history.rs:956 — dim_agent_capabilities::history::replay has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (9 pts), match/switch 2 (4 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.
  • dim_agent_capabilities::workspace_tools::files::search::run_grep (cognitive 29) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:910 — dim_agent_capabilities::workspace_tools::files::search::run_grep has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 3 (4 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.
  • dim_agent_capabilities::context_policy::pinned_inputs (cognitive 28) crates/dim-agent-capabilities/src/context_policy.rs:2119 — dim_agent_capabilities::context_policy::pinned_inputs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 3 (4 pts), match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_capabilities::host::reasoning_config (cognitive 28) crates/dim-agent-capabilities/src/host.rs:344 — dim_agent_capabilities::host::reasoning_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_capabilities::session_files::materialize (cognitive 27) crates/dim-agent-capabilities/src/session_files.rs:60 — dim_agent_capabilities::session_files::materialize has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 3 (9 pts), loops 3 (7 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.
  • dim_agent_capabilities::workspace_tools::exec::run_process (cognitive 27) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:2456 — dim_agent_capabilities::workspace_tools::exec::run_process has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_capabilities::shell_session::regularize_output (cognitive 26) crates/dim-agent-capabilities/src/shell_session.rs:1718 — dim_agent_capabilities::shell_session::regularize_output has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (8 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.
  • dim_agent_capabilities::workspace_tools::exec::quote_only_marker (cognitive 26) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:431 — dim_agent_capabilities::workspace_tools::exec::quote_only_marker has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (4 pts), match/switch 1 (4 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.
  • dim_agent_capabilities::host_platform::windows::collect (cognitive 25) crates/dim-agent-capabilities/src/host_platform.rs:1547 — dim_agent_capabilities::host_platform::windows::collect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 9 (11 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.
  • dim_agent_capabilities::workspace_tools::files::search::run_glob (cognitive 25) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:390 — dim_agent_capabilities::workspace_tools::files::search::run_glob has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3, boolean chains 2, loops 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.
  • + 20 more in this group — see findings.md.
D1 · Cyclomatic Complexity · dim_app_server · ×41
  • dim_app_server::serve (cyclomatic 81) crates/dim-app-server/src/lib.rs:464 — dim_app_server::serve has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_app_server::storage::query::sources (cyclomatic 81) crates/dim-app-server/src/storage/query.rs:1873 — dim_app_server::storage::query::sources has cyclomatic complexity 81 (threshold 15). Of this number, 59 points are the body's own statements and 22 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_app_server::cli::run_with (cyclomatic 75) crates/dim-app-server/src/cli.rs:215 — dim_app_server::cli::run_with has cyclomatic complexity 75 (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.
  • dim_app_server::storage::members::candidates_for (cyclomatic 75) crates/dim-app-server/src/storage/members.rs:1109 — dim_app_server::storage::members::candidates_for has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_app_server::mcp::management::provide (cyclomatic 65) crates/dim-app-server/src/mcp/management.rs:661 — dim_app_server::mcp::management::provide 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.
  • dim_app_server::storage::query::execute (cyclomatic 65) crates/dim-app-server/src/storage/query.rs:2962 — dim_app_server::storage::query::execute 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.
  • dim_app_server::provider::validate_static_record (cyclomatic 53) crates/dim-app-server/src/provider.rs:840 — dim_app_server::provider::validate_static_record 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.
  • dim_app_server::provider::legacy::convert_legacy_provider (cyclomatic 52) crates/dim-app-server/src/provider/legacy.rs:319 — dim_app_server::provider::legacy::convert_legacy_provider 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.
  • dim_app_server::transport::run_connection (cyclomatic 47) crates/dim-app-server/src/transport.rs:644 — dim_app_server::transport::run_connection 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.
  • dim_app_server::web::content::html_fragment_to_markdown (cyclomatic 46) crates/dim-app-server/src/web/content.rs:363 — dim_app_server::web::content::html_fragment_to_markdown 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.
  • dim_app_server::mcp::session::discover (cyclomatic 32) crates/dim-app-server/src/mcp/session.rs:693 — dim_app_server::mcp::session::discover 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.
  • dim_app_server::collaboration::restore (cyclomatic 27) crates/dim-app-server/src/collaboration.rs:3678 — dim_app_server::collaboration::restore 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.
  • dim_app_server::storage::query::kind_positions (cyclomatic 27) crates/dim-app-server/src/storage/query.rs:2682 — dim_app_server::storage::query::kind_positions 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.
  • dim_app_server::provider::persistence::read (cyclomatic 24) crates/dim-app-server/src/provider/persistence.rs:218 — dim_app_server::provider::persistence::read 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.
  • dim_app_server::mcp::management::patch_configuration (cyclomatic 23) crates/dim-app-server/src/mcp/management.rs:292 — dim_app_server::mcp::management::patch_configuration 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.
  • dim_app_server::mcp::session::reconcile (cyclomatic 23) crates/dim-app-server/src/mcp/session.rs:596 — dim_app_server::mcp::session::reconcile 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.
  • dim_app_server::model_catalog::merge_entry (cyclomatic 22) crates/dim-app-server/src/model_catalog.rs:1089 — dim_app_server::model_catalog::merge_entry 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.
  • dim_app_server::web::content::format_json_preserving_numbers (cyclomatic 22) crates/dim-app-server/src/web/content.rs:176 — dim_app_server::web::content::format_json_preserving_numbers 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.
  • dim_app_server::connection::tree::turn_window (cyclomatic 21) crates/dim-app-server/src/connection/tree.rs:723 — dim_app_server::connection::tree::turn_window 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.
  • dim_app_server::provider::persistence::adopt (cyclomatic 20) crates/dim-app-server/src/provider/persistence.rs:905 — dim_app_server::provider::persistence::adopt 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.
  • dim_app_server::transport::unix_bind (cyclomatic 20) crates/dim-app-server/src/transport.rs:63 — dim_app_server::transport::unix_bind 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.
  • dim_app_server::collaboration::pending::finished (cyclomatic 19) crates/dim-app-server/src/collaboration/pending.rs:233 — dim_app_server::collaboration::pending::finished 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.
  • dim_app_server::mcp::write (cyclomatic 19) crates/dim-app-server/src/mcp.rs:1366 — dim_app_server::mcp::write 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.
  • dim_app_server::model_catalog::descriptor_entry (cyclomatic 19) crates/dim-app-server/src/model_catalog.rs:975 — dim_app_server::model_catalog::descriptor_entry 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.
  • dim_app_server::storage::image_upgrade::upgrade (cyclomatic 19) crates/dim-app-server/src/storage/image_upgrade.rs:38 — dim_app_server::storage::image_upgrade::upgrade 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.
  • + 16 more in this group — see findings.md.
R11 · Import Boundaries · Boundary violation [package · ×40
  • Boundary violation [package:relative-cross-package] scripts/check-alpha-registry.mjs:19 — scripts/check-alpha-registry.mjs:19 reaches into another package with a relative path (../npm/package.json) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:11 — web/src/auto-imports.d.ts:11 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineLocale) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:12 — web/src/auto-imports.d.ts:12 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineShortcuts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:13 — web/src/auto-imports.d.ts:13 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineLocale) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:14 — web/src/auto-imports.d.ts:14 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/defineShortcuts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:15 — web/src/auto-imports.d.ts:15 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/vue/composables/useAppConfig.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:16 — web/src/auto-imports.d.ts:16 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useContentSearch) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:17 — web/src/auto-imports.d.ts:17 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useFileUpload) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:18 — web/src/auto-imports.d.ts:18 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useFormField) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:19 — web/src/auto-imports.d.ts:19 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useKbd) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:20 — web/src/auto-imports.d.ts:20 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useOverlay) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:21 — web/src/auto-imports.d.ts:21 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useResizable) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:22 — web/src/auto-imports.d.ts:22 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useScrollShadow) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:23 — web/src/auto-imports.d.ts:23 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useScrollspy) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:24 — web/src/auto-imports.d.ts:24 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useToast) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/auto-imports.d.ts:25 — web/src/auto-imports.d.ts:25 reaches into another package with a relative path (../node_modules/@nuxt/ui/dist/runtime/composables/useTour) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:22 — web/src/components.d.ts:22 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Alert.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:23 — web/src/components.d.ts:23 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/App.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:24 — web/src/components.d.ts:24 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Badge.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:25 — web/src/components.d.ts:25 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Button.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:26 — web/src/components.d.ts:26 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Checkbox.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:27 — web/src/components.d.ts:27 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Collapsible.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:28 — web/src/components.d.ts:28 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/Drawer.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:29 — web/src/components.d.ts:29 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/DropdownMenu.vue) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] web/src/components.d.ts:30 — web/src/components.d.ts:30 reaches into another package with a relative path (./../node_modules/@nuxt/ui/dist/runtime/components/FormField.vue) — import the package by name instead.
  • + 15 more in this group — see findings.md.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×40
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-goal/src/branch.rs:94 — `current` is public and takes a `Changes` as its receiver from its caller, and it calls itself at line 94 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `current` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-goal/src/branch.rs:110 — `change` is public and takes a `Changes` as its receiver from its caller, and it calls itself at line 110 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `change` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/agents.rs:513 — `uses` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 513 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `uses` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/agents.rs:554 — `members` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 554 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `members` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/agents.rs:1878 — `close` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 1878 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `close` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/agents.rs:1467 — `delete` is public and takes a `AgentIndex` as its receiver from its caller, and it recurses at line 1467 through `release_owned`, `remove_locked` and back with a piece of the document (and at line 1518, line 1522, line 1559, line 1695) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `delete` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/agents.rs:2052 — `forget` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 2052 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `forget` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/agents.rs:783 — `closed` is public and takes a `AgentIndex` as its receiver from its caller, and it calls itself at line 783 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `closed` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/connection.rs:2242 — `close` is public and takes a `ConnectionHub` as its receiver from its caller, and it calls itself at line 2242 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `close` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:333 — `state` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 333 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `state` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:337 — `failure` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 337 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `failure` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:342 — `generation` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 342 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `generation` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:347 — `discovered` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 347 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `discovered` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:355 — `subscribe` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 355 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `subscribe` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:358 — `tool_changes` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 358 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tool_changes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:362 — `credential_changes` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 362 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `credential_changes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:365 — `tools` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 365 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tools` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:373 — `call` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 373 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `call` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:381 — `call_result` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 381 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `call_result` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:388 — `resource` is public and takes a `McpConnection` as its receiver from its caller, and it calls itself at line 388 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `resource` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:507 — `disconnect` is public and takes a `McpService` as its receiver from its caller, and it calls itself at line 507 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:513 — `application` is public and takes a `McpService` as its receiver from its caller, and it calls itself at line 513 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `application` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/mcp.rs:961 — `clear_secret_if` is public and takes a `McpService` as its receiver from its caller, and it recurses at line 961 through `remove_secret_if`, `set_project_enabled`, `write`, `update` and back with a piece of the document (and at line 1096, line 1100, line 1385, line 1405, line 1426, line 1445, line 1458, line 1736, line 1766) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clear_secret_if` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/outbound.rs:83 — `send` is public and takes a `Sender` as its receiver from its caller, and it recurses at line 83 through `push` and back with a piece of the document (and at line 117) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/dim-app-server/src/settings.rs:213 — `register` is public and takes a `SettingsService` as its receiver from its caller, and it recurses at line 213 through `insert` and back with a piece of the document (and at line 287) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `register` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • + 15 more in this group — see findings.md.
X25 · Inert configuration knob · Configuration option is read nowhere · ×40
  • Configuration option is read nowhere crates/dim-agent-attachments/src/lib.rs:33 — `PutParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/agent_loop/read.rs:15 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/input_queue.rs:635 — `WithdrawParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/input_queue/pending.rs:13 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/prompt_suggestion.rs:681 — `RequestParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/prompt_suggestion.rs:689 — `RespondParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/shell_input.rs:77 — `RunParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/shell_input.rs:92 — `StopParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/shell_input.rs:100 — `ListParams._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/tool_executor/read.rs:15 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/workspace_tools/pending.rs:15 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-capabilities/src/workspace_tools/pending.rs:159 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-questions/src/lib.rs:101 — `OptionInput._description` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-questions/src/lib.rs:408 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-questions/src/pending.rs:13 — `Params._session_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:104 — `CatalogCapabilities.structured_output` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:187 — `ModelReasoning.level` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:189 — `ModelReasoning.level_options` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:191 — `ModelReasoning.verbosity` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:193 — `ModelReasoning.verbosity_options` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:195 — `ModelReasoning.interleaved` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/model.rs:862 — `RequestMetadata.trace_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/tool.rs:347 — `ToolMetadata.author` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/tool.rs:353 — `ToolMetadata.docs_url` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/dim-agent-types/src/tool.rs:359 — `ToolMetadata.source_plugin_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • + 15 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:116 — `PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `root` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:213 — `root.root_view()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `process_rows` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:244 — `snapshot["plugins"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:245 — `p["id"].as_u64()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:249 — `p["name"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:255 — `snapshot["plugins"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:256 — `p["resolved"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:257 — `edge["provider"].as_u64()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:261 — `edge["service"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `mermaid` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:280 — `d.plugins.iter().find(|p|p.name==name)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:285 — `d.plugins.iter().find(|p|Some(p.id)==scope.parent).map(|p|p.instance)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:358 — `metadata["packages"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:359 — `p["name"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:360 — `p["dependencies"].as_array()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/main.rs:361 — `d["name"].as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `boundaries` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/plugins.rs:247 — `d.plugins.iter().find(|p|p.name==name)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/plugins.rs:252 — `d.plugins.iter().find(|p|Some(p.id)==scope.parent).map(|p|p.instance)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/plugins.rs:259 — `process.root_view()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_graph` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/plugins.rs:294 — `file.parent()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `write` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/prompt_eval.rs:433 — `settings.unix_path.clone()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `serve_one` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/prompt_eval.rs:1839 — `arms.get_mut(arm)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `report` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/prompt_eval.rs:1844 — `arms.get_mut(arm)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `report` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/scenario_eval.rs:1481 — `absolute.ancestors().last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve_output` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/scenario_eval.rs:1487 — `absolute.strip_prefix(root)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve_output` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded xtask/src/scenario_eval.rs:1616 — `path.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `set_member` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×38
  • Duplicated block (8 lines × 2) crates/dim-agent-capabilities/src/agent_loop.rs:1897 — crates/dim-agent-capabilities/src/agent_loop.rs:1897-1904 | crates/dim-agent-capabilities/src/input_queue.rs:435-442 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-agent-capabilities/src/agent_loop.rs:1897` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:1075 — crates/dim-agent-capabilities/src/context_preparation.rs:1075-1082 | crates/dim-agent-capabilities/src/model_provider.rs:662-669 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:1075` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/context_preparation.rs:1072` calls `unwrap`, `take`, `clear` and `crates/dim-agent-capabilities/src/model_provider.rs:660` 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 × 2) crates/dim-agent-capabilities/src/context_usage.rs:808 — crates/dim-agent-capabilities/src/context_usage.rs:808-815 | crates/dim-agent-capabilities/src/context_usage.rs:1003-1010 — both copies are in the same file, so extract the block into 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/dim-agent-capabilities/src/context_usage/sources.rs:379 — crates/dim-agent-capabilities/src/context_usage/sources.rs:379-386 | crates/dim-agent-capabilities/src/context_usage/sources.rs:536-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/dim-agent-capabilities/src/context_usage/sources.rs:544` calls `algorithm`, `is_empty` and `crates/dim-agent-capabilities/src/context_usage/sources.rs:387` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/dim-agent-capabilities/src/input_queue/pending.rs:27 — crates/dim-agent-capabilities/src/input_queue/pending.rs:27-34 | crates/dim-app-server/src/collaboration/pending.rs:63-70 — before extracting anything, compare `crates/dim-agent-capabilities/src/input_queue/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/input_queue/pending.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-agent-capabilities/src/shell_session.rs:684 — crates/dim-agent-capabilities/src/shell_session.rs:684-691 | crates/dim-agent-capabilities/src/shell_session.rs:907-914 — both copies are in the same file, so extract the block into 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/dim-agent-capabilities/src/skills/catalog.rs:402 — crates/dim-agent-capabilities/src/skills/catalog.rs:402-409 | crates/dim-agent-capabilities/src/skills/catalog.rs:502-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/skills/catalog.rs:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:666 — crates/dim-agent-capabilities/src/workspace_tools/exec.rs:666-673 | crates/dim-agent-capabilities/src/workspace_tools/exec.rs:675-682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/exec.rs:666` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/workspace_tools/exec.rs:674` calls `text`, `Some` and `crates/dim-agent-capabilities/src/workspace_tools/exec.rs:665` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:2520 — crates/dim-agent-capabilities/src/workspace_tools/exec.rs:2520-2527 | crates/dim-agent-capabilities/src/workspace_tools/exec.rs:2557-2564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) crates/dim-agent-runtime/src/memory_timeline_store.rs:116 — crates/dim-agent-runtime/src/memory_timeline_store.rs:116-123 | crates/dim-agent-runtime/src/memory_timeline_store.rs:146-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/connection.rs:357 — crates/dim-app-server/src/connection.rs:357-364 | crates/dim-app-server/src/connection.rs:392-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/connection.rs:356` calls `clone` and `crates/dim-app-server/src/connection.rs:391` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/mcp/config.rs:517 — crates/dim-app-server/src/mcp/config.rs:517-524 | crates/dim-app-server/src/mcp/config.rs:576-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/mcp/config.rs:517` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/dim-app-server/src/mcp/config.rs:526` calls `get`, `Some`, `String` and `crates/dim-app-server/src/mcp/config.rs:585` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/mcp/config.rs:1200 — crates/dim-app-server/src/mcp/config.rs:1200-1207 | crates/dim-app-server/src/mcp/config.rs:1239-1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/mcp/config.rs:1200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/plugin_manager.rs:1285 — crates/dim-app-server/src/plugin_manager.rs:1285-1292 | crates/dim-app-server/src/plugin_manager.rs:1852-1859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/plugin_manager.rs:1284` calls `new_id`, `as_deref` and `crates/dim-app-server/src/plugin_manager.rs:1851` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/provider/persistence.rs:482 — crates/dim-app-server/src/provider/persistence.rs:482-489 | crates/dim-app-server/src/provider/persistence.rs:518-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/persistence.rs:482` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/settings/declared.rs:294 — crates/dim-app-server/src/settings/declared.rs:294-301 | crates/dim-app-server/src/storage/metadata.rs:317-324 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `result` to `Result<impl Serialize>` in one and `Result<impl Serialize, MetadataError>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) crates/dim-app-server/src/storage/codec.rs:1233 — crates/dim-app-server/src/storage/codec.rs:1233-1240 | crates/dim-app-server/src/storage/codec.rs:1244-1251 — both copies are in the same file, so extract the block into 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/dim-app-server/src/web/content.rs:328 — crates/dim-app-server/src/web/content.rs:328-335 | crates/dim-app-server/src/web/content.rs:550-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/web/content.rs:328` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-cli/src/ui/terminal/unix.rs:228 — crates/dim-cli/src/ui/terminal/unix.rs:228-235 | crates/dim-cli/src/ui/terminal/windows.rs:344-351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/dim-cli/src/ui/transcript/tool_group.rs:1299 — crates/dim-cli/src/ui/transcript/tool_group.rs:1299-1306 | crates/dim-cli/src/ui/transcript/tool_group.rs:1580-1587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/transcript/tool_group.rs:1299` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-cli/src/ui/tui.rs:4181 — crates/dim-cli/src/ui/tui.rs:4181-4188 | crates/dim-cli/src/ui/tui.rs:4198-4205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) crates/dim-image-understanding/src/history.rs:119 — crates/dim-image-understanding/src/history.rs:119-126 | crates/dim-image-understanding/src/history.rs:151-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-image-understanding/src/history.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) xtask/src/scenario_eval.rs:3183 — xtask/src/scenario_eval.rs:3183-3190 | xtask/src/scenario_eval.rs:3229-3236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/src/scenario_eval.rs:3183` 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, `xtask/src/scenario_eval.rs:3192` calls `join` and `xtask/src/scenario_eval.rs:3238` 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 × 2) xtask/src/scenario_eval.rs:5612 — xtask/src/scenario_eval.rs:5612-5619 | xtask/src/scenario_eval.rs:5777-5784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/src/scenario_eval.rs:5612` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/dim-cli/src/ui/composer/mod.rs:874 — crates/dim-cli/src/ui/composer/mod.rs:874-881 | crates/dim-cli/src/ui/composer/mod.rs:1023-1030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/composer/mod.rs:874` 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.
  • + 13 more in this group — see findings.md.
D1 · Cyclomatic Complexity · dim_cli · ×36
  • dim_cli::ui::tui::run_terminal (cyclomatic 152) crates/dim-cli/src/ui/tui.rs:234 — dim_cli::ui::tui::run_terminal has cyclomatic complexity 152 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_cli::session::wait_turn (cyclomatic 142) crates/dim-cli/src/session.rs:633 — dim_cli::session::wait_turn has cyclomatic complexity 142 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_cli::act (cyclomatic 68) crates/dim-cli/src/lib.rs:660 — dim_cli::act has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_cli::session::chat (cyclomatic 60) crates/dim-cli/src/session.rs:202 — dim_cli::session::chat has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_cli::ui::transcript::tool_group::append_interactive (cyclomatic 48) crates/dim-cli/src/ui/transcript/tool_group.rs:539 — dim_cli::ui::transcript::tool_group::append_interactive 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.
  • dim_cli::composer::edit (cyclomatic 45) crates/dim-cli/src/composer.rs:941 — dim_cli::composer::edit 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.
  • dim_cli::client::connect_inner (cyclomatic 41) crates/dim-cli/src/client.rs:845 — dim_cli::client::connect_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.
  • dim_cli::migration_command::run (cyclomatic 40) crates/dim-cli/src/migration_command.rs:57 — dim_cli::migration_command::run 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.
  • dim_cli::ui::transcript::blocks::render_block (cyclomatic 38) crates/dim-cli/src/ui/transcript/blocks.rs:621 — dim_cli::ui::transcript::blocks::render_block 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.
  • dim_cli::management::apply (cyclomatic 33) crates/dim-cli/src/management/mod.rs:372 — dim_cli::management::apply has cyclomatic complexity 33 (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.
  • dim_cli::ui::transcript::tool_group::project (cyclomatic 31) crates/dim-cli/src/ui/transcript/tool_group.rs:370 — dim_cli::ui::transcript::tool_group::project 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.
  • dim_cli::ui::render::markdown::wrap_cells_row (cyclomatic 29) crates/dim-cli/src/ui/render/markdown.rs:382 — dim_cli::ui::render::markdown::wrap_cells_row 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.
  • dim_cli::session_host::run (cyclomatic 28) crates/dim-cli/src/session_host.rs:425 — dim_cli::session_host::run 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.
  • dim_cli::management::mcp::perform (cyclomatic 27) crates/dim-cli/src/management/mcp.rs:1051 — dim_cli::management::mcp::perform 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.
  • dim_cli::mcp_command::sign_in (cyclomatic 26) crates/dim-cli/src/mcp_command.rs:73 — dim_cli::mcp_command::sign_in 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.
  • dim_cli::ui::theme::palette::terminal_palette (cyclomatic 25) crates/dim-cli/src/ui/theme/palette.rs:106 — dim_cli::ui::theme::palette::terminal_palette 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.
  • dim_cli::session_command::cleanup (cyclomatic 24) crates/dim-cli/src/session_command.rs:166 — dim_cli::session_command::cleanup 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.
  • dim_cli::plugin_command::parse (cyclomatic 23) crates/dim-cli/src/plugin_command.rs:14 — dim_cli::plugin_command::parse 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.
  • dim_cli::ui::transcript::tool_group::append_card (cyclomatic 23) crates/dim-cli/src/ui/transcript/tool_group.rs:1329 — dim_cli::ui::transcript::tool_group::append_card 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.
  • dim_cli::management::models::descriptor (cyclomatic 22) crates/dim-cli/src/management/models.rs:766 — dim_cli::management::models::descriptor 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.
  • dim_cli::modality::media::parse (cyclomatic 22) crates/dim-cli/src/modality/media.rs:139 — dim_cli::modality::media::parse has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dim_cli::realtime_command::run_with (cyclomatic 21) crates/dim-cli/src/realtime_command.rs:74 — dim_cli::realtime_command::run_with has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dim_cli::session::render (cyclomatic 21) crates/dim-cli/src/session.rs:1263 — dim_cli::session::render 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.
  • dim_cli::ui::transcript::tool_group::classify (cyclomatic 21) crates/dim-cli/src/ui/transcript/tool_group.rs:855 — dim_cli::ui::transcript::tool_group::classify has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dim_cli::ui::transcript::tool_group::append_section (cyclomatic 21) crates/dim-cli/src/ui/transcript/tool_group.rs:1208 — dim_cli::ui::transcript::tool_group::append_section 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.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×32
  • Duplicated block (9 lines × 2) crates/dim-acp/src/gateway.rs:588 — crates/dim-acp/src/gateway.rs:588-596 | crates/dim-acp/src/gateway.rs:819-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-acp/src/gateway.rs:588` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/dim-acp/src/gateway.rs:1422 — crates/dim-acp/src/gateway.rs:1422-1430 | crates/dim-acp/src/gateway.rs:1924-1932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-acp/src/gateway.rs:1422` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-acp/src/gateway.rs:1923` calls `Some`, `Ready`, `get_mut` and `crates/dim-acp/src/gateway.rs:1421` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/dim-agent-aimux/src/plugin.rs:66 — crates/dim-agent-aimux/src/plugin.rs:66-74 | crates/dim-app-server/src/provider.rs:3330-3338 — 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/dim-agent-capabilities/src/context_model.rs:91 — crates/dim-agent-capabilities/src/context_model.rs:91-99 | crates/dim-app-server/src/provider.rs:2950-2958 — 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/dim-agent-capabilities/src/context_policy.rs:525 — crates/dim-agent-capabilities/src/context_policy.rs:525-533 | crates/dim-agent-capabilities/src/context_policy.rs:790-798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:525` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/context_policy.rs:532 — crates/dim-agent-capabilities/src/context_policy.rs:532-540 | crates/dim-agent-runtime/src/core/timeline.rs:886-894 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:532` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/context_policy.rs:685 — crates/dim-agent-capabilities/src/context_policy.rs:685-693 | crates/dim-agent-capabilities/src/timeline_tree.rs:1278-1286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-agent-capabilities/src/context_policy.rs:685` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:787 — crates/dim-agent-capabilities/src/context_preparation.rs:787-795 | crates/dim-agent-capabilities/src/model_provider.rs:472-480 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:787` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/file_access.rs:371 — crates/dim-agent-capabilities/src/file_access.rs:371-379 | crates/dim-agent-capabilities/src/file_access.rs:416-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/file_storage.rs:1914 — crates/dim-agent-capabilities/src/file_storage.rs:1914-1922 | crates/dim-agent-capabilities/src/file_storage/windows.rs:340-348 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/history.rs:190 — crates/dim-agent-capabilities/src/history.rs:190-198 | crates/dim-agent-capabilities/src/history.rs:1504-1512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/history.rs:190` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/history.rs:189` calls `is_none` and `crates/dim-agent-capabilities/src/history.rs:1503` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/recall.rs:1362 — crates/dim-agent-capabilities/src/recall.rs:1362-1370 | crates/dim-agent-capabilities/src/summary_strategy.rs:779-787 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/dim-agent-capabilities/src/skills/session.rs:655 — crates/dim-agent-capabilities/src/skills/session.rs:655-663 | crates/dim-agent-capabilities/src/tool_binding.rs:511-519 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/skills/session.rs:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:2862 — crates/dim-agent-capabilities/src/timeline_tree.rs:2862-2870 | crates/dim-app-server/src/collaboration.rs:3662-3670 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:2862` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) crates/dim-agent-runtime/src/assembly.rs:1143 — crates/dim-agent-runtime/src/assembly.rs:1143-1151 | crates/dim-agent-runtime/src/assembly.rs:1309-1317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) crates/dim-app-server/src/collaboration.rs:766 — crates/dim-app-server/src/collaboration.rs:766-774 | crates/dim-session-title/src/lib.rs:193-201 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration.rs:766` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/dim-app-server/src/hooks_settings.rs:564 — crates/dim-app-server/src/hooks_settings.rs:564-572 | crates/dim-app-server/src/mcp.rs:553-561 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-app-server/src/hooks_settings.rs:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/mcp.rs:552` calls `and_then`, `confine` and `crates/dim-app-server/src/hooks_settings.rs:563` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/dim-app-server/src/provider/startup.rs:555 — crates/dim-app-server/src/provider/startup.rs:555-563 | crates/dim-app-server/src/provider/startup.rs:587-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/startup.rs:555` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `session` to `&Session` in one and `Session` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/dim-app-server/src/provider/startup.rs:564` calls `same_destination` and `crates/dim-app-server/src/provider/startup.rs:596` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/dim-app-server/src/settings/workflow_files.rs:189 — crates/dim-app-server/src/settings/workflow_files.rs:189-197 | crates/dim-app-server/src/settings/workflow_files.rs:243-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/settings/workflow_files.rs:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `WorkflowReadRequest` in one and `WorkflowReplaceRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) crates/dim-app-server/src/storage/members.rs:806 — crates/dim-app-server/src/storage/members.rs:806-814 | crates/dim-app-server/src/storage/members.rs:856-864 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/members.rs:806` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) crates/dim-app-server/src/storage/members.rs:895 — crates/dim-app-server/src/storage/members.rs:895-903 | crates/dim-app-server/src/storage/query.rs:284-292 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-app-server/src/storage/members.rs:895` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) REDACTED:938 — REDACTED:938-946 | crates/dim-cli/src/client.rs:320-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/dim-cli/src/composer.rs:768 — crates/dim-cli/src/composer.rs:768-776 | crates/dim-cli/src/ui/composer/mod.rs:1427-1435 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/composer.rs:768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `image` to `&images::Attached` in one and `&crate::images::Attached` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/dim-cli/src/ui/composer/mod.rs:1437` calls `push_str`, `t` and `crates/dim-cli/src/composer.rs:778` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/dim-cli/src/management/workflow.rs:375 — crates/dim-cli/src/management/workflow.rs:375-383 | crates/dim-cli/src/management/workflow.rs:417-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/management/workflow.rs:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) xtask/src/main.rs:557 — xtask/src/main.rs:557-565 | xtask/src/main.rs:756-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×29
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/agent_loop.rs:561 — crates/dim-agent-capabilities/src/agent_loop.rs:561-570 | crates/dim-agent-capabilities/src/context_preparation.rs:549-558 — before extracting anything, compare `crates/dim-agent-capabilities/src/agent_loop.rs` and `crates/dim-agent-capabilities/src/context_preparation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:1096 — crates/dim-agent-capabilities/src/context_preparation.rs:1096-1105 | crates/dim-agent-capabilities/src/model_provider.rs:680-689 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:1096` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/context_usage.rs:421 — crates/dim-agent-capabilities/src/context_usage.rs:421-430 | crates/dim-agent-capabilities/src/prompt/recovery.rs:66-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_usage.rs:421` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/permission.rs:682 — crates/dim-agent-capabilities/src/permission.rs:682-691 | crates/dim-agent-runtime/src/core/timeline.rs:427-436 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/permission.rs:682` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:869 — crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:869-878 | crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:884-893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:869` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `record` to `ContentMatch` in one and `FileCount` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:221 — crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:221-230 | crates/dim-cli/src/ui/composer/mentions.rs:225-234 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs` and `crates/dim-cli/src/ui/composer/mentions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/pending.rs:228 — crates/dim-agent-capabilities/src/workspace_tools/pending.rs:228-237 | crates/dim-app-server/src/collaboration/pending.rs:346-355 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/pending.rs:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-agent-scheduler/src/loops.rs:905 — crates/dim-agent-scheduler/src/loops.rs:905-914 | crates/dim-agent-scheduler/src/wakeups.rs:375-384 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/dim-app-server/src/collaboration/pending.rs:135 — crates/dim-app-server/src/collaboration/pending.rs:135-144 | crates/dim-app-server/src/collaboration/pending.rs:363-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration/pending.rs:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/collaboration/pending.rs:181 — crates/dim-app-server/src/collaboration/pending.rs:181-190 | crates/dim-app-server/src/collaboration/pending.rs:407-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration/pending.rs:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/lib.rs:1166 — crates/dim-app-server/src/lib.rs:1166-1175 | crates/dim-app-server/src/lib.rs:1183-1192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/lib.rs:1166` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/mcp/session.rs:315 — crates/dim-app-server/src/mcp/session.rs:315-324 | crates/dim-app-server/src/mcp/session.rs:388-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/storage/members.rs:1181 — crates/dim-app-server/src/storage/members.rs:1181-1190 | crates/dim-app-server/src/storage/members.rs:1337-1346 — both copies are in the same file, so extract the block into 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) REDACTED:1282 — REDACTED:1282-1291 | REDACTED:2182-2191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-cli/src/input.rs:250 — crates/dim-cli/src/input.rs:250-259 | crates/dim-cli/src/input.rs:329-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/input.rs:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) crates/dim-goal/src/branch.rs:2063 — crates/dim-goal/src/branch.rs:2063-2072 | crates/dim-goal/src/fold.rs:746-755 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/dim-cli/src/session_host.rs:4905 — crates/dim-cli/src/session_host.rs:4905-4914 | crates/dim-cli/src/ui/oauth_view.rs:1020-1029 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/shell_session.rs:1753 — crates/dim-agent-capabilities/src/shell_session.rs:1753-1762 | crates/dim-agent-capabilities/src/workspace_tools/exec.rs:1759-1768 — 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/dim-agent-runtime/src/memory_timeline_store.rs:127 — crates/dim-agent-runtime/src/memory_timeline_store.rs:127-136 | REDACTED:2983-2992 — 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/dim-agent-capabilities/src/agent_loop.rs:798 — crates/dim-agent-capabilities/src/agent_loop.rs:798-807 | crates/dim-agent-capabilities/src/context_preparation.rs:571-599 — before extracting anything, compare `crates/dim-agent-capabilities/src/agent_loop.rs` and `crates/dim-agent-capabilities/src/context_preparation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop.rs:798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:803 — crates/dim-agent-capabilities/src/context_preparation.rs:803-812 | crates/dim-agent-capabilities/src/model_provider.rs:514-527 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:803` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/dim-agent-capabilities/src/context_preparation.rs:814` calls `is_none`, `steered` and `crates/dim-agent-capabilities/src/model_provider.rs:529` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/exec_shell_settings.rs:65 — crates/dim-app-server/src/exec_shell_settings.rs:65-76 | crates/dim-app-server/src/storage_methods.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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/exec_shell_settings.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:3462 — crates/dim-agent-capabilities/src/timeline_tree.rs:3462-3471 | crates/dim-agent-capabilities/src/timeline_tree.rs:3858-3867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:3462` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/connection/tree.rs:782 — crates/dim-app-server/src/connection/tree.rs:782-791 | crates/dim-app-server/src/connection/tree.rs:813-822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/connection/tree.rs:782` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/connection/tree.rs:780` calls `as_u64`, `expect` and `crates/dim-app-server/src/connection/tree.rs:811` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/dim-app-server/src/collaboration.rs:3779 — crates/dim-app-server/src/collaboration.rs:3779-3788 | crates/dim-app-server/src/collaboration.rs:3937-3946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration.rs:3779` 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×29
  • Duplicated block (6 lines × 2) crates/dim-acp/src/gateway.rs:708 — crates/dim-acp/src/gateway.rs:708-713 | crates/dim-acp/src/gateway.rs:718-723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-acp/src/gateway.rs:708` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-agent-capabilities/src/input_queue.rs:431 — crates/dim-agent-capabilities/src/input_queue.rs:431-436 | crates/dim-agent-capabilities/src/wait.rs:477-482 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-agent-capabilities/src/input_queue.rs:431` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-agent-runtime/src/core/timeline.rs:460 — crates/dim-agent-runtime/src/core/timeline.rs:460-465 | crates/dim-agent-runtime/src/core/timeline.rs:521-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) crates/dim-app-server/src/provider.rs:1698 — crates/dim-app-server/src/provider.rs:1698-1703 | crates/dim-app-server/src/provider.rs:1735-1740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider.rs:1698` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-cli/src/session_host.rs:2222 — crates/dim-cli/src/session_host.rs:2222-2227 | crates/dim-cli/src/session_host/tasks.rs:315-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/session_host.rs:2222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-cli/src/session_host/member.rs:537 — crates/dim-cli/src/session_host/member.rs:537-542 | crates/dim-cli/src/session_host/tasks.rs:454-459 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-cli/src/session_host/member.rs:537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-cli/src/ui/tui.rs:5718 — crates/dim-cli/src/ui/tui.rs:5718-5723 | crates/dim-cli/src/ui/tui.rs:5811-5816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/tui.rs:5718` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-cli/src/ui/tui.rs:6331 — crates/dim-cli/src/ui/tui.rs:6331-6336 | crates/dim-cli/src/ui/tui.rs:6385-6390 — both copies are in the same file, so extract the block into 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) xtask/src/summary_eval.rs:902 — xtask/src/summary_eval.rs:902-907 | xtask/src/summary_eval.rs:914-919 — both copies are in the same file, so extract the block into 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/dim-agent-capabilities/src/agent_loop/read.rs:66 — crates/dim-agent-capabilities/src/agent_loop/read.rs:66-71 | crates/dim-agent-capabilities/src/agent_loop/read.rs:137-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop/read.rs:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-agent-capabilities/src/input_queue/pending.rs:158 — crates/dim-agent-capabilities/src/input_queue/pending.rs:158-163 | crates/dim-app-server/src/collaboration/pending.rs:176-181 — before extracting anything, compare `crates/dim-agent-capabilities/src/input_queue/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/input_queue/pending.rs:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/collaboration/pending.rs:174` calls `into`, `Some` and `crates/dim-agent-capabilities/src/input_queue/pending.rs:157` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/dim-agent-capabilities/src/skills/install.rs:24 — crates/dim-agent-capabilities/src/skills/install.rs:24-29 | crates/dim-agent-capabilities/src/skills/install.rs:137-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/skills/install.rs:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:983 — crates/dim-agent-capabilities/src/timeline_tree.rs:983-988 | crates/dim-agent-runtime/src/core/timeline.rs:666-671 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `query` to `TimelineQuery` in one and `crate::TimelineQuery` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/dim-app-server/src/managed_oauth.rs:433 — crates/dim-app-server/src/managed_oauth.rs:433-438 | crates/dim-app-server/src/managed_oauth.rs:443-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/managed_oauth.rs:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-app-server/src/mcp.rs:878 — crates/dim-app-server/src/mcp.rs:878-883 | crates/dim-app-server/src/mcp.rs:1205-1210 — both copies are in the same file, so extract the block into 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/dim-app-server/src/plugin_manager/acquire.rs:115 — crates/dim-app-server/src/plugin_manager/acquire.rs:115-120 | crates/dim-app-server/src/plugin_manager/acquire.rs:135-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_manager/acquire.rs:115` 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, `crates/dim-app-server/src/plugin_manager/acquire.rs:141` calls `create_dir`, `Ok`, `Err` and `crates/dim-app-server/src/plugin_manager/acquire.rs:121` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/dim-cli/src/ui/render/markdown.rs:518 — crates/dim-cli/src/ui/render/markdown.rs:518-523 | crates/dim-cli/src/ui/theme/ansi.rs:94-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 (6 lines × 2) crates/dim-cli/src/ui/tui.rs:883 — crates/dim-cli/src/ui/tui.rs:883-888 | crates/dim-cli/src/ui/tui.rs:974-979 — both copies are in the same file, so extract the block into 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/dim-goal/src/branch.rs:1537 — crates/dim-goal/src/branch.rs:1537-1542 | crates/dim-goal/src/branch.rs:1564-1569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) crates/dim-agent-capabilities/src/recall.rs:133 — crates/dim-agent-capabilities/src/recall.rs:133-138 | crates/dim-agent-capabilities/src/workspace_tools/mod.rs:167-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 (6 lines × 2) crates/dim-goal/src/text.rs:54 — crates/dim-goal/src/text.rs:54-59 | crates/dim-session-title/src/lib.rs:672-677 — 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/dim-cli/src/ui/models_panel.rs:462 — crates/dim-cli/src/ui/models_panel.rs:462-467 | crates/dim-cli/src/ui/models_panel.rs:470-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/models_panel.rs:462` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/dim-cli/src/ui/transcript/tool_group.rs:590 — crates/dim-cli/src/ui/transcript/tool_group.rs:590-595 | crates/dim-cli/src/ui/transcript/tool_group.rs:1527-1532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-cli/src/ui/transcript/tool_group.rs:589` calls `diff_counts` and `crates/dim-cli/src/ui/transcript/tool_group.rs:1526` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/dim-app-server/src/storage/files.rs:531 — crates/dim-app-server/src/storage/files.rs:531-536 | crates/dim-app-server/src/storage/files.rs:538-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 (6 lines × 2) xtask/src/scenario_eval.rs:3734 — xtask/src/scenario_eval.rs:3734-3739 | xtask/src/scenario_eval.rs:6720-6725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 4 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×28
  • Repeated repair: web/tests/chat-input.mjs web/tests/chat-input.mjs:22 — web/tests/chat-input.mjs changed 22 times in last 90 days and 13 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 resolve at line 22), AT OR 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): keep a withdrawn draft across prompt-driven composer unmounts”; “fix(web): order recalled images at one offset by the gesture that recalled them”; “fix(web): keep a recalled image's anchor through an edit and a second recall”; “fix(web): let only the send-now gesture stop the run it is stopping”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- web/tests/chat-input.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dim-cli/src/update.rs crates/dim-cli/src/update.rs:461 — crates/dim-cli/src/update.rs changed 21 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 11 (its worst body is dim_cli::update::run_install at line 461), AT OR 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(cli): refuse a skipped release in the staged recovery”; “fix(cli): stage startup recovery by channel tag”; “fix(update): retire only the commands the previous version declared”; “fix(update): treat an interrupted check as a failed update”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/update.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/dim-event-hub/src/publish.rs crates/dim-event-hub/src/publish.rs:648 — crates/dim-event-hub/src/publish.rs changed 14 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is dim_event_hub::publish::apply_changes at line 648), AT OR 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: preserve process work through idle shutdown”; “fix(eventhub): look the id up on the target branches in parallel”; “fix(eventhub): record the guide that was written”; “fix(eventhub): keep one event file per Session across retries”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-event-hub/src/publish.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: benchmarks/runner/run_l2.py benchmarks/runner/run_l2.py:131 — benchmarks/runner/run_l2.py changed 11 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is run_l2.verifier_proxy_url at line 131), AT OR 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(eval): preserve explicit API version roots”; “fix(benchmarks): require the cached interpreter, not just its directory”; “fix(benchmarks): fall back when the verifier cache is absent”; “fix(benchmarks): serve verifier uv from the local cache”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- benchmarks/runner/run_l2.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dim-cli/src/management/hooks.rs crates/dim-cli/src/management/hooks.rs:98 — crates/dim-cli/src/management/hooks.rs changed 15 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is dim_cli::management::hooks::apply at line 98), AT OR 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(cli): name an MCP entry by its source and id”; “fix(cli): refuse a workspace path that is not valid UTF-8”; “fix(cli): drop a conflicted draft's link when the re-read fails”; “fix(cli): show a missing project hooks file as its owner reports 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/management/hooks.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/dim-cli/src/update/staged.rs crates/dim-cli/src/update/staged.rs:125 — crates/dim-cli/src/update/staged.rs changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is dim_cli::update::staged::replace at line 125), AT OR 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(cli): refuse a skipped release in the staged recovery”; “fix(cli): stage startup recovery by channel tag”; “fix(update): end the version check's process tree before rolling back”; “fix(update): retire only the commands the previous version declared”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/update/staged.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: web/tests/settings-mcp.mjs web/tests/settings-mcp.mjs:10 — web/tests/settings-mcp.mjs changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is resolve at line 10), AT OR 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(mcp): rename the preview store row and restore two web states”; “fix(web): say a stale import may have disabled a replaced entry”; “fix(web): offer only skip for an entry that does not decode”; “fix(mcp): write project imports through the secret split”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- web/tests/settings-mcp.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dim-cli/src/management/workflow.rs crates/dim-cli/src/management/workflow.rs:206 — crates/dim-cli/src/management/workflow.rs changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is dim_cli::management::workflow::apply at line 206), AT OR 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(cli): name an MCP entry by its source and id”; “fix(cli): refuse a workspace path that is not valid UTF-8”; “fix(cli): send a workflow's explicit parameters as given”; “fix(cli): let the owner apply a parameter's default”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/management/workflow.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: benchmarks/runner/dim_agent.py benchmarks/runner/dim_agent.py:233 — benchmarks/runner/dim_agent.py changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is DimAgent._phase_timeout_sec at line 233), AT OR 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(benchmarks): classify `error decoding response body` as an infra error”; “fix(benchmarks): fetch the job config the params claim to read, and survive a misshapen one”; “fix(benchmarks): refuse a corrupted key-variable name instead of guessing”; “fix(benchmarks): keep the agent key variable out of harbor's redaction”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- benchmarks/runner/dim_agent.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dim-cli/src/ui/atomic.rs crates/dim-cli/src/ui/atomic.rs:42 — crates/dim-cli/src/ui/atomic.rs changed 7 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 6 (its worst body is dim_cli::ui::atomic::update at line 42), AT OR 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(cli): tolerate history writer startup failure and bound lock tests”; “fix(cli): wait for the file lock instead of failing on contention”; “fix(cli): report a replaced file whose directory did not sync”; “fix(cli): keep a symlinked home file a link across writes”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/atomic.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/dim-agent-capabilities/src/images.rs crates/dim-agent-capabilities/src/images.rs:124 — crates/dim-agent-capabilities/src/images.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 12 (its worst body is dim_agent_capabilities::images::sniff at line 124), AT OR 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(capabilities): name a mif1 or msf1 image as HEIF or AVIF”; “fix(read): report both image sizes after orientation”; “fix(capabilities): give every image decoder the same memory limit”; “fix(capabilities): flatten transparent images onto white before JPEG”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-agent-capabilities/src/images.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: web/src/features/settings/ArchivedSettings.vue web/src/features/settings/ArchivedSettings.vue:120 — web/src/features/settings/ArchivedSettings.vue changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is deleteRows at line 120), AT OR 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): derive an unnamed archived row from one predicate”; “fix(web): correct settings controls and unnamed archived sessions”; “fix(web): harden archived session reads and cross-tab writes”; “fix(web): retain recovery state and align interaction contracts”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- web/src/features/settings/ArchivedSettings.vue`: 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/dim-agent-capabilities/src/environment_clients.rs crates/dim-agent-capabilities/src/environment_clients.rs:241 — crates/dim-agent-capabilities/src/environment_clients.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 ClientsBranchPlugin::apply at line 241), AT OR 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(presence): exclude disposing leaves and escape quoted labels”; “fix(presence): gate in-flight snapshots on branch closing”; “fix: gate in-flight snapshots on branch closing”; “fix(presence): follow branch lifecycle and review findings”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-agent-capabilities/src/environment_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/dim-agent-scheduler/src/runs.rs crates/dim-agent-scheduler/src/runs.rs:68 — crates/dim-agent-scheduler/src/runs.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 12 (its worst body is DeliveryState::name at line 68), AT OR 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(scheduler): resume a terminal launch's stop timer across a restart”; “fix(scheduler): read a store an earlier build wrote”; “fix(scheduler): check the target-gone claim at the disable write”; “fix(scheduler): mark a released launch record instead of rewriting its origin”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-agent-scheduler/src/runs.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/dim-event-hub/src/lib.rs crates/dim-event-hub/src/lib.rs:73 — crates/dim-event-hub/src/lib.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 2 (its worst body is ReadyAnnouncer::apply at line 73), AT OR 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: preserve process work through idle shutdown”; “fix(eventhub): share the subscription view across generations”; “fix(eventhub): reconcile after the service is provided”; “fix(eventhub): let rows of other languages read the service”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-event-hub/src/lib.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/dim-cli/src/ui/notify.rs crates/dim-cli/src/ui/notify.rs:129 — crates/dim-cli/src/ui/notify.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is dim_cli::ui::notify::sequence at line 129), AT OR 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(cli): a stop is not a failure”; “fix(tui): ring under screen that drops the OSC”; “fix(tui): keep the bell under tmux and screen”; “fix(tui): keep the bell under herdr”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/notify.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/dim-cli/src/ui/composer/history.rs crates/dim-cli/src/ui/composer/history.rs:33 — crates/dim-cli/src/ui/composer/history.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 3 (its worst body is dim_cli::ui::composer::history::parse at line 33), AT OR 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(cli): tolerate history writer startup failure and bound lock tests”; “fix(cli): write input history off the submit path”; “fix(cli): keep a symlinked home file a link across writes”; “fix(cli): refuse a config.json that does not parse”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/composer/history.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: web/src/features/settings/SkillSettings.vue web/src/features/settings/SkillSettings.vue:31 — web/src/features/settings/SkillSettings.vue 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 6 (its worst body is load at line 31), AT OR 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): retain recovery state and align interaction contracts”; “fix(web): preserve settings scope and enforce conflict reload”; “fix(web): align skills, questions, branches and settings”; “fix: keep a Skill installation inside the record it owns (#740)”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- web/src/features/settings/SkillSettings.vue`: 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: scripts/check-alpha-registry.mjs scripts/check-alpha-registry.mjs:120 — scripts/check-alpha-registry.mjs 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 8 (its worst body is check-alpha-registry.provenance at line 120), AT OR 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(release): retry an unanswered registry read instead of failing on it”; “fix(release): read a response body inside the retry boundary”; “fix(release): read wrapper tags until a write is visible, not once”; “fix(release): retry a registry that has not caught up instead of failing”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- scripts/check-alpha-registry.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dim-app-server/src/provider/naming.rs crates/dim-app-server/src/provider/naming.rs:48 — crates/dim-app-server/src/provider/naming.rs changed 6 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 7 (its worst body is dim_app_server::provider::naming::unique_names at line 48), AT OR 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(provider): reserve id names before any counter”; “fix(provider): compare generated model names after trimming”; “fix(provider): compare catalog names after trimming”; “fix(provider): give every row of a label collision its id”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-app-server/src/provider/naming.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/dim-cli/src/ui/queue_panel.rs crates/dim-cli/src/ui/queue_panel.rs:68 — crates/dim-cli/src/ui/queue_panel.rs changed 4 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 5 (its worst body is QueuePanel::handle_key at line 68), AT OR 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(cli): show only held inputs in the queue UI (#1501)”; “fix(dim-cli): carry the picked row's label instead of asserting it”; “fix(cli): distinguish unread inputs after stopping”; “Fix interrupt recovery and localize export and queue dialogs”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/queue_panel.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: REDACTED REDACTED:90 — REDACTED changed 4 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 13 (its worst body is agent_reviewer.call_model at line 90), AT OR 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(eval): preserve explicit API version roots”; “fix(benchmarks): fetch the job config the params claim to read, and survive a misshapen one”; “fix(benchmarks): refuse a corrupted key-variable name instead of guessing”; “fix(benchmarks): give the L1 judge the same key-variable handling as the agent”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/dim-cli/src/report.rs crates/dim-cli/src/report.rs:39 — crates/dim-cli/src/report.rs changed 5 times in last 90 days and 3 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 Captured::event at line 39), AT OR 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(report): preserve Session admission error responses”; “fix(report): preserve terminal drafts and narrow session fallback”; “fix(report): simplify terminal report controls”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/report.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/dim-event-hub/src/subscribe.rs crates/dim-event-hub/src/subscribe.rs:24 — crates/dim-event-hub/src/subscribe.rs changed 5 times in last 90 days and 3 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 dim_event_hub::subscribe::subscribe at line 24), AT OR 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(eventhub): retire every guide a refused subscribe wrote”; “fix(eventhub): answer transport when a sessions call's outcome is unknown”; “fix(eventhub): keep state per install and close the review's races”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-event-hub/src/subscribe.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/dim-cli/src/ui/terminal/windows.rs crates/dim-cli/src/ui/terminal/windows.rs:253 — crates/dim-cli/src/ui/terminal/windows.rs changed 5 times in last 90 days and 3 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 dim_cli::ui::terminal::windows::read_console at line 253), AT OR 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(cli): restore the input mode when raw mode cannot start”; “fix(cli): exchange console text as UTF-16 on Windows”; “fix(cli): bound the terminal teardown on exit”. 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-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:32:39 +08:00' --until='2026-11-17 19:32:39 +08:00' --full-history --no-merges -- crates/dim-cli/src/ui/terminal/windows.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.
  • + 3 more in this group — see findings.md.
D1 · Cyclomatic Complexity · dim_agent_capabilities · ×26
  • dim_agent_capabilities::recall::search::index (cyclomatic 42) crates/dim-agent-capabilities/src/recall/search.rs:1102 — dim_agent_capabilities::recall::search::index 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.
  • dim_agent_capabilities::output::parse_output (cyclomatic 39) crates/dim-agent-capabilities/src/output.rs:557 — dim_agent_capabilities::output::parse_output 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.
  • dim_agent_capabilities::timeline_tree::line_read_items (cyclomatic 32) crates/dim-agent-capabilities/src/timeline_tree.rs:4183 — dim_agent_capabilities::timeline_tree::line_read_items has cyclomatic complexity 32 (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.
  • dim_agent_capabilities::workspace_tools::files::write::write_target (cyclomatic 28) crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:296 — dim_agent_capabilities::workspace_tools::files::write::write_target 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.
  • dim_agent_capabilities::history::settled_output::settled_request_output (cyclomatic 26) crates/dim-agent-capabilities/src/history/settled_output.rs:62 — dim_agent_capabilities::history::settled_output::settled_request_output 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.
  • dim_agent_capabilities::workspace_tools::files::edit::edit_locked (cyclomatic 26) crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:214 — dim_agent_capabilities::workspace_tools::files::edit::edit_locked 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.
  • dim_agent_capabilities::workspace_tools::files::read::stream_text (cyclomatic 25) crates/dim-agent-capabilities/src/workspace_tools/files/read.rs:370 — dim_agent_capabilities::workspace_tools::files::read::stream_text 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.
  • dim_agent_capabilities::host::reasoning_config (cyclomatic 24) crates/dim-agent-capabilities/src/host.rs:344 — dim_agent_capabilities::host::reasoning_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.
  • dim_agent_capabilities::recall::search::run (cyclomatic 22) crates/dim-agent-capabilities/src/recall/search.rs:679 — dim_agent_capabilities::recall::search::run 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.
  • dim_agent_capabilities::workspace_tools::exec::run_process (cyclomatic 22) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:2456 — dim_agent_capabilities::workspace_tools::exec::run_process 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.
  • dim_agent_capabilities::workspace_tools::files::write::write_locked (cyclomatic 22) crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:109 — dim_agent_capabilities::workspace_tools::files::write::write_locked 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.
  • dim_agent_capabilities::history::replay (cyclomatic 21) crates/dim-agent-capabilities/src/history.rs:956 — dim_agent_capabilities::history::replay has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • dim_agent_capabilities::host_platform::confined::collect (cyclomatic 21) crates/dim-agent-capabilities/src/host_platform/confined.rs:408 — dim_agent_capabilities::host_platform::confined::collect 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.
  • dim_agent_capabilities::host_platform::windows::collect (cyclomatic 21) crates/dim-agent-capabilities/src/host_platform.rs:1547 — dim_agent_capabilities::host_platform::windows::collect 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.
  • dim_agent_capabilities::workspace_tools::files::read::read_text (cyclomatic 21) crates/dim-agent-capabilities/src/workspace_tools/files/read.rs:251 — dim_agent_capabilities::workspace_tools::files::read::read_text has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • dim_agent_capabilities::context_policy::pinned_inputs (cyclomatic 20) crates/dim-agent-capabilities/src/context_policy.rs:2119 — dim_agent_capabilities::context_policy::pinned_inputs 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.
  • dim_agent_capabilities::tool_executor::rebuild (cyclomatic 19) crates/dim-agent-capabilities/src/tool_executor.rs:942 — dim_agent_capabilities::tool_executor::rebuild 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.
  • dim_agent_capabilities::hooks::document::handlers (cyclomatic 18) crates/dim-agent-capabilities/src/hooks/document.rs:251 — dim_agent_capabilities::hooks::document::handlers 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.
  • dim_agent_capabilities::model_provider::recovery::invoke (cyclomatic 17) crates/dim-agent-capabilities/src/model_provider/recovery.rs:66 — dim_agent_capabilities::model_provider::recovery::invoke 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.
  • dim_agent_capabilities::session_files::materialize (cyclomatic 17) crates/dim-agent-capabilities/src/session_files.rs:60 — dim_agent_capabilities::session_files::materialize 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.
  • dim_agent_capabilities::workspace_tools::exec::quote_only_marker (cyclomatic 17) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:431 — dim_agent_capabilities::workspace_tools::exec::quote_only_marker 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.
  • dim_agent_capabilities::context_policy::digest_entries (cyclomatic 16) crates/dim-agent-capabilities/src/context_policy.rs:1988 — dim_agent_capabilities::context_policy::digest_entries 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.
  • dim_agent_capabilities::context_usage::legacy::at (cyclomatic 16) crates/dim-agent-capabilities/src/context_usage/legacy.rs:176 — dim_agent_capabilities::context_usage::legacy::at 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.
  • dim_agent_capabilities::file_storage::reclaim_account (cyclomatic 16) crates/dim-agent-capabilities/src/file_storage.rs:1544 — dim_agent_capabilities::file_storage::reclaim_account 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.
  • dim_agent_capabilities::input_queue::pending::read (cyclomatic 16) crates/dim-agent-capabilities/src/input_queue/pending.rs:21 — dim_agent_capabilities::input_queue::pending::read has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×22
  • Duplicated block (7 lines × 2) crates/dim-agent-aimux/src/driver.rs:342 — crates/dim-agent-aimux/src/driver.rs:342-348 | crates/dim-agent-aimux/src/driver.rs:384-390 — both copies are in the same file, so extract the block into 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/dim-agent-aimux/src/request.rs:420 — crates/dim-agent-aimux/src/request.rs:420-426 | crates/dim-agent-aimux/src/request.rs:471-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-aimux/src/request.rs:420` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) crates/dim-agent-capabilities/src/model_provider.rs:659 — crates/dim-agent-capabilities/src/model_provider.rs:659-665 | crates/dim-agent-capabilities/src/tool_executor.rs:308-314 — before extracting anything, compare `crates/dim-agent-capabilities/src/model_provider.rs` and `crates/dim-agent-capabilities/src/tool_executor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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 `crates/dim-agent-capabilities/src/model_provider.rs:659` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:3874 — crates/dim-agent-capabilities/src/timeline_tree.rs:3874-3880 | crates/dim-agent-capabilities/src/timeline_tree.rs:3900-3906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:3874` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/pending.rs:28 — crates/dim-agent-capabilities/src/workspace_tools/pending.rs:28-34 | crates/dim-app-server/src/collaboration/pending.rs:64-70 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/pending.rs:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-agent-scheduler/src/methods.rs:927 — crates/dim-agent-scheduler/src/methods.rs:927-933 | crates/dim-agent-scheduler/src/methods.rs:957-963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `DeleteParams` in one and `SetEnabledParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/mcp/publication.rs:470 — crates/dim-app-server/src/mcp/publication.rs:470-476 | crates/dim-app-server/src/mcp/publication.rs:493-499 — both copies are in the same file, so extract the block into 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/dim-app-server/src/plugin_manager.rs:899 — crates/dim-app-server/src/plugin_manager.rs:899-905 | crates/dim-app-server/src/plugin_manager.rs:934-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_manager.rs:899` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/storage/files.rs:774 — crates/dim-app-server/src/storage/files.rs:774-780 | crates/dim-app-server/src/storage/files.rs:831-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/files.rs:774` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/storage/identities.rs:79 — crates/dim-app-server/src/storage/identities.rs:79-85 | crates/dim-app-server/src/storage/identities.rs:95-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/identities.rs:79` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/storage/identities.rs:89 — crates/dim-app-server/src/storage/identities.rs:89-95 | crates/dim-app-server/src/storage/text.rs:282-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/identities.rs:89` 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, `crates/dim-app-server/src/storage/identities.rs:97` calls `read_sequence`, `map_err` and `crates/dim-app-server/src/storage/text.rs:290` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/web_entry/uploads.rs:46 — crates/dim-app-server/src/web_entry/uploads.rs:46-52 | crates/dim-cli/src/client.rs:231-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 (7 lines × 2) crates/dim-cli/src/ui/terminal/mod.rs:363 — crates/dim-cli/src/ui/terminal/mod.rs:363-369 | crates/dim-cli/src/ui/terminal/mod.rs:506-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/terminal/mod.rs:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) xtask/src/main.rs:212 — xtask/src/main.rs:212-218 | xtask/src/plugins.rs:258-264 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/dim-agent-aimux/src/request.rs:885 — crates/dim-agent-aimux/src/request.rs:885-891 | crates/dim-agent-aimux/src/request.rs:907-913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-aimux/src/request.rs:885` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/storage/text.rs:270 — crates/dim-app-server/src/storage/text.rs:270-276 | crates/dim-app-server/src/storage/text.rs:287-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/text.rs:270` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-cli/src/ui/models_panel.rs:534 — crates/dim-cli/src/ui/models_panel.rs:534-540 | crates/dim-cli/src/ui/models_panel.rs:557-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/models_panel.rs:534` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) xtask/src/prompt_eval.rs:535 — xtask/src/prompt_eval.rs:535-541 | xtask/src/scenario_eval.rs:4625-4631 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `xtask/src/prompt_eval.rs:535` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/dim-cli/src/ui/tui.rs:3510 — crates/dim-cli/src/ui/tui.rs:3510-3516 | crates/dim-cli/src/ui/tui.rs:3520-3526 — both copies are in the same file, so extract the block into 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/dim-agent-capabilities/src/hooks/sources.rs:23 — crates/dim-agent-capabilities/src/hooks/sources.rs:23-29 | crates/dim-agent-capabilities/src/skills/mod.rs:171-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `f` to `&mut fmt::Formatter<'_>` in one and `&mut std::fmt::Formatter<'_>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/codex_oauth/management.rs:62 — crates/dim-app-server/src/codex_oauth/management.rs:62-68 | crates/dim-app-server/src/grok_oauth/management.rs:51-57 — `crates/dim-app-server/src/codex_oauth/management.rs` and `crates/dim-app-server/src/grok_oauth/management.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 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/codex_oauth/management.rs:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `oauth` to `Arc<OpenAICodexOAuthService>` in one and `Arc<GrokOAuthService>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/dim-app-server/src/storage/identities.rs:72 — crates/dim-app-server/src/storage/identities.rs:72-78 | crates/dim-app-server/src/storage/text.rs:264-270 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-app-server/src/storage/identities.rs:72` 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, `crates/dim-app-server/src/storage/identities.rs:81` calls `read_sequence`, `map_err` and `crates/dim-app-server/src/storage/text.rs:273` 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.
D2 · Cognitive Complexity · App · ×20
  • App::apply (cognitive 242) crates/dim-cli/src/ui/tui.rs:2247 — App::apply has cognitive complexity 242 (threshold 15). Drivers by points: if/else 84 (178 pts), match/switch 21 (49 pts), boolean chains 15 (nesting depth added 122). 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.
  • App::frame (cognitive 156) crates/dim-cli/src/ui/tui.rs:5696 — App::frame has cognitive complexity 156 (threshold 15). Drivers by points: if/else 75 (104 pts), match/switch 15 (24 pts), boolean chains 22, loops 5 (6 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.
  • App::transcript (cognitive 94) crates/dim-cli/src/ui/tui.rs:6745 — App::transcript has cognitive complexity 94 (threshold 15). Drivers by points: if/else 34 (66 pts), match/switch 5 (11 pts), loops 7 (10 pts), boolean chains 7 (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.
  • App::composer_key (cognitive 63) crates/dim-cli/src/ui/tui.rs:3267 — App::composer_key has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 23, match/switch 3 (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.
  • App::apply_effect (cognitive 60) crates/dim-cli/src/ui/tui.rs:3960 — App::apply_effect has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 8 (16 pts), boolean chains 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_input (cognitive 59) crates/dim-cli/src/ui/tui.rs:3095 — App::handle_input has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (36 pts), match/switch 7 (15 pts), boolean chains 8 (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.
  • App::run_command (cognitive 46) crates/dim-cli/src/ui/tui.rs:5313 — App::run_command has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (33 pts), match/switch 6 (11 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.
  • App::tick_at (cognitive 43) crates/dim-cli/src/ui/tui.rs:2103 — App::tick_at has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 9, match/switch 4 (6 pts), loops 2 (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.
  • App::sync_tool_origins (cognitive 35) crates/dim-cli/src/ui/tui.rs:4491 — App::sync_tool_origins has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 7, loops 2 (3 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.
  • App::thought_frames (cognitive 30) crates/dim-cli/src/ui/tui.rs:6663 — App::thought_frames has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 6, 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.
  • App::click (cognitive 27) crates/dim-cli/src/ui/tui.rs:7521 — App::click has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 6, 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.
  • App::setting (cognitive 25) crates/dim-cli/src/ui/tui.rs:4826 — App::setting has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • App::project_member (cognitive 24) crates/dim-cli/src/ui/tui.rs:6572 — App::project_member has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (8 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.
  • App::sync_compaction_details (cognitive 23) crates/dim-cli/src/ui/tui.rs:4439 — App::sync_compaction_details has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::refresh_excerpts (cognitive 22) crates/dim-cli/src/ui/tui.rs:6466 — App::refresh_excerpts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, 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.
  • App::refresh_compactions (cognitive 20) crates/dim-cli/src/ui/tui.rs:4624 — App::refresh_compactions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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.
  • App::refresh_tool_origins (cognitive 19) crates/dim-cli/src/ui/tui.rs:4555 — App::refresh_tool_origins has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 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.
  • App::refresh_messages (cognitive 18) crates/dim-cli/src/ui/tui.rs:7779 — App::refresh_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, 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.
  • App::refresh_cards (cognitive 18) crates/dim-cli/src/ui/tui.rs:7851 — App::refresh_cards has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 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.
  • App::reflow_history (cognitive 16) crates/dim-cli/src/ui/tui.rs:8001 — App::reflow_history has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, 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.
D3 · God Classes · TooManyMethods · ×20
  • TooManyMethods: App crates/dim-cli/src/ui/tui.rs:1053 — TooManyMethods — 148 methods. The bar is 30 methods; this is 118 over it, 4.93× 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: Worker crates/dim-cli/src/session_host.rs:259 — TooManyMethods — 134 methods, declared across 7 files: src/session_host.rs (80), session_host/member.rs (16), session_host/tasks.rs (15), session_host/workflow.rs (10), +3 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: AgentIndex crates/dim-app-server/src/agents.rs:366 — TooManyMethods — 70 methods, declared across 2 files: src/agents.rs (59), agents/sessions.rs (11). The bar is 30 methods; this is 40 over it, 2.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Projection crates/dim-cli/src/projection.rs:44 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FullScreen crates/dim-cli/src/ui/render/fullscreen.rs:325 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: Composer crates/dim-cli/src/ui/composer/mod.rs:115 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: ProviderService crates/dim-app-server/src/provider.rs:1408 — TooManyMethods — 54 methods, declared across 9 files: src/provider.rs (24), provider/startup.rs (7), provider/view.rs (7), provider/models.rs (6), +5 more file(s). The bar is 30 methods; this is 24 over it, 1.80× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BundledCatalog crates/dim-app-server/src/model_catalog.rs:343 — TooManyMethods — 45 methods, declared across 2 files: src/model_catalog.rs (26), model_catalog/id.rs (19). The bar is 30 methods; this is 15 over it, 1.50× 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/dim-agent-runtime/src/agent.rs:415 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× 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: TimelineContext crates/dim-agent-runtime/src/timeline_context.rs:29 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: Service crates/dim-app-server/src/managed_oauth.rs:229 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: CollaborationSession crates/dim-app-server/src/collaboration.rs:945 — TooManyMethods — 42 methods, declared across 2 files: src/collaboration.rs (26), collaboration/approvals.rs (16). The bar is 30 methods; this is 12 over it, 1.40× 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: Owner crates/dim-goal/src/branch.rs:375 — TooManyMethods — 42 methods, declared across 2 files: src/branch.rs (39), branch/restore.rs (3). The bar is 30 methods; this is 12 over it, 1.40× 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: TimelineTree crates/dim-agent-capabilities/src/timeline_tree.rs:81 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 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.
  • TooManyMethods: Shared crates/dim-modality/src/engine.rs:464 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 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.
  • TooManyMethods: Timeline crates/dim-agent-runtime/src/core/timeline.rs:92 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Connection crates/dim-app-server/src/connection.rs:63 — TooManyMethods — 37 methods, declared across 5 files: src/connection.rs (22), connection/tree.rs (10), connection/subscription.rs (3), connection/mcp.rs (1), +1 more file(s). The bar is 30 methods; this is 7 over it, 1.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ManagementPanel crates/dim-cli/src/ui/management_panel.rs:43 — TooManyMethods — 32 methods. The bar is 30 methods; 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.
  • TooManyMethods: ListPanel crates/dim-cli/src/ui/list_panel.rs:75 — TooManyMethods — 31 methods. The bar is 30 methods; 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.
  • TooManyMethods: ModelsPanel crates/dim-cli/src/ui/models_panel.rs:113 — TooManyMethods — 31 methods. The bar is 30 methods; 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×20
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:1125 — crates/dim-agent-capabilities/src/context_preparation.rs:1125-1135 | crates/dim-agent-capabilities/src/model_provider.rs:696-706 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:1125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:1161 — crates/dim-agent-capabilities/src/context_preparation.rs:1161-1171 | crates/dim-agent-capabilities/src/model_provider.rs:732-742 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:1161` 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. 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 (11 lines × 2) crates/dim-agent-capabilities/src/history.rs:1401 — crates/dim-agent-capabilities/src/history.rs:1401-1411 | crates/dim-app-server/src/collaboration.rs:3845-3855 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/history.rs:1401` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/hooks/runner.rs:167 — crates/dim-agent-capabilities/src/hooks/runner.rs:167-177 | crates/dim-agent-capabilities/src/hooks/runner.rs:294-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/hooks/runner.rs:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/recall/search.rs:437 — crates/dim-agent-capabilities/src/recall/search.rs:437-447 | crates/dim-agent-capabilities/src/recall/search.rs:575-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-agent-scheduler/src/engine.rs:826 — crates/dim-agent-scheduler/src/engine.rs:826-836 | crates/dim-event-hub/src/publish.rs:846-856 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-scheduler/src/engine.rs:826` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/plugin_files.rs:754 — crates/dim-app-server/src/plugin_files.rs:754-764 | crates/dim-migration/src/lib.rs:168-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_files.rs:754` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/provider/editing.rs:545 — crates/dim-app-server/src/provider/editing.rs:545-555 | crates/dim-app-server/src/provider/models.rs:78-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 (11 lines × 2) crates/dim-goal/src/branch.rs:441 — crates/dim-goal/src/branch.rs:441-451 | crates/dim-goal/src/branch.rs:482-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-goal/src/branch.rs:441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-cli/src/login.rs:97 — crates/dim-cli/src/login.rs:97-107 | crates/dim-oauth/src/http.rs:41-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/plugin_files.rs:177 — crates/dim-app-server/src/plugin_files.rs:177-187 | crates/dim-app-server/src/plugin_files.rs:212-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_files.rs:177` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/dim-app-server/src/plugin_files.rs:223` calls `clone`, `drop_guard` and `crates/dim-app-server/src/plugin_files.rs:188` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:146 — crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:146-156 | crates/dim-cli/src/ui/composer/mentions.rs:455-465 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs` and `crates/dim-cli/src/ui/composer/mentions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/settings.rs:528 — crates/dim-app-server/src/settings.rs:528-538 | crates/dim-oauth/src/store.rs:75-85 — 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/dim-app-server/src/collaboration_model_policy.rs:134 — crates/dim-app-server/src/collaboration_model_policy.rs:134-145 | crates/dim-app-server/src/permission_rules.rs:171-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration_model_policy.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/storage/files.rs:427 — crates/dim-app-server/src/storage/files.rs:427-437 | crates/dim-app-server/src/storage/files.rs:781-791 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/files.rs:427` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/model_provider.rs:353 — crates/dim-agent-capabilities/src/model_provider.rs:353-363 | crates/dim-agent-capabilities/src/tool_executor.rs:886-896 — before extracting anything, compare `crates/dim-agent-capabilities/src/model_provider.rs` and `crates/dim-agent-capabilities/src/tool_executor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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 `crates/dim-agent-capabilities/src/model_provider.rs:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/model_provider.rs:350` calls `into` and `crates/dim-agent-capabilities/src/tool_executor.rs:883` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/history.rs:1403 — crates/dim-agent-capabilities/src/history.rs:1403-1413 | crates/dim-agent-capabilities/src/hooks/runner.rs:1181-1191 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/history.rs:1403` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/hooks_settings.rs:715 — crates/dim-app-server/src/hooks_settings.rs:715-725 | crates/dim-app-server/src/skills_management.rs:675-685 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-app-server/src/hooks_settings.rs:715` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-app-server/src/prompt_settings.rs:92 — crates/dim-app-server/src/prompt_settings.rs:92-102 | crates/dim-app-server/src/prompt_suggestion_settings.rs:38-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-app-server/src/prompt_settings.rs:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/dim-agent-capabilities/src/hooks/runner.rs:1476 — crates/dim-agent-capabilities/src/hooks/runner.rs:1476-1486 | crates/dim-app-server/src/agents.rs:1265-1275 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/hooks/runner.rs:1476` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · xtask · ×19
  • xtask::scenario_eval::drive (cognitive 105) xtask/src/scenario_eval.rs:4538 — xtask::scenario_eval::drive has cognitive complexity 105 (threshold 15). Drivers by points: if/else 26 (59 pts), match/switch 12 (28 pts), boolean chains 13, loops 4 (5 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::prompt_eval::report (cognitive 99) xtask/src/prompt_eval.rs:1815 — xtask::prompt_eval::report has cognitive complexity 99 (threshold 15). Drivers by points: if/else 39 (66 pts), loops 16 (26 pts), match/switch 2 (4 pts), boolean chains 3 (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.
  • xtask::prompt_eval::drive (cognitive 96) xtask/src/prompt_eval.rs:481 — xtask::prompt_eval::drive has cognitive complexity 96 (threshold 15). Drivers by points: if/else 23 (60 pts), match/switch 8 (30 pts), boolean chains 4, loops 2 (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • xtask::scenario_eval::preflight_checks (cognitive 69) xtask/src/scenario_eval.rs:3082 — xtask::scenario_eval::preflight_checks has cognitive complexity 69 (threshold 15). Drivers by points: if/else 39 (54 pts), boolean chains 11, loops 2, match/switch 1 (2 pts) (nesting depth added 16). Of this number, 63 points are the body's own statements and 6 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.
  • xtask::scenario_eval::into_scenario (cognitive 46) xtask/src/scenario_eval.rs:1833 — xtask::scenario_eval::into_scenario has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 5, boolean chains 4, match/switch 2 (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.
  • xtask::prompt_eval::replay_one (cognitive 40) xtask/src/prompt_eval.rs:1070 — xtask::prompt_eval::replay_one has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, loops 4 (6 pts), match/switch 1 (3 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.
  • xtask::modules::generate (cognitive 36) xtask/src/modules.rs:61 — xtask::modules::generate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 7 (14 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.
  • xtask::npm::check_lock (cognitive 33) xtask/src/npm.rs:100 — xtask::npm::check_lock has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 5 (8 pts), loops 5 (6 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.
  • xtask::scenario_eval::preflight_session (cognitive 31) xtask/src/scenario_eval.rs:2931 — xtask::scenario_eval::preflight_session has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (6 pts), match/switch 2 (5 pts), boolean chains 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.
  • xtask::scenario_eval::report (cognitive 26) xtask/src/scenario_eval.rs:6550 — xtask::scenario_eval::report has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 7 (9 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • xtask::boundaries (cognitive 23) xtask/src/main.rs:347 — xtask::boundaries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • xtask::prompt_eval::recorded (cognitive 20) xtask/src/prompt_eval.rs:1503 — xtask::prompt_eval::recorded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 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.
  • xtask::modules::cli_layer_violation (cognitive 19) xtask/src/modules.rs:584 — xtask::modules::cli_layer_violation has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • xtask::scenario_eval::child_drive (cognitive 18) xtask/src/scenario_eval.rs:2522 — xtask::scenario_eval::child_drive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (5 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.
  • xtask::scenario_eval::fire_events_after_subscribe (cognitive 18) xtask/src/scenario_eval.rs:5670 — xtask::scenario_eval::fire_events_after_subscribe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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.
  • xtask::scenario_eval::product_probe (cognitive 17) xtask/src/scenario_eval.rs:2797 — xtask::scenario_eval::product_probe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (5 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.
  • xtask::measure (cognitive 16) xtask/src/main.rs:414 — xtask::measure has cognitive complexity 16 (threshold 15). Drivers by points: loops 9 (15 pts), boolean chains 1 (nesting depth added 6). 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.
  • xtask::scenario_eval::serve_entry (cognitive 16) xtask/src/scenario_eval.rs:2292 — xtask::scenario_eval::serve_entry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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.
  • xtask::scenario_eval::decline_question (cognitive 16) xtask/src/scenario_eval.rs:4918 — xtask::scenario_eval::decline_question has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (2 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×18
  • Duplicated block (12 lines × 2) crates/dim-acp/src/gateway.rs:1443 — crates/dim-acp/src/gateway.rs:1443-1454 | crates/dim-acp/src/gateway.rs:1855-1866 — both copies are in the same file, so extract the block into 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/dim-acp/src/projection.rs:102 — crates/dim-acp/src/projection.rs:102-113 | crates/dim-cli/src/projection.rs:2237-2248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/projection.rs:2237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-agent-capabilities/src/host_platform.rs:183 — crates/dim-agent-capabilities/src/host_platform.rs:183-194 | xtask/src/scenario_eval.rs:3759-3770 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/host_platform.rs:183` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:370 — crates/dim-agent-capabilities/src/timeline_tree.rs:370-381 | crates/dim-app-server/src/agents.rs:411-422 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/files.rs:688 — crates/dim-agent-capabilities/src/workspace_tools/files.rs:688-699 | crates/dim-agent-capabilities/src/workspace_tools/files.rs:746-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/files.rs:688` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-agent-scheduler/src/document.rs:398 — crates/dim-agent-scheduler/src/document.rs:398-409 | crates/dim-agent-scheduler/src/document.rs:469-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-scheduler/src/document.rs:398` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/codex_oauth.rs:118 — crates/dim-app-server/src/codex_oauth.rs:118-129 | crates/dim-app-server/src/grok_oauth.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/codex_oauth.rs:118` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/collaboration/approvals.rs:319 — crates/dim-app-server/src/collaboration/approvals.rs:319-330 | crates/dim-app-server/src/collaboration/approvals.rs:421-432 — both copies are in the same file, so extract the block into 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/dim-app-server/src/connection/tree.rs:1512 — crates/dim-app-server/src/connection/tree.rs:1512-1523 | crates/dim-app-server/src/connection/tree.rs:1693-1704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/connection/tree.rs:1512` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/provider/models.rs:478 — crates/dim-app-server/src/provider/models.rs:478-489 | crates/dim-app-server/src/provider/models.rs:604-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/models.rs:478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/provider/models.rs:540 — crates/dim-app-server/src/provider/models.rs:540-551 | crates/dim-app-server/src/provider/models.rs:644-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/models.rs:540` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/provider/startup.rs:543 — crates/dim-app-server/src/provider/startup.rs:543-554 | crates/dim-app-server/src/provider/startup.rs:566-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/skills_management.rs:206 — crates/dim-app-server/src/skills_management.rs:206-217 | crates/dim-app-server/src/skills_management.rs:243-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/skills_management.rs:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/storage/files.rs:590 — crates/dim-app-server/src/storage/files.rs:590-601 | crates/dim-app-server/src/storage/files.rs:687-698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/files.rs:590` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-cli/src/session_host.rs:2179 — crates/dim-cli/src/session_host.rs:2179-2190 | crates/dim-cli/src/session_host.rs:2268-2279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/session_host.rs:2179` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/dim-cli/src/session_host.rs:3184 — crates/dim-cli/src/session_host.rs:3184-3195 | crates/dim-cli/src/session_host.rs:4156-4167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/session_host.rs:3184` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dim-agent-scheduler/src/engine.rs:1038 — crates/dim-agent-scheduler/src/engine.rs:1038-1049 | crates/dim-agent-scheduler/src/engine.rs:1077-1088 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-scheduler/src/engine.rs:1038` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/dim-app-server/src/agent_records.rs:24 — crates/dim-app-server/src/agent_records.rs:24-35 | crates/dim-app-server/src/agent_records.rs:217-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/agent_records.rs:24` 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.
D2 · Cognitive Complexity · Worker · ×17
  • Worker::command (cognitive 196) crates/dim-cli/src/session_host.rs:1285 — Worker::command has cognitive complexity 196 (threshold 15). Drivers by points: if/else 66 (134 pts), match/switch 18 (40 pts), boolean chains 20, loops 1 (2 pts) (nesting depth added 91). 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.
  • Worker::message (cognitive 69) crates/dim-cli/src/session_host.rs:2671 — Worker::message has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 13, match/switch 4 (7 pts), loops 2 (5 pts) (nesting depth added 28). 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.
  • Worker::member_reply (cognitive 66) crates/dim-cli/src/session_host/member.rs:409 — Worker::member_reply has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 10 (21 pts), loops 3 (12 pts), boolean chains 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Worker::reply (cognitive 60) crates/dim-cli/src/session_host.rs:4340 — Worker::reply has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (37 pts), match/switch 7 (21 pts), boolean chains 2 (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.
  • Worker::task_history_reply (cognitive 58) crates/dim-cli/src/session_host/tasks.rs:438 — Worker::task_history_reply has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (39 pts), match/switch 4 (7 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Worker::apply_inventory (cognitive 49) crates/dim-cli/src/session_host/inventory.rs:22 — Worker::apply_inventory has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 6 (12 pts), boolean chains 1, match/switch 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.
  • Worker::poll_task_history (cognitive 49) crates/dim-cli/src/session_host/tasks.rs:280 — Worker::poll_task_history has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 7, match/switch 3 (6 pts), 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.
  • Worker::poll_member (cognitive 48) crates/dim-cli/src/session_host/member.rs:219 — Worker::poll_member has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 8, loops 4 (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.
  • Worker::login_start (cognitive 25) crates/dim-cli/src/session_host.rs:4081 — Worker::login_start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Worker::fold (cognitive 25) crates/dim-cli/src/session_host.rs:4620 — Worker::fold has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 10, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • Worker::start_session (cognitive 24) crates/dim-cli/src/session_host.rs:818 — Worker::start_session has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, match/switch 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.
  • Worker::models (cognitive 24) crates/dim-cli/src/session_host.rs:3531 — Worker::models has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Worker::enter (cognitive 22) crates/dim-cli/src/session_host.rs:921 — Worker::enter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4 (6 pts), loops 2 (3 pts), boolean chains 2 (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.
  • Worker::provider_action (cognitive 22) crates/dim-cli/src/session_host.rs:3447 — Worker::provider_action has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3 (5 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.
  • Worker::run (cognitive 17) crates/dim-app-server/src/mcp/publication.rs:261 — Worker::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (4 pts), boolean chains 3, 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.
  • Worker::submit_draft (cognitive 17) crates/dim-cli/src/session_host.rs:1206 — Worker::submit_draft has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 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.
  • Worker::configure_home (cognitive 16) crates/dim-cli/src/session_host.rs:3789 — Worker::configure_home has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×15
  • Edited copy of a member (7 corresponding lines) xtask/src/scenario_eval.rs:1563 — xtask/src/scenario_eval.rs:1563-1569 | xtask/src/summary_eval.rs:338-344 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-cli/src/ui/render/fullscreen.rs:738 — crates/dim-cli/src/ui/render/fullscreen.rs:738-747 | crates/dim-cli/src/ui/render/fullscreen.rs:750-756 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-capabilities/src/skills/install.rs:222 — crates/dim-agent-capabilities/src/skills/install.rs:222-229 | crates/dim-agent-capabilities/src/skills/install.rs:264-270 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-runtime/src/memory.rs:17 — crates/dim-agent-runtime/src/memory.rs:17-23 | xtask/src/main.rs:826-835 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-app-server/src/mcp/discovery.rs:240 — crates/dim-app-server/src/mcp/discovery.rs:240-246 | crates/dim-app-server/src/mcp/discovery.rs:248-254 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-cli/src/ui/tasks_panel.rs:418 — crates/dim-cli/src/ui/tasks_panel.rs:418-428 | crates/dim-cli/src/ui/tasks_panel.rs:430-436 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-app-server/src/provider.rs:1441 — crates/dim-app-server/src/provider.rs:1441-1447 | crates/dim-app-server/src/provider/persistence.rs:363-369 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-app-server/src/mcp/config.rs:400 — crates/dim-app-server/src/mcp/config.rs:400-406 | crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:210-216 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-app-server/src/storage/files.rs:286 — crates/dim-app-server/src/storage/files.rs:286-293 | crates/dim-app-server/src/storage/metadata.rs:149-155 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) xtask/src/prompt_eval.rs:805 — xtask/src/prompt_eval.rs:805-814 | xtask/src/scenario_eval.rs:5736-5742 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-attachments/src/lib.rs:122 — crates/dim-agent-attachments/src/lib.rs:122-128 | crates/dim-app-server/src/hooks_settings.rs:667-674 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-capabilities/src/input_queue.rs:653 — crates/dim-agent-capabilities/src/input_queue.rs:653-659 | crates/dim-app-server/src/session_language.rs:31-37 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-capabilities/src/prompt/recovery.rs:92 — crates/dim-agent-capabilities/src/prompt/recovery.rs:92-98 | crates/dim-agent-capabilities/src/recall/search.rs:37-43 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-capabilities/src/file_storage/windows.rs:737 — crates/dim-agent-capabilities/src/file_storage/windows.rs:737-749 | crates/dim-agent-capabilities/src/host_platform.rs:1789-1795 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/dim-agent-capabilities/src/skills/catalog.rs:742 — crates/dim-agent-capabilities/src/skills/catalog.rs:742-748 | crates/dim-app-server/src/skills_management.rs:618-625 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×15
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:1689 — crates/dim-agent-capabilities/src/file_storage.rs:1689-1701 | crates/dim-agent-capabilities/src/file_storage.rs:1710-1719 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-app-server/src/plugin_files.rs:134 — crates/dim-app-server/src/plugin_files.rs:134-143 | crates/dim-app-server/src/plugin_files.rs:145-154 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-aimux/src/request/native.rs:31 — crates/dim-agent-aimux/src/request/native.rs:31-40 | crates/dim-agent-aimux/src/request/native.rs:44-54 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-capabilities/src/history.rs:342 — crates/dim-agent-capabilities/src/history.rs:342-352 | crates/dim-agent-capabilities/src/history.rs:358-367 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-app-server/src/settings.rs:249 — crates/dim-app-server/src/settings.rs:249-259 | crates/dim-app-server/src/settings.rs:262-271 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-capabilities/src/recall.rs:1336 — crates/dim-agent-capabilities/src/recall.rs:1336-1345 | crates/dim-agent-capabilities/src/recall.rs:1347-1356 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-cli/src/input.rs:48 — crates/dim-cli/src/input.rs:48-57 | crates/dim-cli/src/input.rs:237-246 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-cli/src/management_command.rs:552 — crates/dim-cli/src/management_command.rs:552-561 | crates/dim-cli/src/management_command.rs:564-573 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-acp/src/gateway.rs:351 — crates/dim-acp/src/gateway.rs:351-360 | crates/dim-app-server/src/collaboration.rs:463-472 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-capabilities/src/hooks/runner.rs:712 — crates/dim-agent-capabilities/src/hooks/runner.rs:712-724 | crates/dim-cli/src/projection.rs:2105-2114 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-cli/src/management/editor.rs:143 — crates/dim-cli/src/management/editor.rs:143-154 | crates/dim-app-server/src/lib.rs:1497-1506 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-scheduler/src/methods.rs:94 — crates/dim-agent-scheduler/src/methods.rs:94-103 | crates/dim-app-server/src/mcp.rs:1805-1814 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-session-title/src/lib.rs:166 — crates/dim-session-title/src/lib.rs:166-177 | crates/dim-app-server/src/mcp/session.rs:461-470 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-cli/src/management/mcp.rs:1684 — crates/dim-cli/src/management/mcp.rs:1684-1694 | crates/dim-cli/src/management_command.rs:576-585 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/dim-agent-capabilities/src/execution_settings.rs:66 — crates/dim-agent-capabilities/src/execution_settings.rs:66-75 | crates/dim-agent-capabilities/src/prompt_suggestion.rs:113-122 — 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 · Duplicated block (5 lines × 2) · ×15
  • Duplicated block (5 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/pending.rs:90 — crates/dim-agent-capabilities/src/workspace_tools/pending.rs:90-94 | crates/dim-agent-capabilities/src/workspace_tools/pending.rs:236-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/pending.rs:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/dim-agent-runtime/src/assembly.rs:1386 — crates/dim-agent-runtime/src/assembly.rs:1386-1390 | crates/dim-agent-runtime/src/assembly.rs:1811-1815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-runtime/src/assembly.rs:1386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/dim-agent-runtime/src/timeline_store_face.rs:446 — crates/dim-agent-runtime/src/timeline_store_face.rs:446-450 | crates/dim-app-server/src/storage/face.rs:371-375 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-runtime/src/timeline_store_face.rs:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/dim-app-server/src/connection.rs:2683 — crates/dim-app-server/src/connection.rs:2683-2687 | crates/dim-app-server/src/storage/metadata.rs:306-311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/connection.rs:2683` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/dim-app-server/src/provider/startup.rs:100 — crates/dim-app-server/src/provider/startup.rs:100-104 | REDACTED:1936-1940 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/startup.rs:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:1043 — REDACTED:1043-1047 | REDACTED:1106-1112 — both copies are in the same file, so extract the block into 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/dim-cli/src/session_host.rs:3086 — crates/dim-cli/src/session_host.rs:3086-3091 | crates/dim-cli/src/session_host.rs:3102-3106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/dim-agent-capabilities/src/file_storage.rs:1703 — crates/dim-agent-capabilities/src/file_storage.rs:1703-1707 | crates/dim-agent-capabilities/src/file_storage/windows.rs:239-243 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/dim-app-server/src/ui_host.rs:637 — crates/dim-app-server/src/ui_host.rs:637-641 | crates/dim-app-server/src/web_entry.rs:336-340 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/dim-agent-capabilities/src/input_queue/pending.rs:96 — crates/dim-agent-capabilities/src/input_queue/pending.rs:96-100 | crates/dim-app-server/src/collaboration/pending.rs:128-132 — before extracting anything, compare `crates/dim-agent-capabilities/src/input_queue/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/input_queue/pending.rs:96` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) crates/dim-agent-scheduler/src/session.rs:820 — crates/dim-agent-scheduler/src/session.rs:820-824 | crates/dim-agent-scheduler/src/session.rs:832-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-scheduler/src/session.rs:820` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/files.rs:931 — crates/dim-agent-capabilities/src/workspace_tools/files.rs:931-935 | crates/dim-agent-capabilities/src/workspace_tools/files.rs:997-1001 — both copies are in the same file, so extract the block into 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/dim-cli/src/model/shell.rs:131 — crates/dim-cli/src/model/shell.rs:131-135 | crates/dim-cli/src/model/shell.rs:205-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/model/shell.rs:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/dim-cli/src/ui/tui.rs:6340 — crates/dim-cli/src/ui/tui.rs:6340-6344 | crates/dim-cli/src/ui/tui.rs:6392-6396 — both copies are in the same file, so extract the block into 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/dim-cli/src/update/staged.rs:250 — crates/dim-cli/src/update/staged.rs:250-254 | crates/dim-cli/src/update/staged.rs:349-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · App · ×14
  • App::apply (cyclomatic 182) crates/dim-cli/src/ui/tui.rs:2247 — App::apply has cyclomatic complexity 182 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::frame (cyclomatic 160) crates/dim-cli/src/ui/tui.rs:5696 — App::frame has cyclomatic complexity 160 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::apply_effect (cyclomatic 96) crates/dim-cli/src/ui/tui.rs:3960 — App::apply_effect has cyclomatic complexity 96 (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.
  • App::handle_input (cyclomatic 76) crates/dim-cli/src/ui/tui.rs:3095 — App::handle_input has cyclomatic complexity 76 (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.
  • App::run_command (cyclomatic 71) crates/dim-cli/src/ui/tui.rs:5313 — App::run_command has cyclomatic complexity 71 (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.
  • App::composer_key (cyclomatic 61) crates/dim-cli/src/ui/tui.rs:3267 — App::composer_key has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::transcript (cyclomatic 60) crates/dim-cli/src/ui/tui.rs:6745 — App::transcript has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::tick_at (cyclomatic 36) crates/dim-cli/src/ui/tui.rs:2103 — App::tick_at 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.
  • App::setting (cyclomatic 23) crates/dim-cli/src/ui/tui.rs:4826 — App::setting 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.
  • App::click (cyclomatic 22) crates/dim-cli/src/ui/tui.rs:7521 — App::click 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.
  • App::thought_frames (cyclomatic 20) crates/dim-cli/src/ui/tui.rs:6663 — App::thought_frames 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.
  • App::sync_tool_origins (cyclomatic 19) crates/dim-cli/src/ui/tui.rs:4491 — App::sync_tool_origins 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.
  • App::refresh_excerpts (cyclomatic 16) crates/dim-cli/src/ui/tui.rs:6466 — App::refresh_excerpts 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.
  • App::project_member (cyclomatic 16) crates/dim-cli/src/ui/tui.rs:6572 — App::project_member 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 · dim_migration · ×14
  • dim_migration::settings::permissions::import (cyclomatic 43) crates/dim-migration/src/settings/permissions.rs:41 — dim_migration::settings::permissions::import has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_migration::accounts::import (cyclomatic 37) crates/dim-migration/src/accounts.rs:57 — dim_migration::accounts::import 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.
  • dim_migration::settings::import (cyclomatic 33) crates/dim-migration/src/settings.rs:197 — dim_migration::settings::import 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.
  • dim_migration::accounts::import_mcp (cyclomatic 32) crates/dim-migration/src/accounts.rs:212 — dim_migration::accounts::import_mcp has cyclomatic complexity 32 (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.
  • dim_migration::scheduler::recurrence (cyclomatic 30) crates/dim-migration/src/scheduler.rs:132 — dim_migration::scheduler::recurrence has cyclomatic complexity 30 (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.
  • dim_migration::engine::session (cyclomatic 29) crates/dim-migration/src/engine.rs:253 — dim_migration::engine::session 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.
  • dim_migration::native::validate_settings (cyclomatic 23) crates/dim-migration/src/native.rs:887 — dim_migration::native::validate_settings has cyclomatic complexity 23 (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.
  • dim_migration::inventory::inspect (cyclomatic 21) crates/dim-migration/src/inventory.rs:26 — dim_migration::inventory::inspect 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.
  • dim_migration::native::history (cyclomatic 21) crates/dim-migration/src/native.rs:606 — dim_migration::native::history 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.
  • dim_migration::scheduler::import (cyclomatic 21) crates/dim-migration/src/scheduler.rs:10 — dim_migration::scheduler::import 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.
  • dim_migration::providers::import (cyclomatic 20) crates/dim-migration/src/providers.rs:70 — dim_migration::providers::import 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.
  • dim_migration::settings::web::import (cyclomatic 20) crates/dim-migration/src/settings/web.rs:6 — dim_migration::settings::web::import 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.
  • dim_migration::source::validate_context (cyclomatic 18) crates/dim-migration/src/source.rs:1157 — dim_migration::source::validate_context 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.
  • dim_migration::settings::file_fill (cyclomatic 17) crates/dim-migration/src/settings.rs:82 — dim_migration::settings::file_fill 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.
D2 · Cognitive Complexity · dim_migration · ×14
  • dim_migration::accounts::import (cognitive 80) crates/dim-migration/src/accounts.rs:57 — dim_migration::accounts::import has cognitive complexity 80 (threshold 15). Drivers by points: if/else 17 (55 pts), boolean chains 16, match/switch 1 (5 pts), loops 2 (4 pts) (nesting depth added 44). 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.
  • dim_migration::providers::import (cognitive 72) crates/dim-migration/src/providers.rs:70 — dim_migration::providers::import has cognitive complexity 72 (threshold 15). Drivers by points: if/else 17 (66 pts), loops 2 (3 pts), match/switch 1 (3 pts) (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.
  • dim_migration::settings::permissions::import (cognitive 67) crates/dim-migration/src/settings/permissions.rs:41 — dim_migration::settings::permissions::import has cognitive complexity 67 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 10, loops 6 (8 pts), match/switch 2 (5 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.
  • dim_migration::engine::session (cognitive 59) crates/dim-migration/src/engine.rs:253 — dim_migration::engine::session has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 8 (15 pts), match/switch 2 (7 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.
  • dim_migration::settings::import (cognitive 56) crates/dim-migration/src/settings.rs:197 — dim_migration::settings::import has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 4 (11 pts), match/switch 5 (11 pts), boolean chains 3 (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.
  • dim_migration::native::history (cognitive 47) crates/dim-migration/src/native.rs:606 — dim_migration::native::history has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 5 (12 pts), match/switch 4 (12 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.
  • dim_migration::scheduler::import (cognitive 45) crates/dim-migration/src/scheduler.rs:10 — dim_migration::scheduler::import has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (35 pts), match/switch 2 (5 pts), loops 3 (4 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.
  • dim_migration::accounts::import_mcp (cognitive 34) crates/dim-migration/src/accounts.rs:212 — dim_migration::accounts::import_mcp has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 16, 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.
  • dim_migration::inventory::inspect (cognitive 34) crates/dim-migration/src/inventory.rs:26 — dim_migration::inventory::inspect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5, 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.
  • dim_migration::source::validate_context (cognitive 30) crates/dim-migration/src/source.rs:1157 — dim_migration::source::validate_context has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (6 pts), boolean chains 4, loops 2 (4 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.
  • dim_migration::scheduler::recurrence (cognitive 25) crates/dim-migration/src/scheduler.rs:132 — dim_migration::scheduler::recurrence has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, loops 2 (3 pts), match/switch 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.
  • dim_migration::native::validate_settings (cognitive 24) crates/dim-migration/src/native.rs:887 — dim_migration::native::validate_settings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 9, match/switch 2 (3 pts) (nesting depth added 7). 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.
  • dim_migration::settings::web::import (cognitive 22) crates/dim-migration/src/settings/web.rs:6 — dim_migration::settings::web::import has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 2, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_migration::settings::file_fill (cognitive 17) crates/dim-migration/src/settings.rs:82 — dim_migration::settings::file_fill has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (5 pts), boolean chains 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×14
  • Duplicated block (13 lines × 2) crates/dim-agent-capabilities/src/environment_clients.rs:252 — crates/dim-agent-capabilities/src/environment_clients.rs:252-264 | crates/dim-agent-capabilities/src/execution_settings/prompt.rs:247-259 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/environment_clients.rs:252` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/dim-agent-capabilities/src/model_provider.rs:283 — crates/dim-agent-capabilities/src/model_provider.rs:283-295 | crates/dim-agent-capabilities/src/tool_executor.rs:1063-1075 — before extracting anything, compare `crates/dim-agent-capabilities/src/model_provider.rs` and `crates/dim-agent-capabilities/src/tool_executor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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 `crates/dim-agent-capabilities/src/model_provider.rs:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/dim-agent-capabilities/src/recall/search.rs:333 — crates/dim-agent-capabilities/src/recall/search.rs:333-345 | crates/dim-agent-capabilities/src/recall/search.rs:763-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/dim-agent-capabilities/src/recall/search.rs:376 — crates/dim-agent-capabilities/src/recall/search.rs:376-388 | crates/dim-agent-capabilities/src/recall/search.rs:800-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/dim-agent-capabilities/src/timeline_tree/read.rs:40 — crates/dim-agent-capabilities/src/timeline_tree/read.rs:40-52 | crates/dim-agent-capabilities/src/timeline_tree/read.rs:85-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree/read.rs:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/files.rs:744 — crates/dim-agent-capabilities/src/workspace_tools/files.rs:744-756 | crates/dim-agent-capabilities/src/workspace_tools/files.rs:816-828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/files.rs:744` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/dim-agent-questions/src/lib.rs:567 — crates/dim-agent-questions/src/lib.rs:567-579 | crates/dim-app-server/src/agents/configuration.rs:50-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-questions/src/lib.rs:567` 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/dim-agent-scheduler/src/loops.rs:813 — crates/dim-agent-scheduler/src/loops.rs:813-825 | crates/dim-agent-scheduler/src/loops.rs:831-843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) crates/dim-app-server/src/connection/tree.rs:1497 — crates/dim-app-server/src/connection/tree.rs:1497-1509 | crates/dim-app-server/src/connection/tree.rs:1589-1601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/connection/tree.rs:1497` 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/dim-app-server/src/hooks_settings.rs:455 — crates/dim-app-server/src/hooks_settings.rs:455-467 | crates/dim-app-server/src/mcp/face.rs:70-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/hooks_settings.rs:455` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/dim-app-server/src/storage/query.rs:1326 — crates/dim-app-server/src/storage/query.rs:1326-1338 | crates/dim-app-server/src/storage/query.rs:1351-1363 — both copies are in the same file, so extract the block into 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) REDACTED:918 — REDACTED:918-930 | crates/dim-cli/src/client.rs:303-315 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&std::path::Path` in one and `&Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) crates/dim-cli/src/goal.rs:125 — crates/dim-cli/src/goal.rs:125-137 | crates/dim-cli/src/loop_command.rs:157-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-cli/src/goal.rs:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) xtask/src/scenario_eval.rs:4715 — xtask/src/scenario_eval.rs:4715-4727 | xtask/src/scenario_eval.rs:4811-4823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/src/scenario_eval.rs:4715` 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 · Worker · ×13
  • Worker::command (cyclomatic 173) crates/dim-cli/src/session_host.rs:1285 — Worker::command has cyclomatic complexity 173 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Worker::message (cyclomatic 52) crates/dim-cli/src/session_host.rs:2671 — Worker::message 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.
  • Worker::member_reply (cyclomatic 41) crates/dim-cli/src/session_host/member.rs:409 — Worker::member_reply has cyclomatic complexity 41 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • Worker::reply (cyclomatic 38) crates/dim-cli/src/session_host.rs:4340 — Worker::reply 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.
  • Worker::task_history_reply (cyclomatic 34) crates/dim-cli/src/session_host/tasks.rs:438 — Worker::task_history_reply 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.
  • Worker::poll_member (cyclomatic 33) crates/dim-cli/src/session_host/member.rs:219 — Worker::poll_member 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.
  • Worker::poll_task_history (cyclomatic 30) crates/dim-cli/src/session_host/tasks.rs:280 — Worker::poll_task_history 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.
  • Worker::apply_inventory (cyclomatic 29) crates/dim-cli/src/session_host/inventory.rs:22 — Worker::apply_inventory 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.
  • Worker::fold (cyclomatic 24) crates/dim-cli/src/session_host.rs:4620 — Worker::fold has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • Worker::enter (cyclomatic 18) crates/dim-cli/src/session_host.rs:921 — Worker::enter 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.
  • Worker::provider_action (cyclomatic 18) crates/dim-cli/src/session_host.rs:3447 — Worker::provider_action 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.
  • Worker::start_session (cyclomatic 17) crates/dim-cli/src/session_host.rs:818 — Worker::start_session 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.
  • Worker::run (cyclomatic 16) crates/dim-app-server/src/mcp/publication.rs:261 — Worker::run 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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×13
  • Edited copy of a member (9 corresponding lines) crates/dim-cli/src/update/staged.rs:249 — crates/dim-cli/src/update/staged.rs:249-260 | crates/dim-cli/src/update/staged.rs:348-356 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-agent-scheduler/src/loops.rs:507 — crates/dim-agent-scheduler/src/loops.rs:507-519 | crates/dim-agent-scheduler/src/wakeups.rs:265-273 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-app-server/src/agents/sessions.rs:816 — crates/dim-app-server/src/agents/sessions.rs:816-824 | crates/dim-event-hub/src/bridge.rs:65-73 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:1925 — crates/dim-agent-capabilities/src/file_storage.rs:1925-1933 | crates/dim-agent-capabilities/src/file_storage/windows.rs:351-367 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-app-server/src/settings/declared.rs:293 — crates/dim-app-server/src/settings/declared.rs:293-301 | crates/dim-app-server/src/storage/metadata.rs:316-324 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-cli/src/modality/mod.rs:122 — crates/dim-cli/src/modality/mod.rs:122-130 | crates/dim-cli/src/realtime_command.rs:16-27 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-cli/src/ui/terminal/unix.rs:227 — crates/dim-cli/src/ui/terminal/unix.rs:227-235 | crates/dim-cli/src/ui/terminal/windows.rs:343-351 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:2123 — crates/dim-agent-capabilities/src/file_storage.rs:2123-2139 | crates/dim-agent-capabilities/src/file_storage.rs:2140-2148 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-cli/src/management/hooks.rs:75 — crates/dim-cli/src/management/hooks.rs:75-83 | crates/dim-cli/src/model/session.rs:715-723 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-app-server/src/managed_oauth.rs:945 — crates/dim-app-server/src/managed_oauth.rs:945-953 | crates/dim-app-server/src/managed_oauth.rs:954-962 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-agent-capabilities/src/prompt_sources.rs:143 — crates/dim-agent-capabilities/src/prompt_sources.rs:143-151 | crates/dim-agent-capabilities/src/skills/install.rs:99-107 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-agent-capabilities/src/tool_binding.rs:180 — crates/dim-agent-capabilities/src/tool_binding.rs:180-191 | crates/dim-agent-capabilities/src/tool_binding.rs:211-219 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dim-goal/src/branch.rs:199 — crates/dim-goal/src/branch.rs:199-209 | crates/dim-app-server/src/collaboration.rs:3519-3527 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×13
  • Edited copy of a member (8 corresponding lines) crates/dim-app-server/src/managed_oauth.rs:431 — crates/dim-app-server/src/managed_oauth.rs:431-438 | crates/dim-app-server/src/managed_oauth.rs:441-448 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) xtask/src/summary_eval.rs:1750 — xtask/src/summary_eval.rs:1750-1759 | xtask/src/summary_eval.rs:1763-1770 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/execution_settings/prompt.rs:36 — crates/dim-agent-capabilities/src/execution_settings/prompt.rs:36-43 | crates/dim-agent-capabilities/src/skills/mod.rs:123-130 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/shell_session.rs:727 — crates/dim-agent-capabilities/src/shell_session.rs:727-737 | crates/dim-agent-capabilities/src/shell_session.rs:1407-1414 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:440 — crates/dim-agent-capabilities/src/file_storage.rs:440-447 | crates/dim-agent-capabilities/src/file_storage.rs:549-557 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:1405 — crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:1405-1412 | crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:1414-1421 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-runtime/src/config.rs:420 — crates/dim-agent-runtime/src/config.rs:420-430 | crates/dim-app-server/src/control.rs:67-74 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) REDACTED:2430 — REDACTED:2430-2438 | crates/dim-app-server/src/storage/reclaim.rs:277-284 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/environment_clients.rs:220 — crates/dim-agent-capabilities/src/environment_clients.rs:220-227 | crates/dim-app-server/src/collaboration.rs:3505-3513 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/environment_clients.rs:233 — crates/dim-agent-capabilities/src/environment_clients.rs:233-240 | crates/dim-agent-capabilities/src/permission.rs:851-859 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-capabilities/src/hooks/runner.rs:1020 — crates/dim-agent-capabilities/src/hooks/runner.rs:1020-1028 | crates/dim-agent-capabilities/src/tool_registry.rs:895-902 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-agent-questions/src/lib.rs:532 — crates/dim-agent-questions/src/lib.rs:532-539 | crates/dim-goal/src/session.rs:50-58 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/dim-app-server/src/ui_extensions/mod.rs:432 — crates/dim-app-server/src/ui_extensions/mod.rs:432-439 | xtask/src/scenario_eval.rs:5359-5366 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
IC1 · Incompleteness & stubs · Empty method body · ×13
  • Empty method body — does nothing with its inputs crates/dim-agent-aimux/src/request.rs:969 — `warn_dropped` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-agent-capabilities/src/approval.rs:484 — `cancelled` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-agent-capabilities/src/shell_session.rs:890 — `settle` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-app-server/src/runtime_manager.rs:687 — `changed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/mcp_command.rs:226 — `restart` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/session_host.rs:164 — `send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/session_host.rs:4883 — `send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/ui/composer/history.rs:122 — `write` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/ui/isolation_panel.rs:123 — `paste` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/ui/render/fullscreen.rs:2287 — `push_move` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/ui/render/screen.rs:808 — `push_move` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-cli/src/update/staged.rs:75 — `finished` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/dim-modality/src/engine.rs:710 — `record_confined` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
D1 · Cyclomatic Complexity · xtask · ×12
  • xtask::scenario_eval::drive (cyclomatic 62) xtask/src/scenario_eval.rs:4538 — xtask::scenario_eval::drive 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.
  • xtask::prompt_eval::report (cyclomatic 48) xtask/src/prompt_eval.rs:1815 — xtask::prompt_eval::report 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.
  • xtask::prompt_eval::drive (cyclomatic 42) xtask/src/prompt_eval.rs:481 — xtask::prompt_eval::drive 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.
  • xtask::scenario_eval::preflight_checks (cyclomatic 42) xtask/src/scenario_eval.rs:3082 — xtask::scenario_eval::preflight_checks has cyclomatic complexity 42 (threshold 15). Of this number, 38 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • xtask::scenario_eval::into_scenario (cyclomatic 36) xtask/src/scenario_eval.rs:1833 — xtask::scenario_eval::into_scenario 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.
  • xtask::prompt_eval::replay_one (cyclomatic 24) xtask/src/prompt_eval.rs:1070 — xtask::prompt_eval::replay_one 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.
  • xtask::npm::check_lock (cyclomatic 22) xtask/src/npm.rs:100 — xtask::npm::check_lock 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.
  • xtask::scenario_eval::report (cyclomatic 22) xtask/src/scenario_eval.rs:6550 — xtask::scenario_eval::report 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.
  • xtask::modules::cli_layer_violation (cyclomatic 20) xtask/src/modules.rs:584 — xtask::modules::cli_layer_violation has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • xtask::scenario_eval::preflight_session (cyclomatic 18) xtask/src/scenario_eval.rs:2931 — xtask::scenario_eval::preflight_session 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.
  • xtask::modules::generate (cyclomatic 17) xtask/src/modules.rs:61 — xtask::modules::generate 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.
  • xtask::boundaries (cyclomatic 16) xtask/src/main.rs:347 — xtask::boundaries 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 · ProviderService · ×11
  • ProviderService::query_models (cognitive 82) crates/dim-app-server/src/provider/query.rs:51 — ProviderService::query_models has cognitive complexity 82 (threshold 15). Drivers by points: if/else 25 (56 pts), loops 8 (11 pts), boolean chains 8, match/switch 3 (7 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.
  • ProviderService::management_page (cognitive 64) crates/dim-app-server/src/provider/view.rs:529 — ProviderService::management_page has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (40 pts), match/switch 4 (13 pts), boolean chains 9, loops 2 (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.
  • ProviderService::update_model_config (cognitive 54) crates/dim-app-server/src/provider/models.rs:310 — ProviderService::update_model_config has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (37 pts), match/switch 5 (11 pts), boolean chains 6 (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.
  • ProviderService::import_legacy (cognitive 49) crates/dim-app-server/src/provider/legacy.rs:609 — ProviderService::import_legacy has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 5 (21 pts), loops 2 (3 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.
  • ProviderService::startup_configuration (cognitive 37) crates/dim-app-server/src/provider/startup.rs:176 — ProviderService::startup_configuration has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 5 (8 pts), boolean chains 6, 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.
  • ProviderService::discover (cognitive 36) crates/dim-app-server/src/provider/remote.rs:49 — ProviderService::discover has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 3 (8 pts), boolean chains 3, loops 2 (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.
  • ProviderService::resolve_connection (cognitive 35) crates/dim-app-server/src/provider.rs:2741 — ProviderService::resolve_connection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 3 (7 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.
  • ProviderService::configuration_with_limits (cognitive 32) crates/dim-app-server/src/provider.rs:2377 — ProviderService::configuration_with_limits has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (8 pts), loops 3 (6 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.
  • ProviderService::update_reply (cognitive 27) crates/dim-app-server/src/provider/editing.rs:470 — ProviderService::update_reply has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, 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.
  • ProviderService::management (cognitive 22) crates/dim-app-server/src/provider/view.rs:421 — ProviderService::management has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts), 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.
  • ProviderService::static_management_info (cognitive 20) crates/dim-app-server/src/provider/view.rs:129 — ProviderService::static_management_info has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Connection · ×10
  • Connection::handle (cognitive 116) crates/dim-app-server/src/connection.rs:899 — Connection::handle has cognitive complexity 116 (threshold 15). Drivers by points: if/else 28 (54 pts), match/switch 23 (46 pts), loops 4 (11 pts), boolean chains 5 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Connection::follow (cognitive 88) crates/dim-app-server/src/connection/subscription.rs:650 — Connection::follow has cognitive complexity 88 (threshold 15). Drivers by points: if/else 22 (64 pts), match/switch 9 (18 pts), boolean chains 3, loops 3 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Connection::history (cognitive 75) crates/dim-app-server/src/connection/tree.rs:180 — Connection::history has cognitive complexity 75 (threshold 15). Drivers by points: if/else 36 (54 pts), boolean chains 11, match/switch 5 (8 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Connection::validate_call (cognitive 51) crates/dim-app-server/src/connection.rs:611 — Connection::validate_call has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 9, match/switch 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Connection::execution_session (cognitive 48) crates/dim-app-server/src/connection.rs:1426 — Connection::execution_session has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (37 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 26). 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.
  • Connection::create (cognitive 39) crates/dim-app-server/src/connection.rs:1685 — Connection::create has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 8, match/switch 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.
  • Connection::follow_mcp (cognitive 31) crates/dim-app-server/src/connection/mcp.rs:79 — Connection::follow_mcp has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (7 pts), boolean chains 2, 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.
  • Connection::submit (cognitive 30) crates/dim-app-server/src/connection/tree.rs:32 — Connection::submit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 3 (4 pts), boolean chains 3, 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.
  • Connection::dispatch (cognitive 21) crates/dim-app-server/src/connection.rs:329 — Connection::dispatch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Connection::follow_ui_extensions (cognitive 18) crates/dim-app-server/src/connection/ui_extensions.rs:7 — Connection::follow_ui_extensions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Owner · ×10
  • Owner::load_current_work (cognitive 36) crates/dim-goal/src/branch/restore.rs:44 — Owner::load_current_work has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 5 (12 pts), match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Owner::attempt (cognitive 35) crates/dim-session-title/src/lib.rs:340 — Owner::attempt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 6, match/switch 5 (6 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.
  • Owner::ingest (cognitive 23) crates/dim-goal/src/branch.rs:1057 — Owner::ingest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Owner::key_at (cognitive 22) crates/dim-goal/src/branch.rs:990 — Owner::key_at has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Owner::do_turn_end (cognitive 22) crates/dim-goal/src/branch.rs:1465 — Owner::do_turn_end has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, 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.
  • Owner::append_business (cognitive 20) crates/dim-goal/src/branch.rs:778 — Owner::append_business has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2, 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.
  • Owner::run_conclusion (cognitive 20) crates/dim-goal/src/branch.rs:1850 — Owner::run_conclusion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 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.
  • Owner::generate (cognitive 19) crates/dim-session-title/src/lib.rs:456 — Owner::generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Owner::rename (cognitive 19) crates/dim-session-title/src/lib.rs:536 — Owner::rename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, match/switch 2 (3 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.
  • Owner::rebuild (cognitive 17) crates/dim-goal/src/branch.rs:691 — Owner::rebuild has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×10
  • Duplicated block (15 lines × 2) crates/dim-agent-capabilities/src/prompt/recovery.rs:204 — crates/dim-agent-capabilities/src/prompt/recovery.rs:204-218 | crates/dim-agent-capabilities/src/prompt/recovery.rs:350-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/prompt/recovery.rs:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:704 — crates/dim-agent-capabilities/src/timeline_tree.rs:704-718 | crates/dim-agent-capabilities/src/timeline_tree.rs:1095-1109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/dim-app-server/src/pipe_client.rs:95 — crates/dim-app-server/src/pipe_client.rs:95-109 | crates/dim-app-server/src/transport.rs:215-229 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-app-server/src/pipe_client.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) crates/dim-app-server/src/plugin_manager.rs:1778 — crates/dim-app-server/src/plugin_manager.rs:1778-1792 | crates/dim-app-server/src/plugin_manager.rs:1881-1895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_manager.rs:1778` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/plugin_manager.rs:1880` calls `Some`, `clone` and `crates/dim-app-server/src/plugin_manager.rs:1777` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) crates/dim-app-server/src/provider/models.rs:127 — crates/dim-app-server/src/provider/models.rs:127-141 | crates/dim-app-server/src/provider/models.rs:175-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/models.rs:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/dim-app-server/src/transport.rs:398 — crates/dim-app-server/src/transport.rs:398-412 | crates/dim-app-server/src/transport.rs:440-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/transport.rs:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/dim-cli/src/ui/transcript/tool_group.rs:600 — crates/dim-cli/src/ui/transcript/tool_group.rs:600-614 | crates/dim-cli/src/ui/transcript/tool_group.rs:1538-1552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/transcript/tool_group.rs:600` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) xtask/src/main.rs:276 — xtask/src/main.rs:276-290 | xtask/src/plugins.rs:243-257 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/src/main.rs:276` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) crates/dim-agent-capabilities/src/context_policy.rs:855 — crates/dim-agent-capabilities/src/context_policy.rs:855-869 | crates/dim-agent-capabilities/src/context_policy.rs:888-902 — both copies are in the same file, so extract the block into 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/dim-app-server/src/codex_oauth/management.rs:91 — crates/dim-app-server/src/codex_oauth/management.rs:91-105 | crates/dim-app-server/src/grok_oauth/management.rs:72-86 — `crates/dim-app-server/src/codex_oauth/management.rs` and `crates/dim-app-server/src/grok_oauth/management.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 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/codex_oauth/management.rs:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `oauth` to `Arc<OpenAICodexOAuthService>` in one and `Arc<GrokOAuthService>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D1 · Cyclomatic Complexity · ProviderService · ×9
  • ProviderService::query_models (cyclomatic 49) crates/dim-app-server/src/provider/query.rs:51 — ProviderService::query_models has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::startup_configuration (cyclomatic 35) crates/dim-app-server/src/provider/startup.rs:176 — ProviderService::startup_configuration 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.
  • ProviderService::management_page (cyclomatic 34) crates/dim-app-server/src/provider/view.rs:529 — ProviderService::management_page 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.
  • ProviderService::update_model_config (cyclomatic 31) crates/dim-app-server/src/provider/models.rs:310 — ProviderService::update_model_config 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.
  • ProviderService::discover (cyclomatic 23) crates/dim-app-server/src/provider/remote.rs:49 — ProviderService::discover 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.
  • ProviderService::resolve_connection (cyclomatic 22) crates/dim-app-server/src/provider.rs:2741 — ProviderService::resolve_connection 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.
  • ProviderService::update_reply (cyclomatic 20) crates/dim-app-server/src/provider/editing.rs:470 — ProviderService::update_reply 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.
  • ProviderService::configuration_with_limits (cyclomatic 17) crates/dim-app-server/src/provider.rs:2377 — ProviderService::configuration_with_limits 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.
  • ProviderService::import_legacy (cyclomatic 16) crates/dim-app-server/src/provider/legacy.rs:609 — ProviderService::import_legacy 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.
D35 · Change Coupling · Change coupling · ×9
  • Change coupling: memory_timeline_store.rs ↔ REDACTED crates/dim-agent-runtime/src/memory_timeline_store.rs:1 — `crates/dim-agent-runtime/src/memory_timeline_store.rs` and `REDACTED` change together 100% of the time (13 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 13 shared commits counted here, the most recent 3 are `a43231d6` perf(storage): check an atomic batch's edge on the store port; `4fb7dedf` refactor(runtime): remove the kind page read recall emptied; `a5ec69a6` perf(runtime): read the published query with its unpublished tail — run `git show` on any of them.
  • Change coupling: connection.rs ↔ tests.rs crates/dim-app-server/src/connection.rs:1 — `crates/dim-app-server/src/connection.rs` and `crates/dim-app-server/src/methods/tests.rs` change together 67% of the time (10 of the 15 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 `d645d4e0` fix(app-server, methods): close the #1199 review's minor items; `179f0d79` feat(appserver): serve MCP Apps views through the Session connection …; `919313c9` Move the App Server's core parts to name-bound rows — run `git show` on any of them.
  • Change coupling: agent.rs ↔ timeline_context.rs crates/dim-agent-runtime/src/agent.rs:1 — `crates/dim-agent-runtime/src/agent.rs` and `crates/dim-agent-runtime/src/timeline_context.rs` change together 63% of the time (12 of the 19 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 12 shared commits counted here, the most recent 3 are `0729d66a` fix(app-server): bind a submit's warnings to the input it wrote; `c55e736e` feat(runtime): commit several inputs as one batch; `6cd094e0` perf(query): read and position single events through the query — run `git show` on any of them.
  • Change coupling: ComposerPanel.vue ↔ chat.ts web/src/features/chat/ComposerPanel.vue:1 — `web/src/features/chat/ComposerPanel.vue` and `web/src/stores/chat.ts` change together 60% of the time (6 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 6 shared commits counted here, the most recent 3 are `d196275c` fix(web): recall a queued message's own content in the order it was w…; `fb83e755` feat(web): steer a draft into the running turn by default; `45a9442d` feat(web): offer, fill and draw the /skill:<name> token — run `git show` on any of them.
  • Change coupling: session_host.rs ↔ settings_panel.rs crates/dim-cli/src/session_host.rs:1 — `crates/dim-cli/src/session_host.rs` and `crates/dim-cli/src/ui/settings_panel.rs` change together 59% of the time (10 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 10 shared commits counted here, the most recent 3 are `61ad7947` fix(cli): settle a prompt write only by its own reply; `fe436e5e` fix(app-server): reserve prompt overrides for clients and ungate the …; `52e234b9` feat(cli): enter prompt overrides from /settings and dimcode prompt — run `git show` on any of them.
  • Change coupling: plugin.rs ↔ provider.rs crates/dim-agent-aimux/src/plugin.rs:1 — `crates/dim-agent-aimux/src/plugin.rs` and `crates/dim-app-server/src/provider.rs` change together 58% of the time (7 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 7 shared commits counted here, the most recent 3 are `c7c1d104` refactor: limit host port data faces to five read services; `b861e4c9` fix(provider): enforce modality request credential boundaries; `ce373639` feat(capabilities): serve the modality connection as an operation face — run `git show` on any of them.
  • Change coupling: branch.rs ↔ timeline_store.rs crates/dim-agent-runtime/src/branch.rs:1 — `crates/dim-agent-runtime/src/branch.rs` and `crates/dim-agent-runtime/src/timeline_store.rs` change together 58% of the time (7 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 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 7 shared commits counted here, the most recent 3 are `ceb35d64` perf(query): one query carries its bound and its cutoff; `a43231d6` perf(storage): check an atomic batch's edge on the store port; `8a69d89a` perf(query): fold the context projection through the event query — run `git show` on any of them.
  • Change coupling: ChatPage.vue ↔ read.ts web/src/features/chat/ChatPage.vue:1 — `web/src/features/chat/ChatPage.vue` and `web/src/rpc/read.ts` change together 54% of the time (7 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 7 shared commits counted here, the most recent 3 are `fb83e755` feat(web): steer a draft into the running turn by default; `45a9442d` feat(web): offer, fill and draw the /skill:<name> token; `eda241e5` fix(migration): restore legacy session classification — run `git show` on any of them.
  • Change coupling: chrome.rs ↔ tasks_panel.rs crates/dim-cli/src/ui/i18n/zh_cn/chrome.rs:1 — `crates/dim-cli/src/ui/i18n/zh_cn/chrome.rs` and `crates/dim-cli/src/ui/tasks_panel.rs` change together 53% of the time (8 of the 15 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 `0b5530d4` fix(cli): render, order and restore subagent tasks; show a member ful…; `9f8872f3` fix(cli): a stop is not a failure; `1a191d41` feat(tui): show Workflow runs in the task panel (#264) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×9
  • Edited copy of a member (15 corresponding lines) crates/dim-app-server/src/settings/workflow_files.rs:187 — crates/dim-app-server/src/settings/workflow_files.rs:187-201 | crates/dim-app-server/src/settings/workflow_files.rs:236-254 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:867 — crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:867-881 | crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:882-896 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-capabilities/src/model_provider.rs:595 — crates/dim-agent-capabilities/src/model_provider.rs:595-609 | crates/dim-agent-capabilities/src/prompt_suggestion.rs:515-529 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-modality-aimux/src/lib.rs:634 — crates/dim-modality-aimux/src/lib.rs:634-649 | crates/dim-modality-aimux/src/lib.rs:651-665 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-capabilities/src/host_platform.rs:180 — crates/dim-agent-capabilities/src/host_platform.rs:180-194 | xtask/src/scenario_eval.rs:3756-3770 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-capabilities/src/file_storage/windows.rs:147 — crates/dim-agent-capabilities/src/file_storage/windows.rs:147-161 | crates/dim-agent-capabilities/src/file_storage/windows.rs:301-315 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-scheduler/src/loops.rs:368 — crates/dim-agent-scheduler/src/loops.rs:368-384 | crates/dim-agent-scheduler/src/wakeups.rs:206-220 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-capabilities/src/host.rs:1003 — crates/dim-agent-capabilities/src/host.rs:1003-1017 | crates/dim-agent-capabilities/src/host.rs:1027-1041 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/dim-agent-capabilities/src/environment_clients.rs:197 — crates/dim-agent-capabilities/src/environment_clients.rs:197-211 | crates/dim-agent-capabilities/src/execution_settings/prompt.rs:63-77 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · Connection · ×8
  • Connection::handle (cyclomatic 117) crates/dim-app-server/src/connection.rs:899 — Connection::handle has cyclomatic complexity 117 (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.
  • Connection::validate_call (cyclomatic 64) crates/dim-app-server/src/connection.rs:611 — Connection::validate_call 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.
  • Connection::history (cyclomatic 48) crates/dim-app-server/src/connection/tree.rs:180 — Connection::history 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.
  • Connection::follow (cyclomatic 41) crates/dim-app-server/src/connection/subscription.rs:650 — Connection::follow 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.
  • Connection::execution_session (cyclomatic 34) crates/dim-app-server/src/connection.rs:1426 — Connection::execution_session 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.
  • Connection::create (cyclomatic 34) crates/dim-app-server/src/connection.rs:1685 — Connection::create has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Connection::submit (cyclomatic 18) crates/dim-app-server/src/connection/tree.rs:32 — Connection::submit 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.
  • Connection::follow_mcp (cyclomatic 17) crates/dim-app-server/src/connection/mcp.rs:79 — Connection::follow_mcp 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 · Gateway · ×8
  • Gateway::work (cognitive 390) crates/dim-acp/src/gateway.rs:1224 — Gateway::work has cognitive complexity 390 (threshold 15). Drivers by points: if/else 92 (254 pts), loops 24 (81 pts), match/switch 15 (33 pts), boolean chains 22 (nesting depth added 237). 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.
  • Gateway::request (cognitive 199) crates/dim-acp/src/gateway.rs:454 — Gateway::request has cognitive complexity 199 (threshold 15). Drivers by points: if/else 75 (147 pts), match/switch 20 (33 pts), boolean chains 19 (nesting depth added 85). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Gateway::notice (cognitive 64) crates/dim-acp/src/gateway.rs:2040 — Gateway::notice has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (46 pts), loops 3 (9 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Gateway::event_notice (cognitive 32) crates/dim-acp/src/gateway.rs:2439 — Gateway::event_notice has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 3 (5 pts), match/switch 2 (3 pts), boolean chains 2 (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.
  • Gateway::fail_connection (cognitive 28) crates/dim-acp/src/gateway.rs:2247 — Gateway::fail_connection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (8 pts), 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.
  • Gateway::restore (cognitive 25) crates/dim-acp/src/gateway.rs:2369 — Gateway::restore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Gateway::lost (cognitive 24) crates/dim-acp/src/gateway.rs:2314 — Gateway::lost has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Gateway::run (cognitive 23) crates/dim-acp/src/gateway.rs:2681 — Gateway::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dim_agent_aimux · ×8
  • dim_agent_aimux::request::native::apply (cognitive 175) crates/dim-agent-aimux/src/request/native.rs:206 — dim_agent_aimux::request::native::apply has cognitive complexity 175 (threshold 15). Drivers by points: if/else 64 (139 pts), boolean chains 23, match/switch 5 (11 pts), loops 1 (2 pts) (nesting depth added 82). 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.
  • dim_agent_aimux::stream::convert (cognitive 136) crates/dim-agent-aimux/src/stream.rs:28 — dim_agent_aimux::stream::convert has cognitive complexity 136 (threshold 15). Drivers by points: if/else 31 (92 pts), match/switch 15 (36 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_aimux::request::reasoning::apply (cognitive 76) crates/dim-agent-aimux/src/request/reasoning.rs:18 — dim_agent_aimux::request::reasoning::apply has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (54 pts), loops 5 (10 pts), match/switch 4 (8 pts), boolean chains 4 (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.
  • dim_agent_aimux::request::convert (cognitive 56) crates/dim-agent-aimux/src/request.rs:49 — dim_agent_aimux::request::convert has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 12, loops 4 (7 pts), match/switch 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_aimux::request::tool_result (cognitive 29) crates/dim-agent-aimux/src/request.rs:654 — dim_agent_aimux::request::tool_result has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 3 (6 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.
  • dim_agent_aimux::request::continuation (cognitive 24) crates/dim-agent-aimux/src/request.rs:809 — dim_agent_aimux::request::continuation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_agent_aimux::recording::redact_option_headers (cognitive 18) crates/dim-agent-aimux/src/recording.rs:20 — dim_agent_aimux::recording::redact_option_headers has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (8 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • dim_agent_aimux::recording::redact_provider_options (cognitive 16) crates/dim-agent-aimux/src/recording.rs:45 — dim_agent_aimux::recording::redact_provider_options has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Projection · ×8
  • Projection::load (cognitive 124) crates/dim-agent-capabilities/src/prompt/recovery.rs:946 — Projection::load has cognitive complexity 124 (threshold 15). Drivers by points: if/else 33 (76 pts), loops 11 (24 pts), boolean chains 12, match/switch 3 (12 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Projection::fold (cognitive 84) crates/dim-cli/src/projection.rs:204 — Projection::fold has cognitive complexity 84 (threshold 15). Drivers by points: if/else 24 (52 pts), match/switch 8 (15 pts), loops 5 (14 pts), boolean chains 3 (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.
  • Projection::event (cognitive 70) crates/dim-acp/src/projection.rs:216 — Projection::event has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (47 pts), match/switch 5 (13 pts), loops 4 (9 pts), boolean chains 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.
  • Projection::refresh (cognitive 45) crates/dim-app-server/src/mcp/publication.rs:443 — Projection::refresh has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 5 (11 pts), loops 3 (7 pts), boolean chains 6 (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.
  • Projection::acquire (cognitive 24) crates/dim-app-server/src/mcp/publication.rs:666 — Projection::acquire has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 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.
  • Projection::apply (cognitive 18) crates/dim-agent-capabilities/src/prompt/recovery.rs:640 — Projection::apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Projection::step (cognitive 17) crates/dim-agent-capabilities/src/prompt/recovery.rs:815 — Projection::step has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Projection::lines (cognitive 16) crates/dim-cli/src/projection.rs:120 — Projection::lines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 pts) (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 · CollaborationSession · ×8
  • CollaborationSession::read (cognitive 65) crates/dim-app-server/src/collaboration.rs:1464 — CollaborationSession::read has cognitive complexity 65 (threshold 15). Drivers by points: match/switch 11 (26 pts), if/else 8 (23 pts), loops 6 (15 pts), boolean chains 1 (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.
  • CollaborationSession::approval_event (cognitive 52) crates/dim-app-server/src/collaboration/approvals.rs:455 — CollaborationSession::approval_event has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 6 (12 pts), boolean chains 6, match/switch 2 (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.
  • CollaborationSession::run (cognitive 23) crates/dim-app-server/src/collaboration.rs:1039 — CollaborationSession::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 6 (8 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.
  • CollaborationSession::request (cognitive 23) crates/dim-app-server/src/collaboration.rs:2090 — CollaborationSession::request has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, match/switch 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.
  • CollaborationSession::interrupt (cognitive 21) crates/dim-app-server/src/collaboration.rs:1682 — CollaborationSession::interrupt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 3, match/switch 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.
  • CollaborationSession::unload (cognitive 21) crates/dim-app-server/src/collaboration.rs:2603 — CollaborationSession::unload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2, 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.
  • CollaborationSession::dispatch (cognitive 19) crates/dim-app-server/src/collaboration.rs:1778 — CollaborationSession::dispatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 8 (9 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • CollaborationSession::forward_approval (cognitive 18) crates/dim-app-server/src/collaboration/approvals.rs:199 — CollaborationSession::forward_approval has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×8
  • Edited copy of a member (11 corresponding lines) crates/dim-cli/src/ui/transcript/tool_group.rs:1293 — crates/dim-cli/src/ui/transcript/tool_group.rs:1293-1306 | crates/dim-cli/src/ui/transcript/tool_group.rs:1577-1587 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-cli/src/ui/language_panel.rs:57 — crates/dim-cli/src/ui/language_panel.rs:57-67 | crates/dim-cli/src/ui/theme_panel.rs:58-71 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-app-server/src/web.rs:158 — crates/dim-app-server/src/web.rs:158-168 | crates/dim-report/src/lib.rs:37-47 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-cli/src/modality/ocr.rs:167 — crates/dim-cli/src/modality/ocr.rs:167-177 | crates/dim-cli/src/modality/ocr.rs:208-218 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-app-server/src/web/content.rs:322 — crates/dim-app-server/src/web/content.rs:322-335 | crates/dim-app-server/src/web/content.rs:547-557 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-agent-capabilities/src/prompt_suggestion.rs:334 — crates/dim-agent-capabilities/src/prompt_suggestion.rs:334-344 | crates/dim-app-server/src/plugin_files.rs:463-477 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-agent-scheduler/src/methods.rs:476 — crates/dim-agent-scheduler/src/methods.rs:476-488 | crates/dim-event-hub/src/management.rs:26-36 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/dim-agent-aimux/src/config.rs:18 — crates/dim-agent-aimux/src/config.rs:18-33 | crates/dim-agent-capabilities/src/prompt_sources.rs:283-293 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×8
  • Edited copy of a member (6 corresponding lines) crates/dim-goal/src/text.rs:741 — crates/dim-goal/src/text.rs:741-747 | crates/dim-cli/src/projection.rs:2082-2087 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-agent-capabilities/src/input_queue/recovery.rs:42 — crates/dim-agent-capabilities/src/input_queue/recovery.rs:42-51 | crates/dim-agent-capabilities/src/prompt/recovery.rs:100-105 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-agent-capabilities/src/skills/install.rs:110 — crates/dim-agent-capabilities/src/skills/install.rs:110-115 | crates/dim-app-server/src/plugin_manager/acquire.rs:314-319 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-agent-scheduler/src/testing.rs:135 — crates/dim-agent-scheduler/src/testing.rs:135-140 | crates/dim-app-server/src/managed_provider.rs:375-381 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-agent-capabilities/src/host_platform.rs:1304 — crates/dim-agent-capabilities/src/host_platform.rs:1304-1310 | crates/dim-cli/src/management/mod.rs:47-52 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-agent-types/src/markup.rs:11 — crates/dim-agent-types/src/markup.rs:11-17 | crates/dim-goal/src/text.rs:46-51 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-cli/src/model/shell.rs:118 — crates/dim-cli/src/model/shell.rs:118-123 | crates/dim-cli/src/wire.rs:279-285 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/dim-migration/src/providers.rs:33 — crates/dim-migration/src/providers.rs:33-38 | crates/dim-migration/src/source.rs:1104-1112 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×8
  • Duplicated block (17 lines × 2) crates/dim-agent-capabilities/src/hooks/runner.rs:1383 — crates/dim-agent-capabilities/src/hooks/runner.rs:1383-1399 | crates/dim-agent-capabilities/src/hooks/runner.rs:1542-1558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/hooks/runner.rs:1383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:202 — crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:202-218 | crates/dim-cli/src/ui/composer/mentions.rs:200-216 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs` and `crates/dim-cli/src/ui/composer/mentions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:202` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/dim-agent-runtime/src/timeline_context.rs:500 — crates/dim-agent-runtime/src/timeline_context.rs:500-516 | crates/dim-agent-runtime/src/timeline_context.rs:536-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-runtime/src/timeline_context.rs:500` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) crates/dim-app-server/src/provider/models.rs:413 — crates/dim-app-server/src/provider/models.rs:413-429 | crates/dim-app-server/src/provider/models.rs:500-516 — both copies are in the same file, so extract the block into 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/dim-app-server/src/plugin_manager.rs:1754 — crates/dim-app-server/src/plugin_manager.rs:1754-1770 | crates/dim-app-server/src/plugin_manager.rs:1858-1874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_manager.rs:1754` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/dim-app-server/src/web_entry/uploads.rs:151 — crates/dim-app-server/src/web_entry/uploads.rs:151-167 | crates/dim-app-server/src/web_entry/uploads.rs:382-398 — both copies are in the same file, so extract the block into 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/dim-oauth/src/usage.rs:110 — crates/dim-oauth/src/usage.rs:110-127 | crates/dim-oauth/src/usage.rs:129-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-oauth/src/usage.rs:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/dim-agent-capabilities/src/agent_loop.rs:877 — crates/dim-agent-capabilities/src/agent_loop.rs:877-893 | crates/dim-agent-capabilities/src/context_preparation.rs:641-657 — before extracting anything, compare `crates/dim-agent-capabilities/src/agent_loop.rs` and `crates/dim-agent-capabilities/src/context_preparation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop.rs:877` 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 · Compiler · ×7
  • Compiler::physical_filter_for (cognitive 83) crates/dim-app-server/src/storage/query.rs:933 — Compiler::physical_filter_for has cognitive complexity 83 (threshold 15). Drivers by points: if/else 26 (49 pts), match/switch 10 (17 pts), boolean chains 15, loops 1 (2 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.
  • Compiler::physical (cognitive 37) crates/dim-app-server/src/storage/query.rs:1303 — Compiler::physical has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22 (29 pts), match/switch 2 (5 pts), boolean chains 3 (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.
  • Compiler::filter (cognitive 29) crates/dim-app-server/src/storage/query.rs:509 — Compiler::filter has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (6 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Compiler::physical_relation (cognitive 29) crates/dim-app-server/src/storage/query.rs:791 — Compiler::physical_relation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 4 (8 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.
  • Compiler::inline (cognitive 22) crates/dim-app-server/src/storage/query.rs:1498 — Compiler::inline has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Compiler::text_candidate (cognitive 21) crates/dim-app-server/src/storage/query.rs:403 — Compiler::text_candidate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19 (21 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Compiler::new (cognitive 19) crates/dim-app-server/src/storage/query.rs:311 — Compiler::new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, 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.
D2 · Cognitive Complexity · dim_acp · ×7
  • dim_acp::rpc::drive (cognitive 77) crates/dim-acp/src/rpc.rs:148 — dim_acp::rpc::drive has cognitive complexity 77 (threshold 15). Drivers by points: if/else 12 (46 pts), match/switch 5 (18 pts), loops 7 (12 pts), boolean chains 1 (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.
  • dim_acp::gateway::read_history (cognitive 57) crates/dim-acp/src/gateway.rs:2761 — dim_acp::gateway::read_history has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 5 (9 pts), boolean chains 5, match/switch 1 (3 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.
  • dim_acp::auth::authenticate (cognitive 29) crates/dim-acp/src/auth.rs:135 — dim_acp::auth::authenticate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 4 (11 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_acp::lody::controls (cognitive 28) crates/dim-acp/src/lody.rs:16 — dim_acp::lody::controls has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 3 (7 pts), boolean chains 3, 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.
  • dim_acp::commands::loops (cognitive 26) crates/dim-acp/src/commands.rs:227 — dim_acp::commands::loops has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4 (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.
  • dim_acp::interaction::approval (cognitive 21) crates/dim-acp/src/interaction.rs:25 — dim_acp::interaction::approval has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 4 (9 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.
  • dim_acp::content::parse (cognitive 17) crates/dim-acp/src/content.rs:17 — dim_acp::content::parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×7
  • Edited copy of a member (14 corresponding lines) crates/dim-agent-capabilities/src/context_usage.rs:1172 — crates/dim-agent-capabilities/src/context_usage.rs:1172-1188 | crates/dim-agent-capabilities/src/context_usage.rs:1190-1203 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/dim-app-server/src/managed_oauth.rs:415 — crates/dim-app-server/src/managed_oauth.rs:415-430 | crates/dim-app-server/src/settings.rs:487-500 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/dim-agent-capabilities/src/file_access.rs:728 — crates/dim-agent-capabilities/src/file_access.rs:728-741 | crates/dim-app-server/src/worktrees.rs:1103-1116 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/dim-app-server/src/plugin_files.rs:506 — crates/dim-app-server/src/plugin_files.rs:506-522 | crates/dim-app-server/src/plugin_files.rs:527-540 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) xtask/src/scenario_eval.rs:5581 — xtask/src/scenario_eval.rs:5581-5596 | xtask/src/scenario_eval.rs:5750-5763 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/dim-agent-capabilities/src/agent_loop.rs:1816 — crates/dim-agent-capabilities/src/agent_loop.rs:1816-1829 | crates/dim-agent-capabilities/src/prompt.rs:755-768 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/dim-agent-capabilities/src/workspace_tools/files.rs:846 — crates/dim-agent-capabilities/src/workspace_tools/files.rs:846-859 | crates/dim-agent-capabilities/src/workspace_tools/files.rs:867-880 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×7
  • Edited copy of a member (12 corresponding lines) crates/dim-cli/src/update/staged.rs:648 — crates/dim-cli/src/update/staged.rs:648-659 | crates/dim-cli/src/update/staged.rs:662-684 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/dim-app-server/src/protocol.rs:1614 — crates/dim-app-server/src/protocol.rs:1614-1625 | crates/dim-app-server/src/protocol.rs:1627-1638 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/dim-agent-capabilities/src/context_preparation.rs:334 — crates/dim-agent-capabilities/src/context_preparation.rs:334-345 | crates/dim-goal/src/branch.rs:734-746 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/dim-agent-capabilities/src/context_usage.rs:82 — crates/dim-agent-capabilities/src/context_usage.rs:82-95 | crates/dim-agent-capabilities/src/context_usage.rs:99-110 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/dim-agent-capabilities/src/context_preparation.rs:1005 — crates/dim-agent-capabilities/src/context_preparation.rs:1005-1018 | crates/dim-agent-capabilities/src/hooks/runner.rs:2269-2280 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/dim-app-server/src/mcp.rs:1682 — crates/dim-app-server/src/mcp.rs:1682-1693 | crates/dim-app-server/src/mcp.rs:1700-1712 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/dim-cli/src/client.rs:91 — crates/dim-cli/src/client.rs:91-104 | crates/dim-cli/src/client.rs:109-120 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×7
  • Duplicated block (10 lines × 3) crates/dim-agent-capabilities/src/workspace_tools/pending.rs:163 — crates/dim-agent-capabilities/src/workspace_tools/pending.rs:163-172 | crates/dim-app-server/src/collaboration/pending.rs:56-65 | crates/dim-app-server/src/collaboration/pending.rs:246-255 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/pending.rs:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/dim-agent-questions/src/lib.rs:571 — crates/dim-agent-questions/src/lib.rs:571-580 | crates/dim-app-server/src/agents/configuration.rs:54-63 | crates/dim-app-server/src/hooks_settings.rs:714-723 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-questions/src/lib.rs:571` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/dim-app-server/src/mcp.rs:1592 — crates/dim-app-server/src/mcp.rs:1592-1601 | crates/dim-app-server/src/mcp.rs:1735-1744 | crates/dim-app-server/src/mcp.rs:1765-1774 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/mcp.rs:1592` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/mcp.rs:1734` calls `remove` and `crates/dim-app-server/src/mcp.rs:1764` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) crates/dim-cli/src/management/mcp.rs:517 — crates/dim-cli/src/management/mcp.rs:517-526 | crates/dim-cli/src/management/scheduler.rs:292-301 | crates/dim-cli/src/management/workflow.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 all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:1771 — crates/dim-agent-capabilities/src/workspace_tools/exec.rs:1771-1780 | crates/dim-agent-scheduler/src/methods.rs:1318-1327 | crates/dim-event-hub/src/text.rs:39-48 — 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/dim-agent-capabilities/src/context_preparation.rs:494 — crates/dim-agent-capabilities/src/context_preparation.rs:494-503 | crates/dim-agent-capabilities/src/model_provider.rs:175-184 | crates/dim-agent-capabilities/src/steer.rs:42-52 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:494` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/dim-agent-capabilities/src/timeline_tree.rs:3463 — crates/dim-agent-capabilities/src/timeline_tree.rs:3463-3472 | crates/dim-agent-capabilities/src/timeline_tree.rs:3859-3868 | crates/dim-agent-capabilities/src/tool_executor/read.rs:72-81 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:3463` 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×7
  • Outbound HTTP without resilience crates/dim-agent-aimux/src/driver.rs:284 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/dim-app-server/src/cli.rs:530 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience xtask/src/app_server.rs:214 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience xtask/src/main.rs:101 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience xtask/src/main.rs:107 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience xtask/src/main.rs:173 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience xtask/src/plugins.rs:190 — `AgentBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×7
  • Duplicated block (8 lines × 2 locations) scripts/collect-release.mjs:28 — scripts/collect-release.mjs:28 · scripts/collect-release.mjs:50 — both copies are in the same file, so extract the block into 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 locations) web/src/features/settings/DiagnosticsSettings.vue:12 — web/src/features/settings/DiagnosticsSettings.vue:12 · web/src/features/settings/ProviderAuthFlow.vue:18 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2 locations) web/src/features/settings/DiagnosticsSettings.vue:21 — web/src/features/settings/DiagnosticsSettings.vue:21 · web/src/features/settings/PermissionsSettings.vue:46 — 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 (8 lines × 2 locations) web/src/features/settings/McpSettings.vue:168 — web/src/features/settings/McpSettings.vue:168 · web/src/features/settings/ProviderModels.vue:116 — 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 (8 lines × 2 locations) web/src/features/settings/McpSettings.vue:489 — web/src/features/settings/McpSettings.vue:489 · web/src/features/settings/SkillSettings.vue:50 — 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 (8 lines × 2 locations) web/src/features/settings/PluginSettings.vue:14 — web/src/features/settings/PluginSettings.vue:14 · web/src/features/settings/ProviderSettings.vue:28 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2 locations) web/src/rpc/read.ts:161 — web/src/rpc/read.ts:161 · web/src/rpc/read.ts:432 — 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.
AC2 · Forms & labels · <fieldset> without a <legend> · ×6
  • <fieldset> without a <legend> web/src/features/settings/McpSettings.vue:602 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/settings/PermissionsSettings.vue:130 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/settings/PluginSettings.vue:81 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/settings/ProviderConnectionForm.vue:156 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/settings/ProviderModels.vue:174 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/settings/SettingsPage.vue:62 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
D1 · Cyclomatic Complexity · dim_agent_aimux · ×6
  • dim_agent_aimux::request::native::apply (cyclomatic 102) crates/dim-agent-aimux/src/request/native.rs:206 — dim_agent_aimux::request::native::apply 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.
  • dim_agent_aimux::stream::convert (cyclomatic 74) crates/dim-agent-aimux/src/stream.rs:28 — dim_agent_aimux::stream::convert has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_agent_aimux::request::reasoning::apply (cyclomatic 44) crates/dim-agent-aimux/src/request/reasoning.rs:18 — dim_agent_aimux::request::reasoning::apply has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_agent_aimux::request::convert (cyclomatic 40) crates/dim-agent-aimux/src/request.rs:49 — dim_agent_aimux::request::convert 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.
  • dim_agent_aimux::stream::content::metadata (cyclomatic 26) crates/dim-agent-aimux/src/stream/content.rs:7 — dim_agent_aimux::stream::content::metadata 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.
  • dim_agent_aimux::request::continuation (cyclomatic 23) crates/dim-agent-aimux/src/request.rs:809 — dim_agent_aimux::request::continuation 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 · Compiler · ×6
  • Compiler::physical_filter_for (cyclomatic 83) crates/dim-app-server/src/storage/query.rs:933 — Compiler::physical_filter_for has cyclomatic complexity 83 (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.
  • Compiler::filter (cyclomatic 26) crates/dim-app-server/src/storage/query.rs:509 — Compiler::filter 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.
  • Compiler::physical_relation (cyclomatic 25) crates/dim-app-server/src/storage/query.rs:791 — Compiler::physical_relation 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.
  • Compiler::physical (cyclomatic 20) crates/dim-app-server/src/storage/query.rs:1303 — Compiler::physical 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.
  • Compiler::inline (cyclomatic 20) crates/dim-app-server/src/storage/query.rs:1498 — Compiler::inline 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.
  • Compiler::new (cyclomatic 18) crates/dim-app-server/src/storage/query.rs:311 — Compiler::new 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 · Projection · ×6
  • Projection::fold (cyclomatic 67) crates/dim-cli/src/projection.rs:204 — Projection::fold has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Projection::event (cyclomatic 61) crates/dim-acp/src/projection.rs:216 — Projection::event has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Projection::load (cyclomatic 56) crates/dim-agent-capabilities/src/prompt/recovery.rs:946 — Projection::load 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.
  • Projection::refresh (cyclomatic 25) crates/dim-app-server/src/mcp/publication.rs:443 — Projection::refresh 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.
  • Projection::acquire (cyclomatic 18) crates/dim-app-server/src/mcp/publication.rs:666 — Projection::acquire 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.
  • Projection::step (cyclomatic 16) crates/dim-agent-capabilities/src/prompt/recovery.rs:815 — Projection::step 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 · CollaborationSession · ×6
  • CollaborationSession::approval_event (cyclomatic 34) crates/dim-app-server/src/collaboration/approvals.rs:455 — CollaborationSession::approval_event 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.
  • CollaborationSession::read (cyclomatic 32) crates/dim-app-server/src/collaboration.rs:1464 — CollaborationSession::read has cyclomatic complexity 32 (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.
  • CollaborationSession::run (cyclomatic 26) crates/dim-app-server/src/collaboration.rs:1039 — CollaborationSession::run 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.
  • CollaborationSession::dispatch (cyclomatic 18) crates/dim-app-server/src/collaboration.rs:1778 — CollaborationSession::dispatch 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.
  • CollaborationSession::request (cyclomatic 18) crates/dim-app-server/src/collaboration.rs:2090 — CollaborationSession::request 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.
  • CollaborationSession::interrupt (cyclomatic 17) crates/dim-app-server/src/collaboration.rs:1682 — CollaborationSession::interrupt 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 · ShellSession · ×6
  • ShellSession::ensure_shell (cognitive 29) crates/dim-agent-capabilities/src/shell_session.rs:503 — ShellSession::ensure_shell has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 9 (16 pts), if/else 5 (7 pts), loops 3 (6 pts) (nesting depth added 12). 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.
  • ShellSession::run_background (cognitive 28) crates/dim-agent-capabilities/src/shell_session.rs:1125 — ShellSession::run_background has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 4 (8 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ShellSession::stop (cognitive 28) crates/dim-agent-capabilities/src/shell_session.rs:1302 — ShellSession::stop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (4 pts), loops 1 (2 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.
  • ShellSession::handle_shell_exit (cognitive 25) crates/dim-agent-capabilities/src/shell_session.rs:814 — ShellSession::handle_shell_exit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 3 (7 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.
  • ShellSession::run_foreground (cognitive 23) crates/dim-agent-capabilities/src/shell_session.rs:897 — ShellSession::run_foreground has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ShellSession::occupied_wait (cognitive 16) crates/dim-agent-capabilities/src/shell_session.rs:448 — ShellSession::occupied_wait has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/dim-agent-capabilities/src/recall/search.rs:266 — crates/dim-agent-capabilities/src/recall/search.rs:266-427 | crates/dim-agent-capabilities/src/recall/search.rs:685-852 | crates/dim-agent-capabilities/src/recall/search.rs:884-977 | crates/dim-agent-capabilities/src/recall/search.rs:1110-1405 — 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/dim-agent-capabilities/src/shell_input.rs:687 — crates/dim-agent-capabilities/src/shell_input.rs:687-697 | crates/dim-app-server/src/mcp/auth/store.rs:290-300 | crates/dim-app-server/src/mcp/import.rs:597-607 | crates/dim-app-server/src/storage/metadata.rs:423-433 — 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/dim-agent-questions/src/lib.rs:540 — crates/dim-agent-questions/src/lib.rs:540-590 | crates/dim-app-server/src/agents/configuration.rs:42-72 | crates/dim-app-server/src/hooks_settings.rs:687-845 | crates/dim-app-server/src/skills_management.rs:626-883 — 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/dim-agent-runtime/src/agent.rs:509 — crates/dim-agent-runtime/src/agent.rs:509-517 | crates/dim-agent-runtime/src/agent.rs:524-532 | crates/dim-agent-runtime/src/agent.rs:539-547 | crates/dim-agent-runtime/src/agent.rs:556-564 — 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/dim-app-server/src/codex_oauth/management.rs:28 — crates/dim-app-server/src/codex_oauth/management.rs:28-112 | crates/dim-app-server/src/grok_oauth/management.rs:18-93 | crates/dim-app-server/src/managed_provider/management.rs:279-404 | crates/dim-app-server/src/provider/management.rs:107-365 — 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/dim-app-server/src/storage/identities.rs:71 — crates/dim-app-server/src/storage/identities.rs:71-85 | crates/dim-app-server/src/storage/identities.rs:87-101 | crates/dim-app-server/src/storage/text.rs:263-276 | crates/dim-app-server/src/storage/text.rs:280-293 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×6
  • Edited copy of a member (18 corresponding lines) crates/dim-agent-scheduler/src/engine.rs:825 — crates/dim-agent-scheduler/src/engine.rs:825-842 | crates/dim-event-hub/src/publish.rs:845-868 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) xtask/src/prompt_eval.rs:117 — xtask/src/prompt_eval.rs:117-134 | xtask/src/rule.rs:105-122 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/dim-modality/src/engine.rs:668 — crates/dim-modality/src/engine.rs:668-685 | crates/dim-modality/src/engine.rs:689-706 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/dim-cli/src/composer.rs:766 — crates/dim-cli/src/composer.rs:766-783 | crates/dim-cli/src/ui/composer/mod.rs:1425-1444 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/dim-cli/src/goal.rs:124 — crates/dim-cli/src/goal.rs:124-141 | crates/dim-cli/src/loop_command.rs:156-173 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/dim-agent-capabilities/src/host_platform.rs:1750 — crates/dim-agent-capabilities/src/host_platform.rs:1750-1767 | crates/dim-agent-capabilities/src/host_platform.rs:1796-1813 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×6
  • Duplicated block (14 lines × 2) crates/dim-agent-capabilities/src/history.rs:1452 — crates/dim-agent-capabilities/src/history.rs:1452-1465 | crates/dim-agent-runtime/src/core/timeline.rs:876-889 — before extracting anything, compare `crates/dim-agent-capabilities/src/history.rs` and `crates/dim-agent-runtime/src/core/timeline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/history.rs:1452` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/dim-agent-capabilities/src/recall/search.rs:887 — crates/dim-agent-capabilities/src/recall/search.rs:887-900 | crates/dim-agent-capabilities/src/recall/search.rs:1112-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/recall/search.rs:885` calls `as_ref`, `expect` and `crates/dim-agent-capabilities/src/recall/search.rs:1110` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:1018 — crates/dim-agent-capabilities/src/timeline_tree.rs:1018-1031 | crates/dim-agent-runtime/src/core/timeline.rs:717-730 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:1018` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `query` to `TimelineQuery` in one and `crate::TimelineQuery` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14 lines × 2) crates/dim-cli/src/client.rs:233 — crates/dim-cli/src/client.rs:233-246 | crates/dim-cli/src/client.rs:964-977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/client.rs:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/dim-app-server/src/storage/query.rs:3133 — crates/dim-app-server/src/storage/query.rs:3133-3146 | crates/dim-app-server/src/storage/query.rs:3219-3232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/storage/query.rs:3133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (14 lines × 2) crates/dim-cli/src/management/hooks.rs:120 — crates/dim-cli/src/management/hooks.rs:120-134 | crates/dim-cli/src/management/hooks.rs:149-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/management/hooks.rs: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. 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 (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) crates/dim-agent-capabilities/src/approval.rs:365 — crates/dim-agent-capabilities/src/approval.rs:365-372 | crates/dim-agent-capabilities/src/tool_executor.rs:848-855 | crates/dim-app-server/src/collaboration.rs:3709-3716 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/approval.rs:365` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/dim-agent-capabilities/src/prompt_sources.rs:375 — crates/dim-agent-capabilities/src/prompt_sources.rs:375-382 | crates/dim-agent-capabilities/src/skills/mod.rs:79-86 | crates/dim-agent-capabilities/src/summary_strategy.rs:144-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/prompt_sources.rs:375` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/dim-app-server/src/provider/models.rs:164 — crates/dim-app-server/src/provider/models.rs:164-171 | crates/dim-app-server/src/provider/models.rs:483-490 | crates/dim-app-server/src/provider/models.rs:609-616 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/models.rs:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/dim-cli/src/migration_command.rs:272 — crates/dim-cli/src/migration_command.rs:272-279 | crates/dim-cli/src/session_command.rs:321-328 | crates/dim-cli/src/worktree_command.rs:365-372 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `crates/dim-cli/src/migration_command.rs:272` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) xtask/src/main.rs:624 — xtask/src/main.rs:624-631 | xtask/src/main.rs:661-669 | xtask/src/main.rs:672-679 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) crates/dim-agent-capabilities/src/context_policy.rs:526 — crates/dim-agent-capabilities/src/context_policy.rs:526-533 | crates/dim-agent-capabilities/src/context_policy.rs:752-759 | crates/dim-agent-capabilities/src/context_policy.rs:791-798 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:526` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D6 · Cohesion (LCOM4) · Low cohesion · ×6
  • Low cohesion: ConnectionHub (LCOM4 5) crates/dim-app-server/src/connection.rs:1997 — ConnectionHub'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: HostPlatform (LCOM4 4) crates/dim-agent-capabilities/src/host_platform.rs:219 — HostPlatform'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: Holds (LCOM4 4) crates/dim-agent-scheduler/src/testing.rs:25 — Holds'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: Input (LCOM4 4) crates/dim-cli/src/input.rs:5 — Input'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: MediaAdapter (LCOM4 4) crates/dim-modality-aimux/src/lib.rs:74 — MediaAdapter'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: PdfDocument (LCOM4 4) crates/dim-ocr/src/pdf.rs:22 — PdfDocument'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.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×6
  • Duplicated block (6 lines × 2 locations) scripts/check-alpha-registry.mjs:69 — scripts/check-alpha-registry.mjs:69 · scripts/publish-npm.mjs:133 — 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 (6 lines × 2 locations) scripts/update-provider-catalog.ts:307 — scripts/update-provider-catalog.ts:307 · scripts/update-provider-catalog.ts:636 — 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) web/src/features/chat/ChatPage.vue:118 — web/src/features/chat/ChatPage.vue:118 · web/src/features/lines/LineConversation.vue:91 — 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 (6 lines × 2 locations) web/src/features/settings/AccountSettings.vue:91 — web/src/features/settings/AccountSettings.vue:91 · web/src/features/settings/ProviderSettings.vue:131 — 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 (6 lines × 2 locations) web/src/projection.ts:277 — web/src/projection.ts:277 · web/src/projection.ts:286 — 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) web/src/rpc/read.ts:998 — web/src/rpc/read.ts:998 · web/src/rpc/read.ts:1014 — 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.
D1 · Cyclomatic Complexity · Options · ×5
  • Options::parse (cyclomatic 328) REDACTED:616 — Options::parse has cyclomatic complexity 328 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Options::read_startup (cyclomatic 42) REDACTED:1892 — Options::read_startup 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.
  • Options::parse_from (cyclomatic 38) xtask/src/scenario_eval.rs:1300 — Options::parse_from has cyclomatic complexity 38 (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.
  • Options::parse_from (cyclomatic 22) xtask/src/prompt_eval.rs:181 — Options::parse_from 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.
  • Options::parse (cyclomatic 19) xtask/src/summary_eval.rs:283 — Options::parse 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.
D1 · Cyclomatic Complexity · dim_acp · ×5
  • dim_acp::rpc::drive (cyclomatic 32) crates/dim-acp/src/rpc.rs:148 — dim_acp::rpc::drive 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.
  • dim_acp::gateway::read_history (cyclomatic 30) crates/dim-acp/src/gateway.rs:2761 — dim_acp::gateway::read_history 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.
  • dim_acp::auth::authenticate (cyclomatic 21) crates/dim-acp/src/auth.rs:135 — dim_acp::auth::authenticate 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.
  • dim_acp::lody::controls (cyclomatic 21) crates/dim-acp/src/lody.rs:16 — dim_acp::lody::controls 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.
  • dim_acp::commands::goal (cyclomatic 18) crates/dim-acp/src/commands.rs:124 — dim_acp::commands::goal 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.
D2 · Cognitive Complexity · dim_agent_runtime · ×5
  • dim_agent_runtime::memory_timeline_store::query::execute (cognitive 57) crates/dim-agent-runtime/src/memory_timeline_store/query.rs:631 — dim_agent_runtime::memory_timeline_store::query::execute has cognitive complexity 57 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 10, loops 4, match/switch 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.
  • dim_agent_runtime::assembly::check_scope (cognitive 23) crates/dim-agent-runtime/src/assembly.rs:2087 — dim_agent_runtime::assembly::check_scope has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (6 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.
  • dim_agent_runtime::assembly::create_instance (cognitive 21) crates/dim-agent-runtime/src/assembly.rs:1493 — dim_agent_runtime::assembly::create_instance has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 6 (7 pts), boolean chains 1, 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.
  • dim_agent_runtime::timeline_query::properties::validate_path (cognitive 19) crates/dim-agent-runtime/src/timeline_query/properties.rs:547 — dim_agent_runtime::timeline_query::properties::validate_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 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.
  • dim_agent_runtime::assembly::build_session (cognitive 16) crates/dim-agent-runtime/src/assembly.rs:1751 — dim_agent_runtime::assembly::build_session has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 8 (13 pts), if/else 2, boolean chains 1 (nesting depth added 5). 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 · Shared · ×5
  • Shared::run_host (cognitive 49) crates/dim-modality/src/engine.rs:2128 — Shared::run_host has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (37 pts), match/switch 7 (9 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.
  • Shared::settle_files (cognitive 35) crates/dim-modality/src/engine.rs:2506 — Shared::settle_files has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 9 (19 pts), if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 17). 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.
  • Shared::submit_phase (cognitive 32) crates/dim-modality/src/engine.rs:1933 — Shared::submit_phase has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 6 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Shared::recover (cognitive 17) crates/dim-modality/src/engine.rs:1596 — Shared::recover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 6, match/switch 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.
  • Shared::wait_and_settle (cognitive 16) crates/dim-modality/src/engine.rs:2063 — Shared::wait_and_settle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceGraph · ×5
  • SourceGraph::resolve_symbols (cognitive 43) xtask/src/modules.rs:360 — SourceGraph::resolve_symbols has cognitive complexity 43 (threshold 15). Drivers by points: if/else 5 (23 pts), loops 6 (19 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SourceGraph::read_module (cognitive 33) xtask/src/modules.rs:235 — SourceGraph::read_module has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 1 (5 pts), loops 2, 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.
  • SourceGraph::path (cognitive 28) xtask/src/modules.rs:417 — SourceGraph::path has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 2 (4 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.
  • SourceGraph::check_boundaries (cognitive 27) xtask/src/modules.rs:508 — SourceGraph::check_boundaries has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (11 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • SourceGraph::resolve_edges (cognitive 17) xtask/src/modules.rs:331 — SourceGraph::resolve_edges has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 2 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Manager · ×5
  • Manager::list (cognitive 36) crates/dim-app-server/src/plugin_manager.rs:2150 — Manager::list has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (7 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Manager::reacquire_optional (cognitive 22) crates/dim-app-server/src/plugin_manager.rs:1907 — Manager::reacquire_optional has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1, 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.
  • Manager::switch (cognitive 20) crates/dim-app-server/src/plugin_manager.rs:2037 — Manager::switch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Manager::install (cognitive 16) crates/dim-app-server/src/plugin_manager.rs:1220 — Manager::install has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Manager::reload (cognitive 16) crates/dim-app-server/src/plugin_manager.rs:1564 — Manager::reload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3, 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 · AgentIndex · ×5
  • AgentIndex::install_default (cognitive 24) crates/dim-app-server/src/agents.rs:693 — AgentIndex::install_default has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (8 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.
  • AgentIndex::unload_idle (cognitive 22) crates/dim-app-server/src/agents.rs:961 — AgentIndex::unload_idle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentIndex::acquire_checked (cognitive 21) crates/dim-app-server/src/agents.rs:849 — AgentIndex::acquire_checked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, 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.
  • AgentIndex::remove_locked (cognitive 19) crates/dim-app-server/src/agents.rs:1511 — AgentIndex::remove_locked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, loops 2 (4 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentIndex::remove_unfinished (cognitive 16) crates/dim-app-server/src/agents.rs:1715 — AgentIndex::remove_unfinished has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Composer · ×5
  • Composer::submit (cognitive 21) crates/dim-cli/src/ui/composer/mod.rs:799 — Composer::submit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, match/switch 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.
  • Composer::render_rows (cognitive 19) crates/dim-cli/src/ui/composer/mod.rs:1239 — Composer::render_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 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.
  • Composer::handle_key (cognitive 18) crates/dim-cli/src/ui/composer/mod.rs:454 — Composer::handle_key has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (10 pts), boolean chains 5, if/else 3 (nesting depth added 5). 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.
  • Composer::parts (cognitive 18) crates/dim-cli/src/ui/composer/mod.rs:869 — Composer::parts has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). 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.
  • Composer::renumber (cognitive 17) crates/dim-cli/src/ui/composer/mod.rs:1196 — Composer::renumber has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 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.
D3 · God Classes · TooManyFields · ×5
  • TooManyFields: App crates/dim-cli/src/ui/tui.rs:1053 — TooManyFields — 115 stored fields beside 148 methods. The bar is 30 stored fields; this is 85 over it, 3.83× 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: Worker crates/dim-cli/src/session_host.rs:259 — TooManyFields — 54 stored fields beside 134 methods. The bar is 30 stored fields; this is 24 over it, 1.80× 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: CompactionDiagnosticsRecord crates/dim-agent-types/src/v1.rs:11 — TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× 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: Options REDACTED:561 — TooManyFields — 34 stored fields beside 10 methods. The bar is 30 stored fields; this is 4 over it, 1.13× 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: FullScreen crates/dim-cli/src/ui/render/fullscreen.rs:325 — TooManyFields — 32 stored fields beside 58 methods. The bar is 30 stored fields; this is 2 over it, 1.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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×5
  • Duplicated block (18 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:475 — crates/dim-agent-capabilities/src/context_preparation.rs:475-492 | crates/dim-agent-capabilities/src/model_provider.rs:156-173 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:475` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:536 — crates/dim-agent-capabilities/src/context_preparation.rs:536-553 | crates/dim-agent-capabilities/src/model_provider.rs:217-234 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/dim-agent-capabilities/src/shell_session.rs:1068 — crates/dim-agent-capabilities/src/shell_session.rs:1068-1085 | crates/dim-agent-capabilities/src/shell_session.rs:1178-1195 — both copies are in the same file, so extract the block into 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/dim-cli/src/session/window.rs:16 — crates/dim-cli/src/session/window.rs:16-33 | crates/dim-cli/src/session/window.rs:65-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/session/window.rs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/dim-modality/src/engine.rs:218 — crates/dim-modality/src/engine.rs:218-235 | crates/dim-modality/src/engine.rs:266-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-modality/src/engine.rs:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-modality/src/engine.rs:265` calls `operation` and `crates/dim-modality/src/engine.rs:217` 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 (16 lines × 2) · ×5
  • Duplicated block (16 lines × 2) crates/dim-agent-capabilities/src/permission.rs:384 — crates/dim-agent-capabilities/src/permission.rs:384-399 | crates/dim-agent-capabilities/src/permission.rs:473-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/permission.rs:384` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:174 — crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:174-189 | crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:63-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:174` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:62` calls `clone` and `crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:173` 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 (16 lines × 2) crates/dim-agent-scheduler/src/engine.rs:1053 — crates/dim-agent-scheduler/src/engine.rs:1053-1068 | crates/dim-agent-scheduler/src/engine.rs:1092-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-scheduler/src/engine.rs:1053` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/dim-app-server/src/provider.rs:1867 — crates/dim-app-server/src/provider.rs:1867-1882 | crates/dim-app-server/src/provider.rs:1910-1925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider.rs:1867` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/dim-cli/src/ui/i18n/pt_br/management.rs:9 — crates/dim-cli/src/ui/i18n/pt_br/management.rs:9-24 | crates/dim-cli/src/ui/i18n/pt_pt/management.rs:9-24 — `crates/dim-cli/src/ui/i18n/pt_br/management.rs` and `crates/dim-cli/src/ui/i18n/pt_pt/management.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 104 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:1188 — crates/dim-agent-capabilities/src/context_preparation.rs:1188-1200 | crates/dim-agent-capabilities/src/model_provider.rs:769-780 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:1188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) crates/dim-agent-capabilities/src/permission.rs:662 — crates/dim-agent-capabilities/src/permission.rs:662-674 | crates/dim-agent-capabilities/src/wait.rs:151-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-agent-capabilities/src/permission.rs:662` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:1270 — crates/dim-agent-capabilities/src/timeline_tree.rs:1270-1282 | crates/dim-agent-capabilities/src/timeline_tree.rs:1329-1340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:1270` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:2940 — crates/dim-agent-capabilities/src/timeline_tree.rs:2940-2952 | crates/dim-agent-questions/src/pending.rs:128-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:2940` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) crates/dim-app-server/src/lib.rs:568 — crates/dim-app-server/src/lib.rs:568-579 | crates/dim-app-server/src/lib.rs:635-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/lib.rs:568` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) crates/dim-agent-capabilities/src/workspace_tools/pending.rs:244 — crates/dim-agent-capabilities/src/workspace_tools/pending.rs:244-252 | crates/dim-app-server/src/collaboration/pending.rs:134-142 | crates/dim-app-server/src/collaboration/pending.rs:362-370 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/pending.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/dim-app-server/src/storage/prompt_migration.rs:72 — crates/dim-app-server/src/storage/prompt_migration.rs:72-80 | REDACTED:1282-1290 | REDACTED:2182-2190 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&Path` in one and `PathBuf` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) crates/dim-agent-aimux/src/plugin.rs:35 — crates/dim-agent-aimux/src/plugin.rs:35-43 | crates/dim-app-server/src/codex_oauth.rs:121-129 | crates/dim-app-server/src/grok_oauth.rs:114-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-aimux/src/plugin.rs:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) xtask/src/prompt_eval.rs:294 — xtask/src/prompt_eval.rs:294-302 | xtask/src/scenario_eval.rs:1571-1579 | xtask/src/summary_eval.rs:382-390 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/dim-app-server/src/collaboration.rs:3784 — crates/dim-app-server/src/collaboration.rs:3784-3792 | crates/dim-app-server/src/collaboration.rs:3811-3819 | crates/dim-app-server/src/collaboration.rs:3942-3950 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration.rs:3784` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) crates/dim-agent-capabilities/src/context_preparation.rs:1074 — crates/dim-agent-capabilities/src/context_preparation.rs:1074-1079 | crates/dim-agent-capabilities/src/model_provider.rs:661-666 | crates/dim-agent-capabilities/src/tool_executor.rs:310-315 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:1074` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-capabilities/src/context_preparation.rs:1072` calls `unwrap`, `take`, `clear` and `crates/dim-agent-capabilities/src/model_provider.rs:660` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) crates/dim-agent-capabilities/src/tool_executor.rs:338 — crates/dim-agent-capabilities/src/tool_executor.rs:338-343 | crates/dim-app-server/src/collaboration.rs:3577-3582 | crates/dim-modality/src/lib.rs:1309-1314 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/tool_executor.rs:338` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/dim-app-server/src/provider.rs:1736 — crates/dim-app-server/src/provider.rs:1736-1741 | crates/dim-app-server/src/provider.rs:2305-2310 | crates/dim-app-server/src/provider.rs:2347-2352 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider.rs:1736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/provider.rs:2346` calls `candidate_provider_ids` and `crates/dim-app-server/src/provider.rs:2304` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) crates/dim-agent-capabilities/src/context_policy.rs:859 — crates/dim-agent-capabilities/src/context_policy.rs:859-864 | crates/dim-agent-capabilities/src/context_policy.rs:892-897 | crates/dim-agent-capabilities/src/context_policy.rs:957-962 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:859` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/dim-agent-capabilities/src/workspace_tools/background.rs:818 — crates/dim-agent-capabilities/src/workspace_tools/background.rs:818-823 | crates/dim-app-server/src/agents/fork.rs:165-170 | crates/dim-app-server/src/storage/members.rs:295-300 — 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.
D5 · Coupling · Off the main sequence · ×5
  • Off the main sequence: dim-agent-types — dim-agent-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 20 project(s), so it's rigid to change.
  • Off the main sequence: dim-ocr — dim-ocr: 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: dim-agent-runtime — dim-agent-runtime: abstractness 0.03, instability 0.05, distance 0.91 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
  • Off the main sequence: dim-agent-capabilities — dim-agent-capabilities: abstractness 0.06, instability 0.10, distance 0.84 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
  • Off the main sequence: dim-client — dim-client: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
IC1 · Incompleteness & stubs · Unfinished branch · ×5
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/dim-agent-capabilities/src/history.rs:891 — `boundary` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/dim-agent-capabilities/src/workspace_tools/background.rs:739 — `rebuild` does real work, but one of its branches is `unreachable!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/dim-agent-capabilities/src/workspace_tools/background.rs:743 — `rebuild` does real work, but one of its branches is `unreachable!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/dim-app-server/src/collaboration.rs:3811 — `restore` does real work, but one of its branches is `unreachable!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
  • Unfinished branch — a todo!() / unimplemented!() arm in a real function crates/dim-migration/src/native.rs:850 — `history` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
X12 · Unreachable branch · Statement is unreachable · ×5
  • Statement is unreachable — control never gets past the statement before it crates/dim-ocr/src/pdf.rs:40 — `let count = unsafe { document.pageCount() };` follows `{ return Err(HelperError::encrypted_pdf()); }` (line 37) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
  • Statement is unreachable — control never gets past the statement before it crates/dim-client/src/lib.rs:150 — `stream` follows `{ return Err(io::Error::new(io::ErrorKind::PermissionDenied, "Daemon belongs …` (line 144) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
  • Statement is unreachable — control never gets past the statement before it crates/dim-app-server/src/connection.rs:594 — `let cancel = matches !(request.call, Call::Catalog(_) | Call::Summaries(_)).t…` follows `{ return Err(RpcError::app(- 32000, "connection_busy", "Connection request li…` (line 587) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
  • Statement is unreachable — control never gets past the statement before it crates/dim-agent-capabilities/src/context_policy.rs:1246 — `let step = CompactionStep { turn_id : Some(source.turn_id.clone()), request_i…` follows `{ return Ok(PreparedRequest { request : view.prepared.clone(), estimate : Som…` (line 1237) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
  • Statement is unreachable — control never gets past the statement before it crates/dim-agent-capabilities/src/context_usage/sources.rs:780 — `return self.record(machine, at, Summary { configuration : Some(next), .. Defa…` follows `{ return Ok(()); }` (line 777) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
X18 · Disposal-pattern correctness · Explicit release owed and not made on every path · ×5
  • Explicit release owed and not made on every path crates/dim-cli/src/export.rs:55 — `output` (line 55) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path crates/dim-cli/src/session_host.rs:446 — `worker` (line 446) is a `Worker` this function owns and never releases: no `run()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Worker` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/dim-app-server/src/cli.rs:245 — `out` (line 245) is a `BufWriter` this function owns and never releases: no `flush()` (or `into_inner()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a buffered writer that is dropped flushes and throws the error away, so a failed write reports success. Release it where the work ends.
  • Explicit release owed and not made on every path crates/dim-app-server/src/collaboration/approvals.rs:264 — `source` (line 264) is a `Source` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Source` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/dim-app-server/src/collaboration/approvals.rs:347 — `source` (line 347) is a `Source` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Source` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
D1 · Cyclomatic Complexity · Gateway · ×4
  • Gateway::work (cyclomatic 162) crates/dim-acp/src/gateway.rs:1224 — Gateway::work has cyclomatic complexity 162 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Gateway::request (cyclomatic 114) crates/dim-acp/src/gateway.rs:454 — Gateway::request has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Gateway::notice (cyclomatic 37) crates/dim-acp/src/gateway.rs:2040 — Gateway::notice 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.
  • Gateway::event_notice (cyclomatic 30) crates/dim-acp/src/gateway.rs:2439 — Gateway::event_notice has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dim_oauth · ×4
  • dim_oauth::models::project (cyclomatic 55) crates/dim-oauth/src/models.rs:338 — dim_oauth::models::project has cyclomatic complexity 55 (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.
  • dim_oauth::models::reasoning (cyclomatic 32) crates/dim-oauth/src/models.rs:72 — dim_oauth::models::reasoning 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.
  • dim_oauth::models::service_tier (cyclomatic 17) crates/dim-oauth/src/models.rs:215 — dim_oauth::models::service_tier 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.
  • dim_oauth::store::parse (cyclomatic 16) crates/dim-oauth/src/store.rs:133 — dim_oauth::store::parse 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 · Owner · ×4
  • Owner::attempt (cyclomatic 36) crates/dim-session-title/src/lib.rs:340 — Owner::attempt has cyclomatic complexity 36 (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.
  • Owner::ingest (cyclomatic 22) crates/dim-goal/src/branch.rs:1057 — Owner::ingest 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.
  • Owner::do_turn_end (cyclomatic 20) crates/dim-goal/src/branch.rs:1465 — Owner::do_turn_end 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.
  • Owner::rename (cyclomatic 17) crates/dim-session-title/src/lib.rs:536 — Owner::rename 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 · FullScreen · ×4
  • FullScreen::mouse (cognitive 118) crates/dim-cli/src/ui/render/fullscreen.rs:904 — FullScreen::mouse has cognitive complexity 118 (threshold 15). Drivers by points: if/else 46 (89 pts), boolean chains 16, match/switch 7 (13 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FullScreen::render (cognitive 65) crates/dim-cli/src/ui/render/fullscreen.rs:1229 — FullScreen::render has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 18, match/switch 6 (15 pts), loops 4 (5 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.
  • FullScreen::sync (cognitive 21) crates/dim-cli/src/ui/render/fullscreen.rs:1549 — FullScreen::sync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, loops 2 (3 pts), match/switch 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.
  • FullScreen::paint (cognitive 16) crates/dim-cli/src/ui/render/fullscreen.rs:1494 — FullScreen::paint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · dim_oauth · ×4
  • dim_oauth::models::project (cognitive 64) crates/dim-oauth/src/models.rs:338 — dim_oauth::models::project has cognitive complexity 64 (threshold 15). Drivers by points: if/else 33 (42 pts), boolean chains 8, loops 8, match/switch 5 (6 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dim_oauth::models::reasoning (cognitive 41) crates/dim-oauth/src/models.rs:72 — dim_oauth::models::reasoning has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 5 (6 pts), boolean chains 3, match/switch 2 (3 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.
  • dim_oauth::models::service_tier (cognitive 22) crates/dim-oauth/src/models.rs:215 — dim_oauth::models::service_tier has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (6 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • dim_oauth::store::parse (cognitive 18) crates/dim-oauth/src/store.rs:133 — dim_oauth::store::parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, match/switch 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 · ContextUsage · ×4
  • ContextUsage::restore (cognitive 61) crates/dim-agent-capabilities/src/context_usage/sources.rs:202 — ContextUsage::restore has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (44 pts), match/switch 4 (11 pts), boolean chains 6 (nesting depth added 32). 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.
  • ContextUsage::consume (cognitive 43) crates/dim-agent-capabilities/src/context_usage/sources.rs:733 — ContextUsage::consume has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 4 (9 pts), match/switch 3 (5 pts), boolean chains 4 (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.
  • ContextUsage::reference (cognitive 25) crates/dim-agent-capabilities/src/context_usage.rs:711 — ContextUsage::reference has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • ContextUsage::at (cognitive 17) crates/dim-agent-capabilities/src/context_usage.rs:1120 — ContextUsage::at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reader · ×4
  • Reader::property (cognitive 50) crates/dim-app-server/src/storage/codec.rs:929 — Reader::property has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 3, loops 2, match/switch 1 (2 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.
  • Reader::next (cognitive 34) crates/dim-app-server/src/transport.rs:558 — Reader::next has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 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.
  • Reader::decode (cognitive 17) crates/dim-app-server/src/storage/codec.rs:1176 — Reader::decode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 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.
  • Reader::messages (cognitive 16) crates/dim-app-server/src/storage/codec.rs:842 — Reader::messages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimelineTree · ×4
  • TimelineTree::restore (cognitive 44) crates/dim-agent-capabilities/src/timeline_tree.rs:1906 — TimelineTree::restore has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 5, loops 3, 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.
  • TimelineTree::launch (cognitive 28) crates/dim-agent-capabilities/src/timeline_tree.rs:781 — TimelineTree::launch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 6 (9 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.
  • TimelineTree::keyed_live (cognitive 17) crates/dim-agent-capabilities/src/timeline_tree.rs:1114 — TimelineTree::keyed_live has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TimelineTree::query (cognitive 16) crates/dim-agent-capabilities/src/timeline_tree.rs:967 — TimelineTree::query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Branch · ×4
  • Branch::follow_up_round (cognitive 41) crates/dim-agent-capabilities/src/hooks/runner.rs:1458 — Branch::follow_up_round has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (10 pts), loops 3 (8 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.
  • Branch::post_tools (cognitive 19) crates/dim-agent-capabilities/src/hooks/runner.rs:1776 — Branch::post_tools has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), 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, 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.
  • Branch::operator_consumed (cognitive 16) crates/dim-agent-capabilities/src/hooks/runner.rs:1348 — Branch::operator_consumed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Branch::write (cognitive 16) crates/dim-agent-capabilities/src/hooks/runner.rs:2117 — Branch::write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OauthView · ×4
  • OauthView::render_usage (cognitive 34) crates/dim-cli/src/ui/oauth_view.rs:387 — OauthView::render_usage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 2 (6 pts), loops 3, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OauthView::rows (cognitive 21) crates/dim-cli/src/ui/oauth_view.rs:286 — OauthView::rows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, 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.
  • OauthView::render (cognitive 19) crates/dim-cli/src/ui/oauth_view.rs:861 — OauthView::render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (5 pts), match/switch 2 (5 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.
  • OauthView::activate (cognitive 16) crates/dim-cli/src/ui/oauth_view.rs:759 — OauthView::activate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (7 pts) (nesting depth added 7). 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 · ManagedWorktrees · ×4
  • ManagedWorktrees::list (cognitive 30) crates/dim-app-server/src/worktrees.rs:334 — ManagedWorktrees::list has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (6 pts), boolean chains 2, match/switch 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.
  • ManagedWorktrees::prune_selection (cognitive 27) crates/dim-app-server/src/worktrees.rs:539 — ManagedWorktrees::prune_selection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 3, 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.
  • ManagedWorktrees::create (cognitive 23) crates/dim-app-server/src/worktrees.rs:150 — ManagedWorktrees::create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (6 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.
  • ManagedWorktrees::remove_unregistered (cognitive 19) crates/dim-app-server/src/worktrees.rs:761 — ManagedWorktrees::remove_unregistered has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Screen · ×4
  • Screen::draw (cognitive 28) crates/dim-migration/src/terminal.rs:127 — Screen::draw has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), loops 3 (4 pts), boolean chains 3, match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Screen::draw (cognitive 23) crates/dim-cli/src/composer.rs:837 — Screen::draw has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (5 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.
  • Screen::commit_in_place (cognitive 18) crates/dim-cli/src/ui/render/screen.rs:313 — Screen::commit_in_place has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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.
  • Screen::render (cognitive 16) crates/dim-cli/src/ui/render/screen.rs:173 — Screen::render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Panel · ×4
  • Panel::summary (cognitive 26) crates/dim-cli/src/ui/report_panel.rs:360 — Panel::summary has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 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.
  • Panel::render (cognitive 24) crates/dim-cli/src/ui/report_panel.rs:297 — Panel::render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, 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.
  • Panel::key (cognitive 19) crates/dim-cli/src/ui/report_panel.rs:144 — Panel::key has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Panel::generated_key (cognitive 17) crates/dim-cli/src/ui/report_panel.rs:214 — Panel::generated_key has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). 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 · dim_event_hub · ×4
  • dim_event_hub::model::validate_publish (cognitive 21) crates/dim-event-hub/src/model.rs:240 — dim_event_hub::model::validate_publish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • dim_event_hub::subscribe::subscribe (cognitive 18) crates/dim-event-hub/src/subscribe.rs:24 — dim_event_hub::subscribe::subscribe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 3 (5 pts), loops 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dim_event_hub::publish::apply_changes (cognitive 16) crates/dim-event-hub/src/publish.rs:648 — dim_event_hub::publish::apply_changes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3, boolean chains 2, 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.
  • dim_event_hub::store::decode (cognitive 16) crates/dim-event-hub/src/store.rs:170 — dim_event_hub::store::decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change-coupling hub · ×4
  • Change-coupling hub: en.ts → ChatPage.vue, ComposerPanel.vue, read.ts, chat.ts web/src/i18n/en.ts — `web/src/i18n/en.ts` changes together with 4 other files — `web/src/features/chat/ChatPage.vue`, `web/src/features/chat/ComposerPanel.vue`, `web/src/rpc/read.ts`, `web/src/stores/chat.ts` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
  • Change-coupling hub: zh-CN.ts → ChatPage.vue, ComposerPanel.vue, read.ts, chat.ts web/src/i18n/zh-CN.ts — `web/src/i18n/zh-CN.ts` changes together with 4 other files — `web/src/features/chat/ChatPage.vue`, `web/src/features/chat/ComposerPanel.vue`, `web/src/rpc/read.ts`, `web/src/stores/chat.ts` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
  • Change-coupling hub: timeline_query.rs → memory_timeline_store.rs, timeline_store.rs, REDACTED crates/dim-agent-runtime/src/timeline_query.rs — `crates/dim-agent-runtime/src/timeline_query.rs` changes together with 3 other files — `crates/dim-agent-runtime/src/memory_timeline_store.rs`, `crates/dim-agent-runtime/src/timeline_store.rs`, `REDACTED` — 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: prompts.rs → prompts.rs, prompts.rs, prompts.rs, prompts.rs, prompts.rs, prompts.rs, prompts.rs, prompts.rs, prompts.rs, prompts.rs crates/dim-cli/src/ui/prompts.rs — `crates/dim-cli/src/ui/prompts.rs` changes together with 10 other files — `crates/dim-cli/src/ui/i18n/de/prompts.rs`, `crates/dim-cli/src/ui/i18n/es/prompts.rs`, `crates/dim-cli/src/ui/i18n/fr/prompts.rs`, `crates/dim-cli/src/ui/i18n/id/prompts.rs`, `crates/dim-cli/src/ui/i18n/ja/prompts.rs`, `crates/dim-cli/src/ui/i18n/ko/prompts.rs`, `crates/dim-cli/src/ui/i18n/pt_br/prompts.rs`, `crates/dim-cli/src/ui/i18n/pt_pt/prompts.rs`, `crates/dim-cli/src/ui/i18n/zh_cn/prompts.rs`, `crates/dim-cli/src/ui/i18n/zh_hant/prompts.rs` — none of which declares a dependency on it: one file is the hub of 10 separate couplings, not 10 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 10.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) crates/dim-cli/src/ui/render/fullscreen.rs:557 — crates/dim-cli/src/ui/render/fullscreen.rs:557-585 | crates/dim-cli/src/ui/render/fullscreen.rs:589-612 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/dim-agent-runtime/src/timeline_context.rs:559 — crates/dim-agent-runtime/src/timeline_context.rs:559-582 | crates/dim-agent-runtime/src/timeline_context.rs:659-685 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/dim-agent-capabilities/src/input_queue/recovery.rs:17 — crates/dim-agent-capabilities/src/input_queue/recovery.rs:17-40 | crates/dim-goal/src/branch/recovery.rs:81-109 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/dim-cli/src/ui/text.rs:54 — crates/dim-cli/src/ui/text.rs:54-77 | crates/dim-cli/src/ui/text.rs:81-105 — These two members are one piece of code written twice and then edited apart: 24 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) · ×4
  • Edited copy of a member (19 corresponding lines) crates/dim-agent-scheduler/src/loops.rs:456 — crates/dim-agent-scheduler/src/loops.rs:456-474 | crates/dim-agent-scheduler/src/loops.rs:482-500 — 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.
  • Edited copy of a member (19 corresponding lines) xtask/src/scenario_eval.rs:5606 — xtask/src/scenario_eval.rs:5606-5626 | xtask/src/scenario_eval.rs:5772-5790 — 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.
  • Edited copy of a member (19 corresponding lines) crates/dim-goal/src/text.rs:500 — crates/dim-goal/src/text.rs:500-518 | crates/dim-goal/src/text.rs:582-603 — 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.
  • Edited copy of a member (19 corresponding lines) crates/dim-app-server/src/provider.rs:1664 — crates/dim-app-server/src/provider.rs:1664-1682 | crates/dim-app-server/src/provider.rs:3120-3143 — 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) · ×4
  • Edited copy of a member (13 corresponding lines) crates/dim-acp/src/projection.rs:101 — crates/dim-acp/src/projection.rs:101-113 | crates/dim-cli/src/projection.rs:2233-2248 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/dim-agent-capabilities/src/skills/session.rs:177 — crates/dim-agent-capabilities/src/skills/session.rs:177-189 | crates/dim-app-server/src/collaboration.rs:3409-3422 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/dim-oauth/src/lib.rs:908 — crates/dim-oauth/src/lib.rs:908-920 | crates/dim-oauth/src/lib.rs:922-934 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) xtask/src/catalog.rs:47 — xtask/src/catalog.rs:47-59 | xtask/src/types.rs:65-77 — 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 copies of one member (3 members, 7+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/dim-agent-aimux/src/plugin.rs:284 — crates/dim-agent-aimux/src/plugin.rs:284-291 | crates/dim-agent-capabilities/src/timeline_tree.rs:2178-2185 | crates/dim-codemode/src/session.rs:38-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/dim-agent-capabilities/src/shell_tools.rs:117 — crates/dim-agent-capabilities/src/shell_tools.rs:117-123 | crates/dim-agent-questions/src/lib.rs:519-526 | crates/dim-report/src/lib.rs:57-63 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/dim-agent-capabilities/src/skills/catalog.rs:730 — crates/dim-agent-capabilities/src/skills/catalog.rs:730-736 | crates/dim-app-server/src/connection.rs:2255-2263 | crates/dim-app-server/src/skills_management.rs:605-612 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/dim-agent-attachments/src/lib.rs:134 — crates/dim-agent-attachments/src/lib.rs:134-140 | crates/dim-app-server/src/hooks_settings.rs:680-686 | crates/dim-app-server/src/ui_extensions/resources.rs:393-400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
R10 · Code Duplication · Duplicated block (5 lines × 2 locations) · ×4
  • Duplicated block (5 lines × 2 locations) scripts/pack-release.mjs:21 — scripts/pack-release.mjs:21 · scripts/stage-image.mjs:102 — 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 (5 lines × 2 locations) scripts/pack-release.mjs:39 — scripts/pack-release.mjs:39 · scripts/stage-web.mjs:25 — 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 (5 lines × 2 locations) scripts/pack-release.mjs:49 — scripts/pack-release.mjs:49 · scripts/stage-web.mjs:63 — 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 (5 lines × 2 locations) web/src/features/settings/ProviderSettings.vue:72 — web/src/features/settings/ProviderSettings.vue:72 · web/src/features/settings/ProviderSettings.vue:86 — 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.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×3
  • Focus outline removed in CSS without a :focus replacement web/src/styles/global.css:304 — `[data-route-heading]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/features/chat/ComposerPanel.vue:842 — `.composer-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/features/chat/ComposerPanel.vue:847 — `.command-menu-item` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · FullScreen · ×3
  • FullScreen::mouse (cyclomatic 68) crates/dim-cli/src/ui/render/fullscreen.rs:904 — FullScreen::mouse has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • FullScreen::render (cyclomatic 47) crates/dim-cli/src/ui/render/fullscreen.rs:1229 — FullScreen::render has cyclomatic complexity 47 (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.
  • FullScreen::sync (cyclomatic 20) crates/dim-cli/src/ui/render/fullscreen.rs:1549 — FullScreen::sync has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dim_agent_runtime · ×3
  • dim_agent_runtime::memory_timeline_store::query::execute (cyclomatic 44) crates/dim-agent-runtime/src/memory_timeline_store/query.rs:631 — dim_agent_runtime::memory_timeline_store::query::execute has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • dim_agent_runtime::assembly::create_instance (cyclomatic 20) crates/dim-agent-runtime/src/assembly.rs:1493 — dim_agent_runtime::assembly::create_instance 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.
  • dim_agent_runtime::assembly::check_scope (cyclomatic 16) crates/dim-agent-runtime/src/assembly.rs:2087 — dim_agent_runtime::assembly::check_scope 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 · TasksPanel · ×3
  • TasksPanel::render (cyclomatic 33) crates/dim-cli/src/ui/tasks_panel.rs:516 — TasksPanel::render 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.
  • TasksPanel::set_tasks (cyclomatic 23) crates/dim-cli/src/ui/tasks_panel.rs:92 — TasksPanel::set_tasks has cyclomatic complexity 23 (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.
  • TasksPanel::handle_key (cyclomatic 23) crates/dim-cli/src/ui/tasks_panel.rs:295 — TasksPanel::handle_key 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 · Shared · ×3
  • Shared::run_host (cyclomatic 33) crates/dim-modality/src/engine.rs:2128 — Shared::run_host 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.
  • Shared::submit_phase (cyclomatic 24) crates/dim-modality/src/engine.rs:1933 — Shared::submit_phase 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.
  • Shared::settle_files (cyclomatic 22) crates/dim-modality/src/engine.rs:2506 — Shared::settle_files 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.
D1 · Cyclomatic Complexity · ContextUsage · ×3
  • ContextUsage::restore (cyclomatic 32) crates/dim-agent-capabilities/src/context_usage/sources.rs:202 — ContextUsage::restore 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.
  • ContextUsage::consume (cyclomatic 29) crates/dim-agent-capabilities/src/context_usage/sources.rs:733 — ContextUsage::consume 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.
  • ContextUsage::reference (cyclomatic 21) crates/dim-agent-capabilities/src/context_usage.rs:711 — ContextUsage::reference 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 · Evaluation · ×3
  • Evaluation::matches (cyclomatic 29) crates/dim-agent-runtime/src/memory_timeline_store/query.rs:318 — Evaluation::matches 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.
  • Evaluation::prepare (cyclomatic 22) crates/dim-agent-runtime/src/memory_timeline_store/query.rs:157 — Evaluation::prepare 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.
  • Evaluation::operation (cyclomatic 16) crates/dim-modality/src/lib.rs:844 — Evaluation::operation 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 · OauthView · ×3
  • OauthView::render_usage (cyclomatic 25) crates/dim-cli/src/ui/oauth_view.rs:387 — OauthView::render_usage 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.
  • OauthView::activate (cyclomatic 21) crates/dim-cli/src/ui/oauth_view.rs:759 — OauthView::activate has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • OauthView::rows (cyclomatic 18) crates/dim-cli/src/ui/oauth_view.rs:286 — OauthView::rows 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 · Composer · ×3
  • Composer::handle_key (cyclomatic 18) crates/dim-cli/src/ui/composer/mod.rs:454 — Composer::handle_key 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.
  • Composer::submit (cyclomatic 16) crates/dim-cli/src/ui/composer/mod.rs:799 — Composer::submit 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.
  • Composer::parts (cyclomatic 16) crates/dim-cli/src/ui/composer/mod.rs:869 — Composer::parts 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 · Options · ×3
  • Options::parse (cognitive 400) REDACTED:616 — Options::parse has cognitive complexity 400 (threshold 15). Drivers by points: if/else 106 (238 pts), match/switch 33 (115 pts), boolean chains 38, loops 3 (9 pts) (nesting depth added 220). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Options::read_startup (cognitive 64) REDACTED:1892 — Options::read_startup has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (43 pts), boolean chains 8, match/switch 3 (7 pts), loops 3 (6 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.
  • Options::parse_from (cognitive 36) xtask/src/scenario_eval.rs:1300 — Options::parse_from has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 8, match/switch 3 (8 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.
D2 · Cognitive Complexity · AgentLoop · ×3
  • AgentLoop::rebuild (cognitive 132) crates/dim-agent-capabilities/src/agent_loop.rs:559 — AgentLoop::rebuild has cognitive complexity 132 (threshold 15). Drivers by points: if/else 38 (101 pts), loops 7 (15 pts), match/switch 5 (14 pts), boolean chains 2 (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentLoop::on_event (cognitive 74) crates/dim-agent-capabilities/src/agent_loop.rs:1361 — AgentLoop::on_event has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (44 pts), match/switch 9 (17 pts), boolean chains 13 (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.
  • AgentLoop::start_preparation (cognitive 16) crates/dim-agent-capabilities/src/agent_loop.rs:1197 — AgentLoop::start_preparation has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (8 pts), if/else 5 (7 pts), boolean chains 1 (nesting depth added 4). 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 · Source · ×3
  • Source::session (cognitive 104) crates/dim-migration/src/source.rs:515 — Source::session has cognitive complexity 104 (threshold 15). Drivers by points: if/else 27 (54 pts), loops 10 (27 pts), boolean chains 12, match/switch 4 (11 pts) (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.
  • Source::history (cognitive 34) crates/dim-migration/src/source.rs:814 — Source::history has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (10 pts), match/switch 1 (5 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.
  • Source::blob (cognitive 16) crates/dim-migration/src/source.rs:1008 — Source::blob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 3 (5 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 · ContextPolicy · ×3
  • ContextPolicy::prepare (cognitive 48) crates/dim-agent-capabilities/src/context_policy.rs:992 — ContextPolicy::prepare has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 9 (15 pts), boolean chains 7, loops 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.
  • ContextPolicy::cut_window (cognitive 26) crates/dim-agent-capabilities/src/context_policy.rs:720 — ContextPolicy::cut_window has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ContextPolicy::cut_order (cognitive 17) crates/dim-agent-capabilities/src/context_policy.rs:557 — ContextPolicy::cut_order has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Draft · ×3
  • Draft::prepare (cognitive 48) crates/dim-cli/src/composer.rs:466 — Draft::prepare has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 7 (16 pts), loops 5 (7 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.
  • Draft::line_edge (cognitive 24) crates/dim-cli/src/composer.rs:279 — Draft::line_edge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Draft::layout (cognitive 21) crates/dim-cli/src/composer.rs:210 — Draft::layout has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (5 pts), loops 2 (3 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 · ShellScan · ×3
  • ShellScan::text (cognitive 47) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:582 — ShellScan::text has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 8, match/switch 1 (2 pts), 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.
  • ShellScan::read_heredocs (cognitive 31) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:1023 — ShellScan::read_heredocs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (6 pts), boolean chains 3 (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.
  • ShellScan::heredoc_opener_inner (cognitive 16) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:967 — ShellScan::heredoc_opener_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TasksPanel · ×3
  • TasksPanel::render (cognitive 46) crates/dim-cli/src/ui/tasks_panel.rs:516 — TasksPanel::render has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (34 pts), match/switch 4 (8 pts), boolean chains 2, 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.
  • TasksPanel::handle_key (cognitive 21) crates/dim-cli/src/ui/tasks_panel.rs:295 — TasksPanel::handle_key has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 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.
  • TasksPanel::set_tasks (cognitive 19) crates/dim-cli/src/ui/tasks_panel.rs:92 — TasksPanel::set_tasks has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), match/switch 3, loops 2 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Evaluation · ×3
  • Evaluation::prepare (cognitive 44) crates/dim-agent-runtime/src/memory_timeline_store/query.rs:157 — Evaluation::prepare has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (14 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Evaluation::matches (cognitive 42) crates/dim-agent-runtime/src/memory_timeline_store/query.rs:318 — Evaluation::matches has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (9 pts), match/switch 3 (6 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.
  • Evaluation::operation (cognitive 24) crates/dim-modality/src/lib.rs:844 — Evaluation::operation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 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 · BranchLine · ×3
  • BranchLine::write (cognitive 42) crates/dim-agent-capabilities/src/timeline_tree.rs:3351 — BranchLine::write has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 7, 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.
  • BranchLine::fold (cognitive 29) crates/dim-agent-capabilities/src/timeline_tree.rs:2994 — BranchLine::fold has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (5 pts), boolean chains 4, loops 2 (4 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.
  • BranchLine::run (cognitive 21) crates/dim-agent-capabilities/src/timeline_tree.rs:3307 — BranchLine::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 4 (10 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 · SqliteTimelineStore · ×3
  • SqliteTimelineStore::previous (cognitive 26) REDACTED:761 — SqliteTimelineStore::previous has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SqliteTimelineStore::start (cognitive 18) REDACTED:213 — SqliteTimelineStore::start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (7 pts), loops 2 (3 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.
  • SqliteTimelineStore::prepare (cognitive 18) REDACTED:613 — SqliteTimelineStore::prepare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), match/switch 1 (4 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 · BackgroundExec · ×3
  • BackgroundExec::start (cognitive 21) crates/dim-agent-capabilities/src/workspace_tools/background.rs:192 — BackgroundExec::start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2, match/switch 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.
  • BackgroundExec::rebuild (cognitive 20) crates/dim-agent-capabilities/src/workspace_tools/background.rs:706 — BackgroundExec::rebuild has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 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.
  • BackgroundExec::page (cognitive 19) crates/dim-agent-capabilities/src/workspace_tools/background.rs:345 — BackgroundExec::page has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 4 (6 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×3
  • Edited copy of a member (39 corresponding lines) crates/dim-cli/src/management_command.rs:903 — crates/dim-cli/src/management_command.rs:903-946 | crates/dim-cli/src/management_command.rs:990-1028 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) crates/dim-agent-scheduler/src/document.rs:368 — crates/dim-agent-scheduler/src/document.rs:368-409 | crates/dim-agent-scheduler/src/document.rs:442-480 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) crates/dim-agent-capabilities/src/approval.rs:570 — crates/dim-agent-capabilities/src/approval.rs:570-608 | crates/dim-agent-capabilities/src/wait.rs:448-491 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×3
  • Edited copy of a member (26 corresponding lines) crates/dim-app-server/src/codex_oauth.rs:110 — crates/dim-app-server/src/codex_oauth.rs:110-135 | crates/dim-app-server/src/grok_oauth.rs:103-128 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/dim-agent-capabilities/src/context_usage.rs:420 — crates/dim-agent-capabilities/src/context_usage.rs:420-445 | crates/dim-agent-capabilities/src/prompt/recovery.rs:65-90 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/dim-app-server/src/mcp.rs:1288 — crates/dim-app-server/src/mcp.rs:1288-1313 | crates/dim-app-server/src/mcp/server.rs:1275-1300 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×3
  • Edited copy of a member (20 corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:364 — crates/dim-agent-capabilities/src/file_storage.rs:364-383 | crates/dim-agent-capabilities/src/file_storage.rs:454-477 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/dim-app-server/src/mcp.rs:1722 — crates/dim-app-server/src/mcp.rs:1722-1744 | crates/dim-app-server/src/mcp.rs:1755-1774 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/dim-acp/src/gateway.rs:2585 — crates/dim-acp/src/gateway.rs:2585-2604 | crates/dim-acp/src/gateway.rs:2658-2679 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) crates/dim-app-server/src/plugin_manager/acquire.rs:114 — crates/dim-app-server/src/plugin_manager/acquire.rs:114-129 | crates/dim-app-server/src/plugin_manager/acquire.rs:133-153 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:1866 — crates/dim-agent-capabilities/src/file_storage.rs:1866-1881 | crates/dim-agent-capabilities/src/workspace_tools/files.rs:599-620 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) REDACTED:1070 — REDACTED:1070-1085 | REDACTED:1264-1281 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×3
  • Edited copy of a member (21 corresponding lines) crates/dim-cli/src/ui/prompts.rs:49 — crates/dim-cli/src/ui/prompts.rs:49-69 | crates/dim-cli/src/ui/prompts.rs:72-95 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/dim-app-server/src/storage/reclaim.rs:132 — crates/dim-app-server/src/storage/reclaim.rs:132-152 | REDACTED:2833-2859 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/dim-agent-capabilities/src/wait.rs:277 — crates/dim-agent-capabilities/src/wait.rs:277-301 | crates/dim-codemode/src/session.rs:76-96 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/dim-agent-capabilities/src/execution_settings.rs:94 — crates/dim-agent-capabilities/src/execution_settings.rs:94-104 | crates/dim-agent-capabilities/src/host.rs:906-915 | crates/dim-agent-capabilities/src/prompt_suggestion.rs:144-153 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/dim-agent-capabilities/src/input_queue.rs:372 — crates/dim-agent-capabilities/src/input_queue.rs:372-381 | crates/dim-agent-capabilities/src/tool_executor.rs:257-267 | crates/dim-agent-capabilities/src/workspace_tools/background.rs:988-997 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/dim-agent-capabilities/src/host.rs:1231 — crates/dim-agent-capabilities/src/host.rs:1231-1240 | crates/dim-agent-capabilities/src/permission.rs:223-232 | crates/dim-agent-capabilities/src/wait.rs:118-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) crates/dim-agent-capabilities/src/history.rs:1450 — crates/dim-agent-capabilities/src/history.rs:1450-1461 | crates/dim-agent-capabilities/src/hooks/runner.rs:1830-1841 | crates/dim-agent-runtime/src/core/timeline.rs:874-885 — before extracting anything, compare `crates/dim-agent-capabilities/src/history.rs` and `crates/dim-agent-runtime/src/core/timeline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/history.rs:1450` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/dim-agent-capabilities/src/timeline_tree.rs:474 — crates/dim-agent-capabilities/src/timeline_tree.rs:474-485 | crates/dim-agent-capabilities/src/timeline_tree.rs:1152-1163 | crates/dim-agent-capabilities/src/timeline_tree.rs:1267-1278 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/dim-agent-scheduler/src/loops.rs:313 — crates/dim-agent-scheduler/src/loops.rs:313-324 | crates/dim-agent-scheduler/src/runs.rs:364-375 | crates/dim-agent-scheduler/src/wakeups.rs:168-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `crates/dim-agent-scheduler/src/loops.rs:313` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×3
  • Duplicated block (7 lines × 3) crates/dim-agent-capabilities/src/recall/search.rs:405 — crates/dim-agent-capabilities/src/recall/search.rs:405-411 | crates/dim-agent-capabilities/src/recall/search.rs:830-836 | crates/dim-agent-capabilities/src/recall/search.rs:1380-1386 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:405` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/dim-agent-scheduler/src/engine.rs:427 — crates/dim-agent-scheduler/src/engine.rs:427-433 | crates/dim-agent-scheduler/src/engine.rs:1040-1046 | crates/dim-agent-scheduler/src/engine.rs:1079-1085 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-scheduler/src/engine.rs:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `shared` to `&Shared` in one and `&Arc<Shared>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-agent-scheduler/src/engine.rs:1038` calls `to_owned`, `clone` and `crates/dim-agent-scheduler/src/engine.rs:426` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) crates/dim-cli/src/management_command.rs:940 — crates/dim-cli/src/management_command.rs:940-946 | crates/dim-cli/src/management_command.rs:1022-1028 | crates/dim-cli/src/management_command.rs:1112-1118 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/management_command.rs:940` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
IC1 · Incompleteness & stubs · Hollow method · ×3
  • Hollow method — returns a constant without doing the work crates/dim-agent-capabilities/src/file_storage/windows.rs:235 — `sync_directory` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/dim-agent-capabilities/src/prompt_suggestion.rs:1273 — `failed` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/dim-cli/src/worktree_command.rs:324 — `print_json` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×3
  • Sync-over-async blocking crates/dim-cli/src/plugins.rs:106 — `apply` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking runtime/fixtures/guide-entries.ts:37 — `existsSync` in `apply` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking runtime/fixtures/session-observer.ts:42 — `appendFileSync` in `callback to ctx.effect` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×3
  • Duplicated block (10 lines × 2 locations) scripts/update-provider-catalog.ts:527 — scripts/update-provider-catalog.ts:527 · scripts/update-provider-catalog.ts:617 — 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) web/src/features/lines/EndLineDialog.vue:9 — web/src/features/lines/EndLineDialog.vue:9 · web/src/features/lines/NewLineDialog.vue:12 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2 locations) web/src/lines.ts:132 — web/src/lines.ts:132 · web/src/lines.ts:147 — 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 (10 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (10 matched lines × 2 locations) web/src/features/lines/LineConversation.vue:13 — web/src/features/lines/LineConversation.vue:13 · web/src/features/lines/LinesPanel.vue:10 — the two spans are one implementation copied and then locally edited — 90 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 (10 matched lines × 2 locations) web/src/features/settings/AgentSettings.vue:85 — web/src/features/settings/AgentSettings.vue:85 · web/src/features/settings/DiagnosticsSettings.vue:36 — the two spans are one implementation copied and then locally edited — 63 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 (10 matched lines × 2 locations) web/src/features/settings/ProviderAuthFlow.vue:96 — web/src/features/settings/ProviderAuthFlow.vue:96 · web/src/features/settings/ProviderSettings.vue:139 — the two spans are one implementation copied and then locally edited — 59 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 (9 lines × 2 locations) · ×3
  • Duplicated block (9 lines × 2 locations) scripts/update-provider-catalog.ts:316 — scripts/update-provider-catalog.ts:316 · scripts/update-provider-catalog.ts:639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2 locations) web/src/features/settings/ProviderSettings.vue:29 — web/src/features/settings/ProviderSettings.vue:29 · web/src/features/settings/ScheduledSettings.vue:26 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2 locations) web/src/rpc/read.ts:58 — web/src/rpc/read.ts:58 · web/src/rpc/read.ts:85 — 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.
D1 · Cyclomatic Complexity · AgentLoop · ×2
  • AgentLoop::on_event (cyclomatic 69) crates/dim-agent-capabilities/src/agent_loop.rs:1361 — AgentLoop::on_event has cyclomatic complexity 69 (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.
  • AgentLoop::rebuild (cyclomatic 57) crates/dim-agent-capabilities/src/agent_loop.rs:559 — AgentLoop::rebuild has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextPolicy · ×2
  • ContextPolicy::prepare (cyclomatic 34) crates/dim-agent-capabilities/src/context_policy.rs:992 — ContextPolicy::prepare has cyclomatic complexity 34 (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.
  • ContextPolicy::cut_window (cyclomatic 16) crates/dim-agent-capabilities/src/context_policy.rs:720 — ContextPolicy::cut_window 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 · BranchLine · ×2
  • BranchLine::fold (cyclomatic 29) crates/dim-agent-capabilities/src/timeline_tree.rs:2994 — BranchLine::fold has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • BranchLine::write (cyclomatic 28) crates/dim-agent-capabilities/src/timeline_tree.rs:3351 — BranchLine::write 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 · SessionState · ×2
  • SessionState::search (cyclomatic 27) crates/dim-app-server/src/web.rs:645 — SessionState::search 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.
  • SessionState::fetch_page (cyclomatic 17) crates/dim-app-server/src/web.rs:457 — SessionState::fetch_page 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 · Reader · ×2
  • Reader::property (cyclomatic 26) crates/dim-app-server/src/storage/codec.rs:929 — Reader::property 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.
  • Reader::next (cyclomatic 16) crates/dim-app-server/src/transport.rs:558 — Reader::next 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 · TimelineTree · ×2
  • TimelineTree::restore (cyclomatic 24) crates/dim-agent-capabilities/src/timeline_tree.rs:1906 — TimelineTree::restore 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.
  • TimelineTree::launch (cyclomatic 21) crates/dim-agent-capabilities/src/timeline_tree.rs:781 — TimelineTree::launch has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceGraph · ×2
  • SourceGraph::check_boundaries (cyclomatic 24) xtask/src/modules.rs:508 — SourceGraph::check_boundaries has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • SourceGraph::path (cyclomatic 18) xtask/src/modules.rs:417 — SourceGraph::path 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 · Panel · ×2
  • Panel::key (cyclomatic 22) crates/dim-cli/src/ui/report_panel.rs:144 — Panel::key 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.
  • Panel::summary (cyclomatic 16) crates/dim-cli/src/ui/report_panel.rs:360 — Panel::summary 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 · Prompt · ×2
  • Prompt::start (cyclomatic 20) crates/dim-agent-capabilities/src/prompt.rs:291 — Prompt::start 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.
  • Prompt::consume_result (cyclomatic 17) crates/dim-agent-capabilities/src/prompt.rs:522 — Prompt::consume_result 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.
D1 · Cyclomatic Complexity · ManagedWorktrees · ×2
  • ManagedWorktrees::list (cyclomatic 20) crates/dim-app-server/src/worktrees.rs:334 — ManagedWorktrees::list 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.
  • ManagedWorktrees::prune_selection (cyclomatic 16) crates/dim-app-server/src/worktrees.rs:539 — ManagedWorktrees::prune_selection 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 · PluginsPanel · ×2
  • PluginsPanel::handle_key (cyclomatic 20) crates/dim-cli/src/ui/plugins_panel.rs:117 — PluginsPanel::handle_key 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.
  • PluginsPanel::render (cyclomatic 20) crates/dim-cli/src/ui/plugins_panel.rs:225 — PluginsPanel::render 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 · ProvidersPanel · ×2
  • ProvidersPanel::form_key (cyclomatic 20) crates/dim-cli/src/ui/providers_panel.rs:337 — ProvidersPanel::form_key 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.
  • ProvidersPanel::render (cyclomatic 20) crates/dim-cli/src/ui/providers_panel.rs:509 — ProvidersPanel::render 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 · BackgroundExec · ×2
  • BackgroundExec::page (cyclomatic 18) crates/dim-agent-capabilities/src/workspace_tools/background.rs:345 — BackgroundExec::page 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.
  • BackgroundExec::start (cyclomatic 16) crates/dim-agent-capabilities/src/workspace_tools/background.rs:192 — BackgroundExec::start 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 · AgentIndex · ×2
  • AgentIndex::remove_locked (cyclomatic 17) crates/dim-app-server/src/agents.rs:1511 — AgentIndex::remove_locked 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.
  • AgentIndex::acquire_checked (cyclomatic 16) crates/dim-app-server/src/agents.rs:849 — AgentIndex::acquire_checked 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 · Owners · ×2
  • Owners::register (cognitive 50) crates/dim-app-server/src/plugin_manager.rs:846 — Owners::register has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 8 (22 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.
  • Owners::refused (cognitive 20) crates/dim-app-server/src/plugin_manager.rs:1013 — Owners::refused has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Input · ×2
  • Input::line (cognitive 50) crates/dim-cli/src/input.rs:247 — Input::line has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (42 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (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.
  • Input::read_bytes (cognitive 29) crates/dim-cli/src/input.rs:325 — Input::read_bytes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Search · ×2
  • Search::open_turn (cognitive 44) crates/dim-agent-capabilities/src/recall/search.rs:262 — Search::open_turn has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 4 (7 pts), match/switch 1 (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.
  • Search::current_keys (cognitive 27) crates/dim-agent-capabilities/src/recall/search.rs:179 — Search::current_keys has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionState · ×2
  • SessionState::search (cognitive 43) crates/dim-app-server/src/web.rs:645 — SessionState::search has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 8, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • SessionState::fetch_page (cognitive 31) crates/dim-app-server/src/web.rs:457 — SessionState::fetch_page has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AskUserPrompt · ×2
  • AskUserPrompt::handle_key (cognitive 41) crates/dim-cli/src/ui/prompts.rs:1303 — AskUserPrompt::handle_key has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 4, match/switch 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.
  • AskUserPrompt::body (cognitive 18) crates/dim-cli/src/ui/prompts.rs:1552 — AskUserPrompt::body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Prompt · ×2
  • Prompt::recover_sources (cognitive 33) crates/dim-agent-capabilities/src/prompt/recovery.rs:1419 — Prompt::recover_sources has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 2 (5 pts), match/switch 1 (4 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.
  • Prompt::start (cognitive 26) crates/dim-agent-capabilities/src/prompt.rs:291 — Prompt::start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagementPanel · ×2
  • ManagementPanel::handle_key (cognitive 33) crates/dim-cli/src/ui/management_panel.rs:406 — ManagementPanel::handle_key has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 5, match/switch 1 (2 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.
  • ManagementPanel::render (cognitive 19) crates/dim-cli/src/ui/management_panel.rs:674 — ManagementPanel::render has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 6, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · HistoryRenderer · ×2
  • HistoryRenderer::rendered_stream (cognitive 32) crates/dim-agent-capabilities/src/history.rs:602 — HistoryRenderer::rendered_stream has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HistoryRenderer::stream_checkpoint (cognitive 18) crates/dim-agent-capabilities/src/history.rs:372 — HistoryRenderer::stream_checkpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · Loops · ×2
  • Loops::evaluate (cognitive 29) crates/dim-agent-scheduler/src/loops.rs:766 — Loops::evaluate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (5 pts), boolean chains 2, loops 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.
  • Loops::settle_delivering (cognitive 24) crates/dim-agent-scheduler/src/loops.rs:931 — Loops::settle_delivering has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 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.
D2 · Cognitive Complexity · ModelsPanel · ×2
  • ModelsPanel::footer (cognitive 29) crates/dim-cli/src/ui/models_panel.rs:494 — ModelsPanel::footer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (11 pts), match/switch 1 (3 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.
  • ModelsPanel::compact_footer (cognitive 20) crates/dim-cli/src/ui/models_panel.rs:554 — ModelsPanel::compact_footer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (8 pts), match/switch 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 · Service · ×2
  • Service::complete_browser_inner (cognitive 26) crates/dim-app-server/src/managed_oauth.rs:655 — Service::complete_browser_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, match/switch 2, 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, 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.
  • Service::parse_record (cognitive 16) crates/dim-app-server/src/managed_oauth.rs:468 — Service::parse_record has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProvidersPanel · ×2
  • ProvidersPanel::render (cognitive 26) crates/dim-cli/src/ui/providers_panel.rs:509 — ProvidersPanel::render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 2 (4 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.
  • ProvidersPanel::set_providers (cognitive 22) crates/dim-cli/src/ui/providers_panel.rs:129 — ProvidersPanel::set_providers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Terminal · ×2
  • Terminal::next_event (cognitive 24) crates/dim-cli/src/ui/terminal/mod.rs:440 — Terminal::next_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, 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.
  • Terminal::run (cognitive 21) crates/dim-migration/src/terminal.rs:47 — Terminal::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · McpService · ×2
  • McpService::move_entry (cognitive 22) crates/dim-app-server/src/mcp.rs:1166 — McpService::move_entry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, match/switch 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.
  • McpService::catalog (cognitive 19) crates/dim-app-server/src/mcp.rs:659 — McpService::catalog has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), match/switch 4 (6 pts), if/else 1 (2 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · McpServer · ×2
  • McpServer::peer_with_generation (cognitive 21) crates/dim-app-server/src/mcp/server.rs:936 — McpServer::peer_with_generation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, match/switch 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.
  • McpServer::exchange (cognitive 21) crates/dim-app-server/src/mcp/server.rs:1145 — McpServer::exchange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeService · ×2
  • RuntimeService::acquire (cognitive 20) crates/dim-app-server/src/runtime_manager.rs:1108 — RuntimeService::acquire has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RuntimeService::install (cognitive 19) crates/dim-app-server/src/runtime_manager.rs:861 — RuntimeService::install has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dim_agent_scheduler · ×2
  • dim_agent_scheduler::engine::prune_once (cognitive 18) crates/dim-agent-scheduler/src/engine.rs:547 — dim_agent_scheduler::engine::prune_once has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 2 (3 pts), loops 3, match/switch 2 (3 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • dim_agent_scheduler::engine::stop_at (cognitive 17) crates/dim-agent-scheduler/src/engine.rs:708 — dim_agent_scheduler::engine::stop_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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 · BundledCatalog · ×2
  • BundledCatalog::project (cognitive 17) crates/dim-app-server/src/model_catalog.rs:513 — BundledCatalog::project 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, 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.
  • BundledCatalog::merge_visible_edit (cognitive 17) crates/dim-app-server/src/model_catalog.rs:830 — BundledCatalog::merge_visible_edit 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) crates/dim-app-server/src/storage/members.rs:783 — crates/dim-app-server/src/storage/members.rs:783-833 | crates/dim-app-server/src/storage/members.rs:841-877 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) crates/dim-cli/src/ui/i18n/pt_br/runtime.rs:1 — crates/dim-cli/src/ui/i18n/pt_br/runtime.rs:1-37 | crates/dim-cli/src/ui/i18n/pt_pt/runtime.rs:1-37 — These two members are one piece of code written twice and then edited apart: 37 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 (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:199 — crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:199-240 | crates/dim-cli/src/ui/composer/mentions.rs:197-251 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) crates/dim-app-server/src/execution_settings.rs:41 — crates/dim-app-server/src/execution_settings.rs:41-82 | crates/dim-app-server/src/prompt_suggestion_settings.rs:36-80 — These two members are one piece of code written twice and then edited apart: 42 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 (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) crates/dim-modality/src/engine.rs:552 — crates/dim-modality/src/engine.rs:552-591 | crates/dim-modality/src/engine.rs:601-636 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) crates/dim-agent-capabilities/src/workspace_tools/files.rs:926 — crates/dim-agent-capabilities/src/workspace_tools/files.rs:926-964 | crates/dim-agent-capabilities/src/workspace_tools/files.rs:991-1026 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 29+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 29+ corresponding lines) crates/dim-agent-scheduler/src/engine.rs:471 — crates/dim-agent-scheduler/src/engine.rs:471-499 | crates/dim-agent-scheduler/src/engine.rs:1036-1068 | crates/dim-agent-scheduler/src/engine.rs:1076-1107 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 29+ corresponding lines) crates/dim-app-server/src/hooks_settings.rs:626 — crates/dim-app-server/src/hooks_settings.rs:626-656 | crates/dim-app-server/src/skills_management.rs:189-217 | crates/dim-app-server/src/skills_management.rs:224-254 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) crates/dim-agent-runtime/src/timeline_context.rs:393 — crates/dim-agent-runtime/src/timeline_context.rs:393-417 | crates/dim-agent-runtime/src/timeline_context.rs:428-464 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/dim-cli/src/lib.rs:356 — crates/dim-cli/src/lib.rs:356-380 | crates/dim-cli/src/lib.rs:389-421 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) crates/dim-agent-capabilities/src/context_policy.rs:519 — crates/dim-agent-capabilities/src/context_policy.rs:519-540 | crates/dim-agent-capabilities/src/context_policy.rs:672-702 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/dim-cli/src/ui/tasks_panel.rs:464 — crates/dim-cli/src/ui/tasks_panel.rs:464-485 | crates/dim-cli/src/ui/tasks_panel.rs:493-514 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/dim-agent-scheduler/src/loops.rs:310 — crates/dim-agent-scheduler/src/loops.rs:310-324 | crates/dim-agent-scheduler/src/runs.rs:361-375 | crates/dim-agent-scheduler/src/wakeups.rs:165-179 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/dim-agent-capabilities/src/context_preparation.rs:984 — crates/dim-agent-capabilities/src/context_preparation.rs:984-999 | crates/dim-agent-capabilities/src/prompt.rs:733-749 | crates/dim-agent-capabilities/src/shell_session.rs:1471-1485 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/dim-app-server/src/agent_records.rs:141 — crates/dim-app-server/src/agent_records.rs:141-157 | crates/dim-app-server/src/agent_records.rs:160-178 | crates/dim-app-server/src/agent_records.rs:181-194 | crates/dim-app-server/src/agent_records.rs:216-236 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/dim-agent-capabilities/src/execution_settings/prompt.rs:201 — crates/dim-agent-capabilities/src/execution_settings/prompt.rs:201-214 | crates/dim-agent-capabilities/src/recall.rs:114-127 | crates/dim-agent-capabilities/src/timeline_tree.rs:2347-2365 | crates/dim-agent-capabilities/src/wait.rs:412-425 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/dim-app-server/src/connection.rs:2680 — crates/dim-app-server/src/connection.rs:2680-2690 | crates/dim-app-server/src/settings/declared.rs:302-309 | crates/dim-app-server/src/storage/metadata.rs:302-314 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/dim-agent-capabilities/src/context_usage/sources.rs:193 — crates/dim-agent-capabilities/src/context_usage/sources.rs:193-200 | crates/dim-agent-capabilities/src/input_queue/recovery.rs:98-105 | crates/dim-agent-capabilities/src/prompt/recovery.rs:107-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/dim-agent-capabilities/src/shell_input.rs:555 — crates/dim-agent-capabilities/src/shell_input.rs:555-565 | crates/dim-agent-capabilities/src/timeline_tree.rs:2258-2268 | crates/dim-image-understanding/src/lib.rs:255-265 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/dim-app-server/src/connection/tree.rs:1435 — crates/dim-app-server/src/connection/tree.rs:1435-1445 | crates/dim-app-server/src/connection/tree.rs:1454-1464 | crates/dim-app-server/src/connection/tree.rs:1941-1951 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/dim-agent-capabilities/src/prompt_guide.rs:251 — crates/dim-agent-capabilities/src/prompt_guide.rs:251-256 | crates/dim-event-hub/src/model.rs:132-137 | crates/dim-event-hub/src/model.rs:140-145 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) crates/dim-cli/src/management/hooks.rs:181 — crates/dim-cli/src/management/hooks.rs:181-186 | crates/dim-cli/src/management/mcp.rs:844-849 | crates/dim-cli/src/management/workflow.rs:293-298 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) crates/dim-app-server/src/mcp/auth/oauth.rs:643 — crates/dim-app-server/src/mcp/auth/oauth.rs:643-645 | crates/dim-app-server/src/web_entry.rs:467-469 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) crates/dim-cli/src/ui/settings_panel.rs:104 — crates/dim-cli/src/ui/settings_panel.rs:104-106 | crates/dim-goal/src/fold.rs:910-915 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) crates/dim-app-server/src/hooks_settings.rs:590 — crates/dim-app-server/src/hooks_settings.rs:590-593 | crates/dim-app-server/src/mcp.rs:582-585 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/dim-app-server/src/provider.rs:3009 — crates/dim-app-server/src/provider.rs:3009-3012 | crates/dim-oauth/src/lib.rs:1159-1163 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) crates/dim-agent-capabilities/src/history.rs:1375 — crates/dim-agent-capabilities/src/history.rs:1375-1398 | crates/dim-agent-capabilities/src/history.rs:1424-1448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/history.rs:1375` 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 (24 lines × 2) crates/dim-app-server/src/web_entry/uploads.rs:300 — crates/dim-app-server/src/web_entry/uploads.rs:300-323 | crates/dim-app-server/src/web_entry/uploads.rs:428-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/web_entry/uploads.rs:300` 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 (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/pending.rs:156 — crates/dim-agent-capabilities/src/workspace_tools/pending.rs:156-175 | crates/dim-app-server/src/collaboration/pending.rs:239-258 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/pending.rs:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) crates/dim-app-server/src/provider/editing.rs:680 — crates/dim-app-server/src/provider/editing.rs:680-699 | crates/dim-app-server/src/provider/remote.rs:195-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider/editing.rs:680` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/provider/remote.rs:194` calls `clone` and `crates/dim-app-server/src/provider/editing.rs:679` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) crates/dim-cli/src/ui/plugins_panel.rs:134 — crates/dim-cli/src/ui/plugins_panel.rs:134-152 | crates/dim-cli/src/ui/runtime_panel.rs:182-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-cli/src/ui/plugins_panel.rs:134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/dim-cli/src/modality/task.rs:347 — crates/dim-cli/src/modality/task.rs:347-365 | crates/dim-cli/src/modality/task.rs:446-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/modality/task.rs:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) crates/dim-agent-capabilities/src/context_preparation.rs:485 — crates/dim-agent-capabilities/src/context_preparation.rs:485-500 | crates/dim-agent-capabilities/src/model_provider.rs:166-181 | crates/dim-agent-capabilities/src/tool_executor.rs:953-968 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:485` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) crates/dim-agent-capabilities/src/context_preparation.rs:507 — crates/dim-agent-capabilities/src/context_preparation.rs:507-522 | crates/dim-agent-capabilities/src/model_provider.rs:188-203 | crates/dim-agent-capabilities/src/tool_executor.rs:975-990 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:507` 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–15 lines × 2) · ×2
  • Duplicated block (13–15 lines × 2) crates/dim-agent-capabilities/src/context_policy.rs:2238 — crates/dim-agent-capabilities/src/context_policy.rs:2238-2250 | xtask/src/summary_eval.rs:1042-1056 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:2238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–15 lines × 2) crates/dim-app-server/src/managed_oauth.rs:716 — crates/dim-app-server/src/managed_oauth.rs:716-730 | crates/dim-app-server/src/managed_oauth.rs:1061-1073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/managed_oauth.rs:716` 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 (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) crates/dim-agent-capabilities/src/recall/search.rs:686 — crates/dim-agent-capabilities/src/recall/search.rs:686-696 | crates/dim-agent-capabilities/src/recall/search.rs:886-896 | crates/dim-agent-capabilities/src/recall/search.rs:1111-1121 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:686` 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, `crates/dim-agent-capabilities/src/recall/search.rs:697` calls `sequence` and `crates/dim-agent-capabilities/src/recall/search.rs:1122` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) crates/dim-app-server/src/connection/tree.rs:1512 — crates/dim-app-server/src/connection/tree.rs:1512-1522 | crates/dim-app-server/src/connection/tree.rs:1616-1626 | crates/dim-app-server/src/connection/tree.rs:1693-1703 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/connection/tree.rs:1512` 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–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) crates/dim-app-server/src/mcp.rs:1238 — crates/dim-app-server/src/mcp.rs:1238-1248 | crates/dim-app-server/src/mcp.rs:1268-1276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/mcp.rs:1238` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/mcp.rs:1237` calls `Err`, `remove_secret` and `crates/dim-app-server/src/mcp.rs:1268` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–11 lines × 2) crates/dim-cli/src/ui/tui.rs:330 — crates/dim-cli/src/ui/tui.rs:330-338 | crates/dim-cli/src/ui/tui.rs:774-784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) crates/dim-agent-runtime/src/agent.rs:510 — crates/dim-agent-runtime/src/agent.rs:510-515 | crates/dim-agent-runtime/src/agent.rs:525-530 | crates/dim-agent-runtime/src/agent.rs:540-545 | crates/dim-agent-runtime/src/agent.rs:557-562 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 4) REDACTED:1348 — REDACTED:1348-1353 | REDACTED:1381-1386 | REDACTED:1432-1437 | REDACTED:1481-1486 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1348` 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.
R10 · Code Duplication · Duplicated block with local edits (7 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (7 matched lines × 2 locations) scripts/build-all.mjs:12 — scripts/build-all.mjs:12 · scripts/publish-alpha.mjs:5 — the two spans are one implementation copied and then locally edited — 51 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 (7 matched lines × 2 locations) web/src/features/chat/ApprovalPrompt.vue:55 — web/src/features/chat/ApprovalPrompt.vue:55 · web/src/features/chat/TimelineWorkItem.vue:35 — the two spans are one implementation copied and then locally edited — 73 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.
X2 · Cancellation propagation · Async function without AbortSignal · ×2
  • Async function without AbortSignal: diagnoseRefusal web/src/rpc/client.ts:154 — `diagnoseRefusal` 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: exchangeBootstrapToken web/src/rpc/client.ts:224 — `exchangeBootstrapToken` 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 })`.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark web/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>.
D1 · Cyclomatic Complexity · Narrative · ×1
  • Narrative::fold (cyclomatic 73) crates/dim-agent-capabilities/src/recall.rs:423 — Narrative::fold has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent 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 · SqliteStorage · ×1
  • SqliteStorage::open_reporting (cyclomatic 61) REDACTED:1268 — SqliteStorage::open_reporting has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Source · ×1
  • Source::session (cyclomatic 55) crates/dim-migration/src/source.rs:515 — Source::session 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.
D1 · Cyclomatic Complexity · InputQueue · ×1
  • InputQueue::rebuild (cyclomatic 47) crates/dim-agent-capabilities/src/input_queue/recovery.rs:121 — InputQueue::rebuild has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Workflow.executeStage (cyclomatic 47) · ×1
  • Workflow.executeStage (cyclomatic 47) runtime/plugins/workflow/engine.ts:261 — Workflow.executeStage has cyclomatic complexity 47 (threshold 15). Of this number, 41 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · read.content (cyclomatic 47) · ×1
  • read.content (cyclomatic 47) web/src/rpc/read.ts:602 — read.content has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Permission · ×1
  • Permission::decide (cyclomatic 46) crates/dim-agent-capabilities/src/permission.rs:320 — Permission::decide has cyclomatic complexity 46 (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 · ShellScan · ×1
  • ShellScan::text (cyclomatic 46) crates/dim-agent-capabilities/src/workspace_tools/exec.rs:582 — ShellScan::text 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 · Projection.apply (cyclomatic 44) · ×1
  • Projection.apply (cyclomatic 44) web/src/projection.ts:113 — Projection.apply has cyclomatic complexity 44 (threshold 15). Of this number, 43 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 · Approval · ×1
  • Approval::admit (cyclomatic 42) crates/dim-agent-capabilities/src/approval.rs:111 — Approval::admit has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AimuxDriver · ×1
  • AimuxDriver::invoke (cyclomatic 37) crates/dim-agent-aimux/src/driver.rs:526 — AimuxDriver::invoke has cyclomatic complexity 37 (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 · Decoder · ×1
  • Decoder::next (cyclomatic 36) crates/dim-cli/src/composer.rs:651 — Decoder::next 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.
D1 · Cyclomatic Complexity · StageHistory.read (cyclomatic 36) · ×1
  • StageHistory.read (cyclomatic 36) runtime/plugins/workflow/history.ts:25 — StageHistory.read has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ToolExecutorPlugin · ×1
  • ToolExecutorPlugin::apply (cyclomatic 35) crates/dim-agent-capabilities/src/tool_executor.rs:282 — ToolExecutorPlugin::apply 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.
D1 · Cyclomatic Complexity · ListPanel · ×1
  • ListPanel::render_with_footer (cyclomatic 34) crates/dim-cli/src/ui/list_panel.rs:414 — ListPanel::render_with_footer 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 · ModalityTasks · ×1
  • ModalityTasks::submit (cyclomatic 34) crates/dim-modality/src/engine.rs:886 — ModalityTasks::submit has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · chat.useChatStore.applyNotification (cyclomatic 32) · ×1
  • chat.useChatStore.applyNotification (cyclomatic 32) web/src/stores/chat.ts:273 — chat.useChatStore.applyNotification has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TemporaryMcp · ×1
  • TemporaryMcp::apply (cyclomatic 31) crates/dim-app-server/src/mcp/temporary.rs:127 — TemporaryMcp::apply 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.
D1 · Cyclomatic Complexity · MarkdownRenderer · ×1
  • MarkdownRenderer::render (cyclomatic 31) crates/dim-cli/src/ui/render/markdown.rs:163 — MarkdownRenderer::render 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.
D1 · Cyclomatic Complexity · PromptPlugin · ×1
  • PromptPlugin::apply (cyclomatic 30) crates/dim-agent-capabilities/src/prompt.rs:769 — PromptPlugin::apply 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.
D1 · Cyclomatic Complexity · AskUserPrompt · ×1
  • AskUserPrompt::handle_key (cyclomatic 30) crates/dim-cli/src/ui/prompts.rs:1303 — AskUserPrompt::handle_key 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.
D1 · Cyclomatic Complexity · read.askQuestion (cyclomatic 30) · ×1
  • read.askQuestion (cyclomatic 30) web/src/rpc/read.ts:733 — read.askQuestion has cyclomatic complexity 30 (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 · LoopMethodsPlugin · ×1
  • LoopMethodsPlugin::apply (cyclomatic 29) crates/dim-agent-capabilities/src/agent_loop/read.rs:41 — LoopMethodsPlugin::apply has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Command · ×1
  • Command::parse (cyclomatic 29) crates/dim-app-server/src/plugin_manager/tools.rs:136 — Command::parse 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.
D1 · Cyclomatic Complexity · Index · ×1
  • Index::update (cyclomatic 29) crates/dim-image-understanding/src/history.rs:66 — Index::update 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 · chat.useChatStore.sync (cyclomatic 29) · ×1
  • chat.useChatStore.sync (cyclomatic 29) web/src/stores/chat.ts:181 — chat.useChatStore.sync 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 · TimelineStoreBinding · ×1
  • TimelineStoreBinding::invoke (cyclomatic 28) crates/dim-agent-runtime/src/timeline_store_face.rs:333 — TimelineStoreBinding::invoke 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 · Display · ×1
  • Display::event (cyclomatic 28) crates/dim-cli/src/display.rs:163 — Display::event 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.
D1 · Cyclomatic Complexity · Owners · ×1
  • Owners::register (cyclomatic 27) crates/dim-app-server/src/plugin_manager.rs:846 — Owners::register has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store · ×1
  • Store::invoke (cyclomatic 27) crates/dim-app-server/src/storage/face.rs:292 — Store::invoke 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.
D1 · Cyclomatic Complexity · TransportPlugin · ×1
  • TransportPlugin::apply (cyclomatic 27) crates/dim-app-server/src/transport.rs:356 — TransportPlugin::apply 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.
D1 · Cyclomatic Complexity · Draft · ×1
  • Draft::prepare (cyclomatic 27) crates/dim-cli/src/composer.rs:466 — Draft::prepare has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TimelinePanel · ×1
  • TimelinePanel::handle_key (cyclomatic 27) crates/dim-cli/src/ui/timeline_panel.rs:119 — TimelinePanel::handle_key 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.
D1 · Cyclomatic Complexity · ManagementPanel · ×1
  • ManagementPanel::handle_key (cyclomatic 26) crates/dim-cli/src/ui/management_panel.rs:406 — ManagementPanel::handle_key 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.
D1 · Cyclomatic Complexity · Workflow.drive (cyclomatic 25) · ×1
  • Workflow.drive (cyclomatic 25) runtime/plugins/workflow/engine.ts:178 — Workflow.drive has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfigurationPublisher · ×1
  • ConfigurationPublisher::publish (cyclomatic 24) crates/dim-agent-capabilities/src/context_preparation.rs:57 — ConfigurationPublisher::publish 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 · ModelProvider · ×1
  • ModelProvider::rebuild (cyclomatic 24) crates/dim-agent-capabilities/src/model_provider.rs:155 — ModelProvider::rebuild 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 · AimuxModels · ×1
  • AimuxModels::from_config (cyclomatic 23) crates/dim-agent-aimux/src/models.rs:37 — AimuxModels::from_config 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 · QuerySpec · ×1
  • QuerySpec::validate (cyclomatic 23) crates/dim-agent-runtime/src/timeline_query/properties.rs:377 — QuerySpec::validate has cyclomatic complexity 23 (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 · Collaboration · ×1
  • Collaboration::establish (cyclomatic 23) crates/dim-app-server/src/collaboration.rs:270 — Collaboration::establish 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 · SessionStore · ×1
  • SessionStore::catalog (cyclomatic 23) crates/dim-app-server/src/storage/catalog.rs:208 — SessionStore::catalog 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.
D1 · Cyclomatic Complexity · Search · ×1
  • Search::open_turn (cyclomatic 22) crates/dim-agent-capabilities/src/recall/search.rs:262 — Search::open_turn 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 · ShellInput · ×1
  • ShellInput::supervise (cyclomatic 22) crates/dim-agent-capabilities/src/shell_input.rs:295 — ShellInput::supervise 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 · FileSearch · ×1
  • FileSearch::multiline_file (cyclomatic 22) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:1125 — FileSearch::multiline_file 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 · Service · ×1
  • Service::complete_browser_inner (cyclomatic 22) crates/dim-app-server/src/managed_oauth.rs:655 — Service::complete_browser_inner has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Manager · ×1
  • Manager::list (cyclomatic 22) crates/dim-app-server/src/plugin_manager.rs:2150 — Manager::list 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 · Mentions · ×1
  • Mentions::candidates (cyclomatic 22) crates/dim-cli/src/ui/composer/mentions.rs:389 — Mentions::candidates 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 · ModalityPlugin · ×1
  • ModalityPlugin::apply (cyclomatic 22) crates/dim-modality/src/lib.rs:1231 — ModalityPlugin::apply 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 · Branch · ×1
  • Branch::follow_up_round (cyclomatic 21) crates/dim-agent-capabilities/src/hooks/runner.rs:1458 — Branch::follow_up_round has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShellSession · ×1
  • ShellSession::ensure_shell (cyclomatic 21) crates/dim-agent-capabilities/src/shell_session.rs:503 — ShellSession::ensure_shell has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Loops · ×1
  • Loops::evaluate (cyclomatic 21) crates/dim-agent-scheduler/src/loops.rs:766 — Loops::evaluate has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Wakeups · ×1
  • Wakeups::evaluate (cyclomatic 21) crates/dim-agent-scheduler/src/wakeups.rs:345 — Wakeups::evaluate has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Package · ×1
  • Package::read (cyclomatic 21) crates/dim-app-server/src/ui_extensions/manifest.rs:75 — Package::read has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Input · ×1
  • Input::line (cyclomatic 21) crates/dim-cli/src/input.rs:247 — Input::line has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IsolationPanel · ×1
  • IsolationPanel::handle_key (cyclomatic 21) crates/dim-cli/src/ui/isolation_panel.rs:125 — IsolationPanel::handle_key has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp-form.patch (cyclomatic 21) · ×1
  • mcp-form.patch (cyclomatic 21) web/src/features/settings/mcp-form.ts:36 — mcp-form.patch has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs 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 · Fold · ×1
  • Fold::step_input (cyclomatic 20) crates/dim-goal/src/fold.rs:590 — Fold::step_input 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 · PromptSourcesBranchPlugin · ×1
  • PromptSourcesBranchPlugin::apply (cyclomatic 19) crates/dim-agent-capabilities/src/prompt_sources.rs:658 — PromptSourcesBranchPlugin::apply 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.
D1 · Cyclomatic Complexity · Loop · ×1
  • Loop::validate (cyclomatic 19) crates/dim-agent-scheduler/src/loops.rs:178 — Loop::validate 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 · SchedulerPlugin · ×1
  • SchedulerPlugin::apply (cyclomatic 19) crates/dim-agent-scheduler/src/methods.rs:104 — SchedulerPlugin::apply 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 · dim_event_hub · ×1
  • dim_event_hub::model::validate_publish (cyclomatic 19) crates/dim-event-hub/src/model.rs:240 — dim_event_hub::model::validate_publish 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 · Screen · ×1
  • Screen::draw (cyclomatic 19) crates/dim-migration/src/terminal.rs:127 — Screen::draw 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 · Workflow.prune (cyclomatic 19) · ×1
  • Workflow.prune (cyclomatic 19) runtime/plugins/workflow/engine.ts:449 — Workflow.prune has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · read.readNotification (cyclomatic 19) · ×1
  • read.readNotification (cyclomatic 19) web/src/rpc/read.ts:822 — read.readNotification 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 · ContextPreparation · ×1
  • ContextPreparation::rebuild (cyclomatic 18) crates/dim-agent-capabilities/src/context_preparation.rs:474 — ContextPreparation::rebuild 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 · ContextPreparationPlugin · ×1
  • ContextPreparationPlugin::apply (cyclomatic 18) crates/dim-agent-capabilities/src/context_preparation.rs:1019 — ContextPreparationPlugin::apply 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 · RuntimeManagerPlugin · ×1
  • RuntimeManagerPlugin::apply (cyclomatic 18) crates/dim-app-server/src/runtime_manager.rs:1793 — RuntimeManagerPlugin::apply 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 · Parts · ×1
  • Parts::new (cyclomatic 18) crates/dim-app-server/src/session_typescript.rs:204 — Parts::new 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 · Sanitizer · ×1
  • Sanitizer::character (cyclomatic 18) crates/dim-cli/src/sanitize.rs:18 — Sanitizer::character 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 · dim_report · ×1
  • dim_report::render::review (cyclomatic 18) crates/dim-report/src/render.rs:58 — dim_report::render::review 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 · Table · ×1
  • Table::new (cyclomatic 18) xtask/src/catalog.rs:156 — Table::new 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 · HistoryWindow.push (cyclomatic 18) · ×1
  • HistoryWindow.push (cyclomatic 18) web/src/history-window.ts:41 — HistoryWindow.push has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Part · ×1
  • Part::receive (cyclomatic 17) crates/dim-agent-capabilities/src/prompt_suggestion.rs:785 — Part::receive 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 · Agent · ×1
  • Agent::create (cyclomatic 17) crates/dim-agent-runtime/src/agent.rs:139 — Agent::create 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 · QueryFilter · ×1
  • QueryFilter::validate (cyclomatic 17) crates/dim-agent-runtime/src/timeline_query/properties.rs:454 — QueryFilter::validate 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 · Job · ×1
  • Job::validate (cyclomatic 17) crates/dim-agent-scheduler/src/document.rs:286 — Job::validate 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 · dim_agent_scheduler · ×1
  • dim_agent_scheduler::engine::prune_once (cyclomatic 17) crates/dim-agent-scheduler/src/engine.rs:547 — dim_agent_scheduler::engine::prune_once has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · McpAuth · ×1
  • McpAuth::exchange (cyclomatic 17) crates/dim-app-server/src/mcp/auth.rs:493 — McpAuth::exchange 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 · McpService · ×1
  • McpService::move_entry (cyclomatic 17) crates/dim-app-server/src/mcp.rs:1166 — McpService::move_entry 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 · ProviderPatch · ×1
  • ProviderPatch::apply (cyclomatic 17) crates/dim-app-server/src/provider/editing.rs:258 — ProviderPatch::apply 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 · StartupConnectionInput · ×1
  • StartupConnectionInput::admit (cyclomatic 17) crates/dim-app-server/src/provider/startup.rs:88 — StartupConnectionInput::admit 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 · Archive · ×1
  • Archive::read (cyclomatic 17) crates/dim-migration/src/archives.rs:39 — Archive::read 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.
D1 · Cyclomatic Complexity · dim_modality_aimux · ×1
  • dim_modality_aimux::realtime::serve (cyclomatic 17) crates/dim-modality-aimux/src/realtime.rs:241 — dim_modality_aimux::realtime::serve 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.
D1 · Cyclomatic Complexity · store.runSchema (cyclomatic 17) · ×1
  • store.runSchema (cyclomatic 17) runtime/plugins/workflow/store.ts:38 — store.runSchema has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · chat.useChatStore.loadHistory (cyclomatic 17) · ×1
  • chat.useChatStore.loadHistory (cyclomatic 17) web/src/stores/chat.ts:481 — chat.useChatStore.loadHistory 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 · models.useModels (cyclomatic 17) · ×1
  • models.useModels (cyclomatic 17) web/src/stores/models.ts:10 — models.useModels has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (load, refresh, defaultFor). 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 · SkillsCatalog · ×1
  • SkillsCatalog::install (cyclomatic 16) crates/dim-agent-capabilities/src/skills/catalog.rs:462 — SkillsCatalog::install 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 · Session · ×1
  • Session::finish (cyclomatic 16) crates/dim-agent-runtime/src/agent.rs:804 — Session::finish 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 · LoopTool · ×1
  • LoopTool::execute (cyclomatic 16) crates/dim-agent-scheduler/src/session.rs:771 — LoopTool::execute 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 · RuntimeService · ×1
  • RuntimeService::install (cyclomatic 16) crates/dim-app-server/src/runtime_manager.rs:861 — RuntimeService::install 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 · SkillsCatalogPlugin · ×1
  • SkillsCatalogPlugin::apply (cyclomatic 16) crates/dim-app-server/src/skills_management.rs:626 — SkillsCatalogPlugin::apply 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 · Files · ×1
  • Files::put (cyclomatic 16) crates/dim-app-server/src/storage/files.rs:739 — Files::put 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 · Markdown · ×1
  • Markdown::event (cyclomatic 16) crates/dim-cli/src/export.rs:183 — Markdown::event 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 · PermissionPrompt · ×1
  • PermissionPrompt::render_sized (cyclomatic 16) crates/dim-cli/src/ui/prompts.rs:550 — PermissionPrompt::render_sized 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: PermissionPrompt::handle_key (cyclomatic 19) 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 · dim_codemode · ×1
  • dim_codemode::interpreter::run_program (cyclomatic 16) crates/dim-codemode/src/interpreter.rs:63 — dim_codemode::interpreter::run_program 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 · dim_goal · ×1
  • dim_goal::fold::change_of (cyclomatic 16) crates/dim-goal/src/fold.rs:182 — dim_goal::fold::change_of 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 · ImageUnderstanding · ×1
  • ImageUnderstanding::ask (cyclomatic 16) crates/dim-image-understanding/src/lib.rs:96 — ImageUnderstanding::ask 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 · Workflow.admit (cyclomatic 16) · ×1
  • Workflow.admit (cyclomatic 16) runtime/plugins/workflow/engine.ts:230 — Workflow.admit has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · line-state.approvalKeyDecision (cyclomatic 16) · ×1
  • line-state.approvalKeyDecision (cyclomatic 16) web/src/features/lines/line-state.ts:71 — line-state.approvalKeyDecision has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · chat.useChatStore.applyEvent (cyclomatic 16) · ×1
  • chat.useChatStore.applyEvent (cyclomatic 16) web/src/stores/chat.ts:351 — chat.useChatStore.applyEvent 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×1
  • Fixed-sleep synchronisation: two concurrent updates serialize on the stage lock scripts/release.test.mjs:348 — This test starts work it did not wait for (`first`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve)=>setTimeout(resolve,20))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D2 · Cognitive Complexity · InputQueue · ×1
  • InputQueue::rebuild (cognitive 137) crates/dim-agent-capabilities/src/input_queue/recovery.rs:121 — InputQueue::rebuild has cognitive complexity 137 (threshold 15). Drivers by points: if/else 33 (99 pts), loops 7 (17 pts), match/switch 4 (14 pts), boolean chains 7 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqliteStorage · ×1
  • SqliteStorage::open_reporting (cognitive 134) REDACTED:1268 — SqliteStorage::open_reporting has cognitive complexity 134 (threshold 15). Drivers by points: if/else 36 (84 pts), loops 8 (32 pts), boolean chains 15, match/switch 2 (3 pts) (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Narrative · ×1
  • Narrative::fold (cognitive 118) crates/dim-agent-capabilities/src/recall.rs:423 — Narrative::fold has cognitive complexity 118 (threshold 15). Drivers by points: if/else 28 (87 pts), match/switch 4 (15 pts), boolean chains 8, loops 6 (8 pts) (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Index · ×1
  • Index::update (cognitive 96) crates/dim-image-understanding/src/history.rs:66 — Index::update has cognitive complexity 96 (threshold 15). Drivers by points: if/else 16 (68 pts), loops 6 (22 pts), boolean chains 3, match/switch 1 (3 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.
D2 · Cognitive Complexity · Workflow.executeStage (cognitive 76) · ×1
  • Workflow.executeStage (cognitive 76) runtime/plugins/workflow/engine.ts:261 — Workflow.executeStage has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (59 pts), boolean chains 13, loops 3 (4 pts) (nesting depth added 35). Of this number, 68 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StageHistory.read (cognitive 72) · ×1
  • StageHistory.read (cognitive 72) runtime/plugins/workflow/history.ts:25 — StageHistory.read has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (56 pts), boolean chains 11, loops 2 (3 pts), ternaries 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 · Approval · ×1
  • Approval::admit (cognitive 71) crates/dim-agent-capabilities/src/approval.rs:111 — Approval::admit has cognitive complexity 71 (threshold 15). Drivers by points: if/else 17 (44 pts), match/switch 9 (19 pts), loops 3 (6 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · ModelProvider · ×1
  • ModelProvider::rebuild (cognitive 69) crates/dim-agent-capabilities/src/model_provider.rs:155 — ModelProvider::rebuild has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (49 pts), loops 4 (10 pts), match/switch 3 (10 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Permission · ×1
  • Permission::decide (cognitive 65) crates/dim-agent-capabilities/src/permission.rs:320 — Permission::decide has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 13 (25 pts), boolean chains 10 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemporaryMcp · ×1
  • TemporaryMcp::apply (cognitive 59) crates/dim-app-server/src/mcp/temporary.rs:127 — TemporaryMcp::apply has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 5 (8 pts), match/switch 3 (7 pts), boolean chains 2 (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 · MarkdownRenderer · ×1
  • MarkdownRenderer::render (cognitive 59) crates/dim-cli/src/ui/render/markdown.rs:163 — MarkdownRenderer::render has cognitive complexity 59 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 7 (16 pts), boolean chains 8, match/switch 2 (7 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListPanel · ×1
  • ListPanel::render_with_footer (cognitive 58) crates/dim-cli/src/ui/list_panel.rs:414 — ListPanel::render_with_footer has cognitive complexity 58 (threshold 15). Drivers by points: if/else 32 (43 pts), loops 4 (9 pts), boolean chains 4, match/switch 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolExecutorPlugin · ×1
  • ToolExecutorPlugin::apply (cognitive 57) crates/dim-agent-capabilities/src/tool_executor.rs:282 — ToolExecutorPlugin::apply has cognitive complexity 57 (threshold 15). Drivers by points: if/else 29 (41 pts), match/switch 4 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransportPlugin · ×1
  • TransportPlugin::apply (cognitive 54) crates/dim-app-server/src/transport.rs:356 — TransportPlugin::apply has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 14 (33 pts), if/else 8 (16 pts), loops 3 (5 pts) (nesting depth added 29). 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 · Projection.apply (cognitive 53) · ×1
  • Projection.apply (cognitive 53) web/src/projection.ts:113 — Projection.apply has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 10 (27 pts), if/else 9 (18 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 29). Of this number, 52 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoopMethodsPlugin · ×1
  • LoopMethodsPlugin::apply (cognitive 51) crates/dim-agent-capabilities/src/agent_loop/read.rs:41 — LoopMethodsPlugin::apply has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (34 pts), match/switch 5 (11 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AimuxModels · ×1
  • AimuxModels::from_config (cognitive 44) crates/dim-agent-aimux/src/models.rs:37 — AimuxModels::from_config has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 7, loops 3 (5 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 · Decoder · ×1
  • Decoder::next (cognitive 44) crates/dim-cli/src/composer.rs:651 — Decoder::next has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 5 (16 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · read.content (cognitive 44) · ×1
  • read.content (cognitive 44) web/src/rpc/read.ts:602 — read.content has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 14 (29 pts), if/else 4 (9 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · Workflow.drive (cognitive 43) · ×1
  • Workflow.drive (cognitive 43) runtime/plugins/workflow/engine.ts:178 — Workflow.drive has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (9 pts), ternaries 3 (6 pts), error handling 2 (5 pts), boolean chains 2 (nesting depth added 22). Of this number, 20 points are the body's own statements and 23 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AimuxDriver · ×1
  • AimuxDriver::invoke (cognitive 42) crates/dim-agent-aimux/src/driver.rs:526 — AimuxDriver::invoke has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (26 pts), match/switch 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileSearch · ×1
  • FileSearch::multiline_file (cognitive 42) crates/dim-agent-capabilities/src/workspace_tools/files/search.rs:1125 — FileSearch::multiline_file has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 3, loops 2, match/switch 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.
D2 · Cognitive Complexity · ModalityTasks · ×1
  • ModalityTasks::submit (cognitive 42) crates/dim-modality/src/engine.rs:886 — ModalityTasks::submit has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (30 pts), match/switch 4 (7 pts), boolean chains 3, loops 2 (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.
D2 · Cognitive Complexity · Table · ×1
  • Table::new (cognitive 38) xtask/src/catalog.rs:156 — Table::new has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 7 (11 pts), match/switch 2 (4 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 · PromptPlugin · ×1
  • PromptPlugin::apply (cognitive 37) crates/dim-agent-capabilities/src/prompt.rs:769 — PromptPlugin::apply has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 5 (10 pts), loops 4, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginsPanel · ×1
  • PluginsPanel::render (cognitive 37) crates/dim-cli/src/ui/plugins_panel.rs:225 — PluginsPanel::render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 6 (14 pts), match/switch 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.
D2 · Cognitive Complexity · ContextPreparation · ×1
  • ContextPreparation::rebuild (cognitive 36) crates/dim-agent-capabilities/src/context_preparation.rs:474 — ContextPreparation::rebuild has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (6 pts), match/switch 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat.useChatStore.sync (cognitive 34) · ×1
  • chat.useChatStore.sync (cognitive 34) web/src/stores/chat.ts:181 — chat.useChatStore.sync has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 5 (6 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Collaboration · ×1
  • Collaboration::establish (cognitive 33) crates/dim-app-server/src/collaboration.rs:270 — Collaboration::establish has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 8 (12 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Fold · ×1
  • Fold::step_input (cognitive 33) crates/dim-goal/src/fold.rs:590 — Fold::step_input has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, loops 2 (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.
D2 · Cognitive Complexity · IsolationPanel · ×1
  • IsolationPanel::handle_key (cognitive 32) crates/dim-cli/src/ui/isolation_panel.rs:125 — IsolationPanel::handle_key has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (27 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigurationPublisher · ×1
  • ConfigurationPublisher::publish (cognitive 31) crates/dim-agent-capabilities/src/context_preparation.rs:57 — ConfigurationPublisher::publish has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, match/switch 3 (5 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShellInput · ×1
  • ShellInput::supervise (cognitive 31) crates/dim-agent-capabilities/src/shell_input.rs:295 — ShellInput::supervise has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 6 (11 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionStore · ×1
  • SessionStore::catalog (cognitive 31) crates/dim-app-server/src/storage/catalog.rs:208 — SessionStore::catalog has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (20 pts), match/switch 4 (7 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · Workflow.prune (cognitive 31) · ×1
  • Workflow.prune (cognitive 31) runtime/plugins/workflow/engine.ts:449 — Workflow.prune has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 13). Of this number, 22 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat.useChatStore.applyNotification (cognitive 31) · ×1
  • chat.useChatStore.applyNotification (cognitive 31) web/src/stores/chat.ts:273 — chat.useChatStore.applyNotification has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, loops 1 (2 pts), match/switch 1 (nesting depth added 11). Of this number, 30 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. 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 · PromptSourcesBranchPlugin · ×1
  • PromptSourcesBranchPlugin::apply (cognitive 30) crates/dim-agent-capabilities/src/prompt_sources.rs:658 — PromptSourcesBranchPlugin::apply has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 8 (18 pts), if/else 4 (9 pts), loops 2 (3 pts) (nesting depth added 16). 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 · Parts · ×1
  • Parts::new (cognitive 30) crates/dim-app-server/src/session_typescript.rs:204 — Parts::new has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (5 pts), match/switch 2 (5 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 · definition.issues (cognitive 30) · ×1
  • definition.issues (cognitive 30) runtime/plugins/workflow/definition.ts:73 — definition.issues has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (6 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 16). Of this number, 22 points are the body's own statements and 8 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 · ProviderPatch · ×1
  • ProviderPatch::apply (cognitive 29) crates/dim-app-server/src/provider/editing.rs:258 — ProviderPatch::apply has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 3 (9 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimePanel · ×1
  • RuntimePanel::render (cognitive 29) crates/dim-cli/src/ui/runtime_panel.rs:245 — RuntimePanel::render has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (20 pts), if/else 5 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · read.askQuestion (cognitive 29) · ×1
  • read.askQuestion (cognitive 29) web/src/rpc/read.ts:733 — read.askQuestion has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 12, ternaries 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimelineStoreBinding · ×1
  • TimelineStoreBinding::invoke (cognitive 28) crates/dim-agent-runtime/src/timeline_store_face.rs:333 — TimelineStoreBinding::invoke has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 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.
D2 · Cognitive Complexity · Package · ×1
  • Package::read (cognitive 28) crates/dim-app-server/src/ui_extensions/manifest.rs:75 — Package::read has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 9, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Display · ×1
  • Display::event (cognitive 27) crates/dim-cli/src/display.rs:163 — Display::event has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (8 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsSnapshotBranch · ×1
  • SettingsSnapshotBranch::apply (cognitive 26) crates/dim-agent-capabilities/src/execution_settings/prompt.rs:238 — SettingsSnapshotBranch::apply has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 5 (10 pts), boolean chains 1, 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 · Asking · ×1
  • Asking::answer (cognitive 26) crates/dim-cli/src/question/line.rs:553 — Asking::answer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionTitle · ×1
  • SessionTitle::apply (cognitive 26) crates/dim-session-title/src/lib.rs:178 — SessionTitle::apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (7 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.
D2 · Cognitive Complexity · work.groupRows (cognitive 26) · ×1
  • work.groupRows (cognitive 26) web/src/features/chat/work.ts:31 — work.groupRows has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 5 (8 pts), boolean chains 1, loops 1 (nesting depth added 14). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuerySpec · ×1
  • QuerySpec::validate (cognitive 25) crates/dim-agent-runtime/src/timeline_query/properties.rs:377 — QuerySpec::validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, loops 3 (4 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.
D2 · Cognitive Complexity · Command · ×1
  • Command::parse (cognitive 25) crates/dim-app-server/src/plugin_manager/tools.rs:136 — Command::parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (10 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Mentions · ×1
  • Mentions::candidates (cognitive 25) crates/dim-cli/src/ui/composer/mentions.rs:389 — Mentions::candidates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, match/switch 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat.useChatStore.loadHistory (cognitive 24) · ×1
  • chat.useChatStore.loadHistory (cognitive 24) web/src/stores/chat.ts:481 — chat.useChatStore.loadHistory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HooksRuntime · ×1
  • HooksRuntime::run_ordered (cognitive 23) crates/dim-agent-capabilities/src/hooks/runner.rs:280 — HooksRuntime::run_ordered has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (10 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 · Session · ×1
  • Session::finish (cognitive 23) crates/dim-agent-runtime/src/agent.rs:804 — Session::finish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2 (4 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.
D2 · Cognitive Complexity · Timeline · ×1
  • Timeline::checkpoint (cognitive 23) crates/dim-agent-runtime/src/core/timeline.rs:793 — Timeline::checkpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 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 · TimelineContext · ×1
  • TimelineContext::start (cognitive 23) crates/dim-agent-runtime/src/timeline_context.rs:153 — TimelineContext::start has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (8 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · Wakeups · ×1
  • Wakeups::evaluate (cognitive 23) crates/dim-agent-scheduler/src/wakeups.rs:345 — Wakeups::evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5, match/switch 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeManagerPlugin · ×1
  • RuntimeManagerPlugin::apply (cognitive 23) crates/dim-app-server/src/runtime_manager.rs:1793 — RuntimeManagerPlugin::apply has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (9 pts), match/switch 3 (8 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Markdown · ×1
  • Markdown::event (cognitive 23) crates/dim-cli/src/export.rs:183 — Markdown::event has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (8 pts), match/switch 2 (5 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Archive · ×1
  • Archive::read (cognitive 23) crates/dim-migration/src/archives.rs:39 — Archive::read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (9 pts), loops 2, 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 · PartMounter · ×1
  • PartMounter::apply (cognitive 22) crates/dim-agent-runtime/src/parts.rs:444 — PartMounter::apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (5 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Excerpt · ×1
  • Excerpt::push (cognitive 22) crates/dim-cli/src/projection/thinking.rs:18 — Excerpt::push has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PermissionPrompt · ×1
  • PermissionPrompt::render_sized (cognitive 22) crates/dim-cli/src/ui/prompts.rs:550 — PermissionPrompt::render_sized has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2, 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 · Native · ×1
  • Native::fill (cognitive 22) crates/dim-migration/src/native.rs:179 — Native::fill 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.
D2 · Cognitive Complexity · dim_modality_aimux · ×1
  • dim_modality_aimux::realtime::serve (cognitive 22) crates/dim-modality-aimux/src/realtime.rs:241 — dim_modality_aimux::realtime::serve has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 4 (10 pts), loops 1 (nesting depth added 12). 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 · SkillsPlugin · ×1
  • SkillsPlugin::apply (cognitive 21) crates/dim-agent-capabilities/src/skills/session.rs:190 — SkillsPlugin::apply has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 8 (14 pts), if/else 2 (5 pts), loops 2 (nesting depth added 9). 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 · Loop · ×1
  • Loop::validate (cognitive 21) crates/dim-agent-scheduler/src/loops.rs:178 — Loop::validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · McpAuth · ×1
  • McpAuth::exchange (cognitive 21) crates/dim-app-server/src/mcp/auth.rs:493 — McpAuth::exchange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 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.
D2 · Cognitive Complexity · Capture · ×1
  • Capture::receive (cognitive 21) crates/dim-client/src/callback.rs:38 — Capture::receive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModalityPlugin · ×1
  • ModalityPlugin::apply (cognitive 21) crates/dim-modality/src/lib.rs:1231 — ModalityPlugin::apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 10). 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 · ContextPreparationPlugin · ×1
  • ContextPreparationPlugin::apply (cognitive 20) crates/dim-agent-capabilities/src/context_preparation.rs:1019 — ContextPreparationPlugin::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 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.
D2 · Cognitive Complexity · InputMethodsPlugin · ×1
  • InputMethodsPlugin::apply (cognitive 20) crates/dim-agent-capabilities/src/input_queue.rs:668 — InputMethodsPlugin::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (6 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 · Contents · ×1
  • Contents::reconcile (cognitive 20) crates/dim-agent-capabilities/src/skills/content.rs:107 — Contents::reconcile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, 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 · SchedulerPlugin · ×1
  • SchedulerPlugin::apply (cognitive 20) crates/dim-agent-scheduler/src/methods.rs:104 — SchedulerPlugin::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, loops 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.
D2 · Cognitive Complexity · PluginsDir · ×1
  • PluginsDir::clean (cognitive 20) crates/dim-app-server/src/plugin_manager/acquire.rs:227 — PluginsDir::clean has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dim_codemode · ×1
  • dim_codemode::interpreter::run_program (cognitive 20) crates/dim-codemode/src/interpreter.rs:63 — dim_codemode::interpreter::run_program has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 5, boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Workflow.report (cognitive 20) · ×1
  • Workflow.report (cognitive 20) runtime/plugins/workflow/engine.ts:404 — Workflow.report has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, loops 1 (nesting depth added 8). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 418, 410). 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 · Catalog.directory (cognitive 20) · ×1
  • Catalog.directory (cognitive 20) runtime/plugins/workflow/catalog.ts:54 — Catalog.directory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Numeric · ×1
  • Numeric::prefix (cognitive 19) crates/dim-agent-capabilities/src/context_usage/numeric.rs:188 — Numeric::prefix has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 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 · ToolRegistry · ×1
  • ToolRegistry::refresh (cognitive 19) crates/dim-agent-capabilities/src/tool_registry.rs:476 — ToolRegistry::refresh has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (4 pts), match/switch 1 (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 · Agent · ×1
  • Agent::create (cognitive 19) crates/dim-agent-runtime/src/agent.rs:139 — Agent::create has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 4 (6 pts), 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, 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 · QueryValue · ×1
  • QueryValue::scalar_key (cognitive 19) crates/dim-agent-runtime/src/timeline_query/properties.rs:199 — QueryValue::scalar_key has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 10). 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 · LoopsFace · ×1
  • LoopsFace::invoke (cognitive 19) crates/dim-agent-scheduler/src/loops.rs:1111 — LoopsFace::invoke has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 1 (2 pts) (nesting depth added 9). 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 · UiExtensions · ×1
  • UiExtensions::copy (cognitive 19) crates/dim-app-server/src/ui_extensions/mod.rs:238 — UiExtensions::copy has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (7 pts), match/switch 2 (7 pts), if/else 1 (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.
D2 · Cognitive Complexity · Read · ×1
  • Read::feed (cognitive 19) crates/dim-cli/src/clipboard/terminal.rs:120 — Read::feed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageUnderstanding · ×1
  • ImageUnderstanding::ask (cognitive 19) crates/dim-image-understanding/src/lib.rs:96 — ImageUnderstanding::ask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (9 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 · mcp-form.patch (cognitive 19) · ×1
  • mcp-form.patch (cognitive 19) web/src/features/settings/mcp-form.ts:36 — mcp-form.patch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 4). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Worktrees · ×1
  • Worktrees::probe (cognitive 18) crates/dim-agent-capabilities/src/file_access.rs:526 — Worktrees::probe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 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 · HostPlatform · ×1
  • HostPlatform::fallback_persistent_shell (cognitive 18) crates/dim-agent-capabilities/src/host_platform.rs:2202 — HostPlatform::fallback_persistent_shell has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (4 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BranchTool · ×1
  • BranchTool::create (cognitive 18) crates/dim-agent-capabilities/src/timeline_tree.rs:3806 — BranchTool::create has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolBindingPlugin · ×1
  • ToolBindingPlugin::apply (cognitive 18) crates/dim-agent-capabilities/src/tool_binding.rs:437 — ToolBindingPlugin::apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · definition.withinDefinitionLimit · ×1
  • definition.withinDefinitionLimit::visit (cognitive 18) runtime/plugins/workflow/definition.ts:110 — definition.withinDefinitionLimit::visit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models.useModels (cognitive 18) · ×1
  • models.useModels (cognitive 18) web/src/stores/models.ts:10 — models.useModels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 2, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 3 function items inside it that branch (load, refresh, defaultFor). 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 · SkillsCatalog · ×1
  • SkillsCatalog::install (cognitive 17) crates/dim-agent-capabilities/src/skills/catalog.rs:462 — SkillsCatalog::install has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2, 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 · SummaryStrategy · ×1
  • SummaryStrategy::compact_inner (cognitive 17) crates/dim-agent-capabilities/src/summary_strategy.rs:262 — SummaryStrategy::compact_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QueryFilter · ×1
  • QueryFilter::validate (cognitive 17) crates/dim-agent-runtime/src/timeline_query/properties.rs:454 — QueryFilter::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 7). 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 · Job · ×1
  • Job::validate (cognitive 17) crates/dim-agent-scheduler/src/document.rs:286 — Job::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, match/switch 3 (4 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 · Manifest · ×1
  • Manifest::read (cognitive 17) crates/dim-app-server/src/plugin_manager/record.rs:352 — Manifest::read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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 · StartupConnectionInput · ×1
  • StartupConnectionInput::admit (cognitive 17) crates/dim-app-server/src/provider/startup.rs:88 — StartupConnectionInput::admit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, loops 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 · SessionsPanel · ×1
  • SessionsPanel::handle_key (cognitive 17) crates/dim-cli/src/ui/sessions_panel.rs:241 — SessionsPanel::handle_key has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · dim_goal · ×1
  • dim_goal::fold::change_of (cognitive 17) crates/dim-goal/src/fold.rs:182 — dim_goal::fold::change_of has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Metrics · ×1
  • Metrics::add_probes (cognitive 17) xtask/src/summary_eval.rs:1555 — Metrics::add_probes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · Subagents · ×1
  • Subagents::event (cognitive 16) crates/dim-acp/src/lody.rs:193 — Subagents::event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (7 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.
D2 · Cognitive Complexity · Bindings · ×1
  • Bindings::start (cognitive 16) crates/dim-acp/src/mcp.rs:60 — Bindings::start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextUsagePlugin · ×1
  • ContextUsagePlugin::apply (cognitive 16) crates/dim-agent-capabilities/src/context_usage.rs:1324 — ContextUsagePlugin::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · FileStorage · ×1
  • FileStorage::close (cognitive 16) crates/dim-agent-capabilities/src/file_storage.rs:646 — FileStorage::close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 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 · PtyProcessTree · ×1
  • PtyProcessTree::job_pid (cognitive 16) crates/dim-agent-capabilities/src/host_platform.rs:1970 — PtyProcessTree::job_pid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelProviderPlugin · ×1
  • ModelProviderPlugin::apply (cognitive 16) crates/dim-agent-capabilities/src/model_provider.rs:626 — ModelProviderPlugin::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 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.
D2 · Cognitive Complexity · SkillSubmitCheck · ×1
  • SkillSubmitCheck::check (cognitive 16) crates/dim-agent-capabilities/src/skills/session.rs:373 — SkillSubmitCheck::check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WakeupsFace · ×1
  • WakeupsFace::invoke (cognitive 16) crates/dim-agent-scheduler/src/wakeups.rs:528 — WakeupsFace::invoke has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 4 (7 pts) (nesting depth added 7). 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 · McpSecretEntry · ×1
  • McpSecretEntry::validate (cognitive 16) crates/dim-app-server/src/mcp/config.rs:936 — McpSecretEntry::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 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.
D2 · Cognitive Complexity · SseTransport · ×1
  • SseTransport::receive (cognitive 16) crates/dim-app-server/src/mcp/server/sse.rs:191 — SseTransport::receive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Record · ×1
  • Record::write (cognitive 16) crates/dim-app-server/src/plugin_manager/record.rs:142 — Record::write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (6 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 · Runtimes · ×1
  • Runtimes::new (cognitive 16) crates/dim-app-server/src/runtime_manager.rs:232 — Runtimes::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 4 (nesting depth added 4). 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 · Files · ×1
  • Files::sweep (cognitive 16) crates/dim-app-server/src/storage/files.rs:904 — Files::sweep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 5, loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedWorktreesPlugin · ×1
  • ManagedWorktreesPlugin::apply (cognitive 16) crates/dim-app-server/src/worktrees.rs:1195 — ManagedWorktreesPlugin::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), loops 1 (3 pts) (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 · TimelinePanel · ×1
  • TimelinePanel::handle_key (cognitive 16) crates/dim-cli/src/ui/timeline_panel.rs:119 — TimelinePanel::handle_key has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), boolean chains 5, if/else 2 (nesting depth added 4). 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 · StreamPlanner · ×1
  • StreamPlanner::plan (cognitive 16) crates/dim-cli/src/ui/transcript/stream.rs:119 — StreamPlanner::plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (4 pts), loops 3, 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 · Inner · ×1
  • Inner::poll_device (cognitive 16) crates/dim-oauth/src/lib.rs:626 — Inner::poll_device has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (7 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 · Workflow.admit (cognitive 16) · ×1
  • Workflow.admit (cognitive 16) runtime/plugins/workflow/engine.ts:230 — Workflow.admit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5, boolean chains 2 (nesting depth added 2). 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 231, 251). 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 · tool-display.resolveToolDisplay (cognitive 16) · ×1
  • tool-display.resolveToolDisplay (cognitive 16) web/src/features/chat/tool-display.ts:27 — tool-display.resolveToolDisplay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 3 (6 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpcClient.receive (cognitive 16) · ×1
  • RpcClient.receive (cognitive 16) web/src/rpc/client.ts:177 — RpcClient.receive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), error handling 2, 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.
D4 · Code Duplication · Near-duplicate member pair (104 shared lines) · ×1
  • Near-duplicate member pair (104 shared lines) crates/dim-cli/src/ui/i18n/pt_br/management.rs:1 — crates/dim-cli/src/ui/i18n/pt_br/management.rs:1-361 | crates/dim-cli/src/ui/i18n/pt_pt/management.rs:1-363 — These two members are variants of one another: 104 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 (83 shared lines) · ×1
  • Near-duplicate member pair (83 shared lines) crates/dim-agent-capabilities/src/context_preparation.rs:474 — crates/dim-agent-capabilities/src/context_preparation.rs:474-733 | crates/dim-agent-capabilities/src/model_provider.rs:155-451 — These two members are variants of one another: 83 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 (63 shared lines) · ×1
  • Near-duplicate member pair (63 shared lines) crates/dim-agent-capabilities/src/context_preparation.rs:1019 — crates/dim-agent-capabilities/src/context_preparation.rs:1019-1204 | crates/dim-agent-capabilities/src/model_provider.rs:626-784 — These two members are variants of one another: 63 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 (27 shared lines) · ×1
  • Near-duplicate member pair (27 shared lines) crates/dim-agent-capabilities/src/context_preparation.rs:779 — crates/dim-agent-capabilities/src/context_preparation.rs:779-841 | crates/dim-agent-capabilities/src/model_provider.rs:458-569 — These two members are variants of one another: 27 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 · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) crates/dim-cli/src/ui/i18n/de/mod.rs:11 — crates/dim-cli/src/ui/i18n/de/mod.rs:11-19 | crates/dim-cli/src/ui/i18n/es/mod.rs:11-19 | crates/dim-cli/src/ui/i18n/fr/mod.rs:11-19 | crates/dim-cli/src/ui/i18n/id/mod.rs:11-19 | crates/dim-cli/src/ui/i18n/ja/mod.rs:11-19 | crates/dim-cli/src/ui/i18n/ko/mod.rs:11-19 | crates/dim-cli/src/ui/i18n/pt_br/mod.rs:12-20 | crates/dim-cli/src/ui/i18n/pt_pt/mod.rs:12-20 | crates/dim-cli/src/ui/i18n/zh_cn/mod.rs:12-20 | crates/dim-cli/src/ui/i18n/zh_hant/mod.rs:12-20 — These 10 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 10 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 10 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/dim-app-server/src/collaboration/approvals.rs:732 — crates/dim-app-server/src/collaboration/approvals.rs:732-792 | crates/dim-app-server/src/exec_shell_settings.rs:53-102 | crates/dim-app-server/src/settings_methods.rs:136-211 | crates/dim-app-server/src/storage_methods.rs:37-71 | crates/dim-app-server/src/worktrees.rs:1195-1293 — 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 · Edited copy of a member (693 corresponding lines) · ×1
  • Edited copy of a member (693 corresponding lines) crates/dim-cli/src/ui/i18n/pt_br/chrome.rs:1 — crates/dim-cli/src/ui/i18n/pt_br/chrome.rs:1-693 | crates/dim-cli/src/ui/i18n/pt_pt/chrome.rs:1-703 — These two members are one piece of code written twice and then edited apart: 693 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 (181 corresponding lines) · ×1
  • Edited copy of a member (181 corresponding lines) crates/dim-cli/src/ui/i18n/pt_br/prompts.rs:1 — crates/dim-cli/src/ui/i18n/pt_br/prompts.rs:1-181 | crates/dim-cli/src/ui/i18n/pt_pt/prompts.rs:1-181 — These two members are one piece of code written twice and then edited apart: 181 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 (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) crates/dim-app-server/src/plugin_manager.rs:1709 — crates/dim-app-server/src/plugin_manager.rs:1709-1795 | crates/dim-app-server/src/plugin_manager.rs:1835-1898 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) crates/dim-agent-scheduler/src/loops.rs:1111 — crates/dim-agent-scheduler/src/loops.rs:1111-1192 | crates/dim-agent-scheduler/src/wakeups.rs:528-600 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:138 — crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:138-212 | crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:49-107 — These two members are one piece of code written twice and then edited apart: 59 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 (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) crates/dim-agent-capabilities/src/environment_clients.rs:241 — crates/dim-agent-capabilities/src/environment_clients.rs:241-298 | crates/dim-agent-capabilities/src/execution_settings/prompt.rs:238-313 — These two members are one piece of code written twice and then edited apart: 58 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 (108 corresponding lines) · ×1
  • Edited copy of a member (108 corresponding lines) crates/dim-cli/src/ui/i18n/pt_br/providers.rs:1 — crates/dim-cli/src/ui/i18n/pt_br/providers.rs:1-108 | crates/dim-cli/src/ui/i18n/pt_pt/providers.rs:1-110 — These two members are one piece of code written twice and then edited apart: 108 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 (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) crates/dim-app-server/src/collaboration_model_policy.rs:116 — crates/dim-app-server/src/collaboration_model_policy.rs:116-182 | crates/dim-app-server/src/permission_rules.rs:159-221 — These two members are one piece of code written twice and then edited apart: 63 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/dim-agent-capabilities/src/methods.rs:1094 — crates/dim-agent-capabilities/src/methods.rs:1094-1133 | crates/dim-agent-capabilities/src/tool_registry.rs:807-854 — 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 (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) crates/dim-app-server/src/hooks_settings.rs:494 — crates/dim-app-server/src/hooks_settings.rs:494-536 | crates/dim-app-server/src/mcp/face.rs:107-150 — These two members are one piece of code written twice and then edited apart: 43 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/dim-app-server/src/storage/files.rs:569 — crates/dim-app-server/src/storage/files.rs:569-610 | crates/dim-app-server/src/storage/files.rs:675-707 — 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 copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) crates/dim-agent-capabilities/src/timeline_tree.rs:1252 — crates/dim-agent-capabilities/src/timeline_tree.rs:1252-1295 | crates/dim-agent-runtime/src/core/timeline.rs:860-894 | crates/dim-goal/src/branch.rs:925-972 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) REDACTED:936 — REDACTED:936-962 | crates/dim-cli/src/client.rs:318-349 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) crates/dim-app-server/src/provider.rs:1866 — crates/dim-app-server/src/provider.rs:1866-1899 | crates/dim-app-server/src/provider.rs:1909-1942 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/dim-agent-scheduler/src/loops.rs:262 — crates/dim-agent-scheduler/src/loops.rs:262-285 | crates/dim-agent-scheduler/src/runs.rs:315-338 | crates/dim-agent-scheduler/src/wakeups.rs:117-140 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) crates/dim-cli/src/ui/render/panel.rs:33 — crates/dim-cli/src/ui/render/panel.rs:33-66 | crates/dim-cli/src/ui/shell.rs:158-189 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) crates/dim-cli/src/ui/i18n/pt_br/plugins.rs:1 — crates/dim-cli/src/ui/i18n/pt_br/plugins.rs:1-50 | crates/dim-cli/src/ui/i18n/pt_pt/plugins.rs:1-50 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/dim-agent-capabilities/src/prompt_sources.rs:372 — crates/dim-agent-capabilities/src/prompt_sources.rs:372-387 | crates/dim-agent-capabilities/src/skills/mod.rs:76-91 | crates/dim-agent-capabilities/src/summary_strategy.rs:141-156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) crates/dim-agent-capabilities/src/timeline_tree.rs:642 — crates/dim-agent-capabilities/src/timeline_tree.rs:642-718 | crates/dim-agent-capabilities/src/timeline_tree.rs:1062-1109 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) crates/dim-agent-capabilities/src/port_faces.rs:21 — crates/dim-agent-capabilities/src/port_faces.rs:21-45 | crates/dim-app-server/src/hooks_settings.rs:449-467 | crates/dim-app-server/src/mcp/face.rs:64-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/dim-agent-capabilities/src/skills/catalog.rs:858 — crates/dim-agent-capabilities/src/skills/catalog.rs:858-873 | crates/dim-agent-capabilities/src/skills/catalog.rs:879-890 | crates/dim-agent-capabilities/src/skills/catalog.rs:896-907 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/dim-cli/src/migration_command.rs:266 — crates/dim-cli/src/migration_command.rs:266-279 | crates/dim-cli/src/session_command.rs:313-328 | crates/dim-cli/src/worktree_command.rs:357-372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) xtask/scenario-eval/prompt-suggestion/long-en-logs/workspace/generate_logs.py:45 — xtask/scenario-eval/prompt-suggestion/long-en-logs/workspace/generate_logs.py:45-49 | xtask/scenario-eval/prompt-suggestion/long-zh-notes/workspace/generate_notes.py:19-25 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) crates/dim-agent-capabilities/src/file_access.rs:225 — crates/dim-agent-capabilities/src/file_access.rs:225-235 | crates/dim-agent-capabilities/src/hooks/runner.rs:2252-2263 | crates/dim-agent-capabilities/src/timeline_tree.rs:2523-2535 | crates/dim-agent-capabilities/src/tool_registry.rs:879-889 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) crates/dim-goal/src/text.rs:399 — crates/dim-goal/src/text.rs:399-416 | crates/dim-goal/src/text.rs:418-433 | crates/dim-goal/src/text.rs:435-449 | crates/dim-goal/src/text.rs:451-465 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 6+ corresponding lines) crates/dim-agent-capabilities/src/execution_settings.rs:80 — crates/dim-agent-capabilities/src/execution_settings.rs:80-85 | crates/dim-agent-capabilities/src/host.rs:892-897 | crates/dim-agent-capabilities/src/host.rs:1046-1051 | crates/dim-agent-capabilities/src/prompt_suggestion.rs:127-135 | crates/dim-agent-capabilities/src/toolchain.rs:87-92 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/dim-cli/src/ui/lines_panel.rs:86 — crates/dim-cli/src/ui/lines_panel.rs:86-104 | crates/dim-cli/src/ui/queue_panel.rs:17-34 | crates/dim-cli/src/ui/timeline_panel.rs:62-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 10+ corresponding lines) crates/dim-agent-capabilities/src/shell_input.rs:676 — crates/dim-agent-capabilities/src/shell_input.rs:676-685 | crates/dim-agent-capabilities/src/workspace_tools/background.rs:1134-1145 | crates/dim-app-server/src/mcp/auth/store.rs:279-288 | crates/dim-app-server/src/mcp/import.rs:584-595 | crates/dim-app-server/src/storage/metadata.rs:410-421 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) crates/dim-agent-capabilities/src/file_storage.rs:1950 — crates/dim-agent-capabilities/src/file_storage.rs:1950-1956 | crates/dim-agent-capabilities/src/file_storage/windows.rs:385-398 | crates/dim-agent-capabilities/src/file_storage/windows.rs:430-443 | crates/dim-agent-capabilities/src/file_storage/windows.rs:611-617 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/dim-app-server/src/collaboration_model_policy.rs:85 — crates/dim-app-server/src/collaboration_model_policy.rs:85-93 | crates/dim-app-server/src/hooks_settings.rs:391-400 | crates/dim-app-server/src/permission_rules.rs:129-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) crates/dim-agent-capabilities/src/approval.rs:562 — crates/dim-agent-capabilities/src/approval.rs:562-569 | crates/dim-agent-capabilities/src/input_queue.rs:387-394 | crates/dim-agent-capabilities/src/timeline_tree.rs:2191-2198 | crates/dim-agent-capabilities/src/tool_executor.rs:273-281 | crates/dim-agent-capabilities/src/workspace_tools/background.rs:1003-1011 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) crates/dim-app-server/src/model_catalog.rs:1626 — crates/dim-app-server/src/model_catalog.rs:1626-1630 | crates/dim-oauth/src/models.rs:42-48 | crates/dim-oauth/src/usage.rs:21-27 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) crates/dim-cli/src/ui/i18n/pt_br/management.rs:238 — crates/dim-cli/src/ui/i18n/pt_br/management.rs:238-294 | crates/dim-cli/src/ui/i18n/pt_pt/management.rs:240-296 — `crates/dim-cli/src/ui/i18n/pt_br/management.rs` and `crates/dim-cli/src/ui/i18n/pt_pt/management.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 104 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/i18n/pt_br/management.rs:238` 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 (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) crates/dim-app-server/src/agents.rs:1143 — crates/dim-app-server/src/agents.rs:1143-1183 | crates/dim-app-server/src/agents.rs:1273-1313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/agents.rs:1143` 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 (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) crates/dim-goal/src/branch.rs:1378 — crates/dim-goal/src/branch.rs:1378-1417 | crates/dim-goal/src/branch.rs:1422-1461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:246 — crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:246-281 | crates/dim-cli/src/ui/composer/mentions.rs:529-564 — before extracting anything, compare `crates/dim-agent-capabilities/src/workspace_tools/mentions.rs` and `crates/dim-cli/src/ui/composer/mentions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) crates/dim-cli/src/ui/i18n/pt_br/chrome.rs:471 — crates/dim-cli/src/ui/i18n/pt_br/chrome.rs:471-503 | crates/dim-cli/src/ui/i18n/pt_pt/chrome.rs:479-511 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/i18n/pt_br/chrome.rs:471` 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) crates/dim-cli/src/ui/i18n/pt_br/management.rs:300 — crates/dim-cli/src/ui/i18n/pt_br/management.rs:300-330 | crates/dim-cli/src/ui/i18n/pt_pt/management.rs:302-332 — `crates/dim-cli/src/ui/i18n/pt_br/management.rs` and `crates/dim-cli/src/ui/i18n/pt_pt/management.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 104 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/dim-cli/src/management_command.rs:73 — crates/dim-cli/src/management_command.rs:73-94 | crates/dim-cli/src/prompt_command.rs:127-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 both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) xtask/src/scenario_eval.rs:2832 — xtask/src/scenario_eval.rs:2832-2846 | xtask/src/scenario_eval.rs:3008-3024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/src/scenario_eval.rs:2832` 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) crates/dim-acp/src/gateway.rs:566 — crates/dim-acp/src/gateway.rs:566-581 | crates/dim-acp/src/gateway.rs:805-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-acp/src/gateway.rs:566` 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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:197 — crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:197-212 | crates/dim-agent-capabilities/src/workspace_tools/files/write.rs:93-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/workspace_tools/files/edit.rs:197` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 4) · ×1
  • Duplicated block (12–15 lines × 4) crates/dim-agent-capabilities/src/recall/search.rs:349 — crates/dim-agent-capabilities/src/recall/search.rs:349-363 | crates/dim-agent-capabilities/src/recall/search.rs:778-789 | crates/dim-agent-capabilities/src/recall/search.rs:953-964 | crates/dim-agent-capabilities/src/recall/search.rs:1333-1347 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:349` 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 (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) crates/dim-agent-capabilities/src/input_queue/pending.rs:81 — crates/dim-agent-capabilities/src/input_queue/pending.rs:81-95 | crates/dim-agent-capabilities/src/workspace_tools/pending.rs:77-91 | crates/dim-app-server/src/collaboration/pending.rs:114-127 — before extracting anything, compare `crates/dim-agent-capabilities/src/input_queue/pending.rs` and `crates/dim-app-server/src/collaboration/pending.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/input_queue/pending.rs:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) crates/dim-app-server/src/codex_oauth/management.rs:46 — crates/dim-app-server/src/codex_oauth/management.rs:46-59 | crates/dim-app-server/src/grok_oauth/management.rs:35-48 | crates/dim-app-server/src/managed_provider/management.rs:311-324 | crates/dim-app-server/src/provider/management.rs:146-159 — `crates/dim-app-server/src/codex_oauth/management.rs` and `crates/dim-app-server/src/grok_oauth/management.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 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/codex_oauth/management.rs:46` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `oauth` to `Arc<OpenAICodexOAuthService>` in one and `Arc<GrokOAuthService>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) crates/dim-agent-capabilities/src/context_usage.rs:432 — crates/dim-agent-capabilities/src/context_usage.rs:432-445 | crates/dim-agent-capabilities/src/prompt/recovery.rs:77-90 | crates/dim-goal/src/branch/recovery.rs:96-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_usage.rs:432` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) crates/dim-agent-capabilities/src/recall/search.rs:400 — crates/dim-agent-capabilities/src/recall/search.rs:400-411 | crates/dim-agent-capabilities/src/recall/search.rs:823-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/recall/search.rs:823` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–14 lines × 2) · ×1
  • Duplicated block (9–14 lines × 2) crates/dim-agent-capabilities/src/tool_executor.rs:521 — crates/dim-agent-capabilities/src/tool_executor.rs:521-529 | crates/dim-agent-capabilities/src/tool_executor.rs:816-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/tool_executor.rs:521` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) crates/dim-app-server/src/managed_oauth.rs:719 — crates/dim-app-server/src/managed_oauth.rs:719-732 | crates/dim-app-server/src/managed_oauth.rs:794-804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/managed_oauth.rs:719` 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) crates/dim-cli/src/ui/models_panel.rs:517 — crates/dim-cli/src/ui/models_panel.rs:517-529 | crates/dim-cli/src/ui/models_panel.rs:578-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/models_panel.rs:517` 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–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) crates/dim-app-server/src/plugin_files.rs:511 — crates/dim-app-server/src/plugin_files.rs:511-522 | crates/dim-app-server/src/plugin_files.rs:531-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/plugin_files.rs:511` 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 (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) crates/dim-app-server/src/provider.rs:1958 — crates/dim-app-server/src/provider.rs:1958-1968 | crates/dim-app-server/src/provider/editing.rs:529-540 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/provider.rs:1958` 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–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) crates/dim-acp/src/gateway.rs:1689 — crates/dim-acp/src/gateway.rs:1689-1699 | crates/dim-acp/src/gateway.rs:1725-1734 — both copies are in the same file, so extract the 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 (7–11 lines × 2) · ×1
  • Duplicated block (7–11 lines × 2) crates/dim-cli/src/ui/tui.rs:2019 — crates/dim-cli/src/ui/tui.rs:2019-2025 | crates/dim-cli/src/ui/tui.rs:4673-4683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-cli/src/ui/tui.rs:2019` 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 × 4) · ×1
  • Duplicated block (10 lines × 4) crates/dim-agent-capabilities/src/shell_input.rs:688 — crates/dim-agent-capabilities/src/shell_input.rs:688-697 | crates/dim-app-server/src/mcp/auth/store.rs:291-300 | crates/dim-app-server/src/mcp/import.rs:598-607 | crates/dim-app-server/src/storage/metadata.rs:424-433 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) crates/dim-agent-capabilities/src/context_preparation.rs:820 — crates/dim-agent-capabilities/src/context_preparation.rs:820-827 | crates/dim-agent-capabilities/src/model_provider.rs:536-545 — before extracting anything, compare `crates/dim-agent-capabilities/src/context_preparation.rs` and `crates/dim-agent-capabilities/src/model_provider.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 216 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 `crates/dim-agent-capabilities/src/context_preparation.rs:820` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) crates/dim-cli/src/export.rs:336 — crates/dim-cli/src/export.rs:336-342 | crates/dim-cli/src/maintenance.rs:25-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-cli/src/export.rs:336` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) crates/dim-cli/src/session_host/member.rs:560 — crates/dim-cli/src/session_host/member.rs:560-569 | crates/dim-cli/src/session_host/tasks.rs:555-563 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/dim-cli/src/session_host/member.rs:560` 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 (6–9 lines × 4) · ×1
  • Duplicated block (6–9 lines × 4) crates/dim-agent-capabilities/src/agent_loop.rs:1891 — crates/dim-agent-capabilities/src/agent_loop.rs:1891-1899 | crates/dim-agent-capabilities/src/context_preparation.rs:1094-1102 | crates/dim-agent-capabilities/src/model_provider.rs:678-686 | crates/dim-agent-capabilities/src/permission.rs:896-901 — before extracting anything, compare `crates/dim-agent-capabilities/src/agent_loop.rs` and `crates/dim-agent-capabilities/src/context_preparation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop.rs:1891` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) crates/dim-agent-attachments/src/lib.rs:83 — crates/dim-agent-attachments/src/lib.rs:83-91 | crates/dim-agent-capabilities/src/file_storage.rs:505-511 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) crates/dim-agent-capabilities/src/context_policy.rs:527 — crates/dim-agent-capabilities/src/context_policy.rs:527-534 | crates/dim-agent-capabilities/src/context_policy.rs:681-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8 lines × 10) · ×1
  • Duplicated block (8 lines × 10) crates/dim-cli/src/ui/i18n/de/mod.rs:12 — crates/dim-cli/src/ui/i18n/de/mod.rs:12-19 | crates/dim-cli/src/ui/i18n/es/mod.rs:12-19 | crates/dim-cli/src/ui/i18n/fr/mod.rs:12-19 | crates/dim-cli/src/ui/i18n/id/mod.rs:12-19 | crates/dim-cli/src/ui/i18n/ja/mod.rs:12-19 | crates/dim-cli/src/ui/i18n/ko/mod.rs:12-19 | crates/dim-cli/src/ui/i18n/pt_br/mod.rs:13-20 | crates/dim-cli/src/ui/i18n/pt_pt/mod.rs:13-20 | crates/dim-cli/src/ui/i18n/zh_cn/mod.rs:13-20 | crates/dim-cli/src/ui/i18n/zh_hant/mod.rs:13-20 — `crates/dim-cli/src/ui/i18n/de/mod.rs` and `crates/dim-cli/src/ui/i18n/es/mod.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 1 separate duplicated blocks between them, totalling at least 8 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/dim-app-server/src/agent_records.rs:150 — crates/dim-app-server/src/agent_records.rs:150-157 | crates/dim-app-server/src/agent_records.rs:171-178 | crates/dim-app-server/src/agent_records.rs:188-194 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/agent_records.rs:150` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:1397 — crates/dim-agent-capabilities/src/timeline_tree.rs:1397-1404 | crates/dim-agent-capabilities/src/timeline_tree.rs:1556-1562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:1397` 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 (4–8 lines × 3) · ×1
  • Duplicated block (4–8 lines × 3) crates/dim-app-server/src/mcp/management.rs:721 — crates/dim-app-server/src/mcp/management.rs:721-724 | crates/dim-app-server/src/mcp/management.rs:1154-1161 | crates/dim-app-server/src/mcp/management.rs:1204-1211 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) crates/dim-agent-capabilities/src/agent_loop.rs:1894 — crates/dim-agent-capabilities/src/agent_loop.rs:1894-1899 | crates/dim-agent-capabilities/src/permission.rs:896-902 | crates/dim-goal/src/branch.rs:312-317 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop.rs:1894` 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 (5–7 lines × 2) · ×1
  • Duplicated block (5–7 lines × 2) crates/dim-app-server/src/connection/tree.rs:304 — crates/dim-app-server/src/connection/tree.rs:304-308 | crates/dim-app-server/src/connection/tree.rs:321-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/connection/tree.rs:304` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) crates/dim-agent-capabilities/src/context_policy.rs:531 — crates/dim-agent-capabilities/src/context_policy.rs:531-535 | crates/dim-agent-capabilities/src/history.rs:1461-1465 | crates/dim-agent-runtime/src/core/timeline.rs:885-889 — before extracting anything, compare `crates/dim-agent-capabilities/src/history.rs` and `crates/dim-agent-runtime/src/core/timeline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/context_policy.rs:531` 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 (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) crates/dim-agent-capabilities/src/agent_loop/read.rs:85 — crates/dim-agent-capabilities/src/agent_loop/read.rs:85-88 | crates/dim-agent-capabilities/src/agent_loop/read.rs:107-111 | crates/dim-agent-capabilities/src/tool_executor/read.rs:83-88 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop/read.rs:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) crates/dim-agent-runtime/src/memory.rs:26 — crates/dim-agent-runtime/src/memory.rs:26-30 | crates/dim-cli/src/session_command.rs:363-367 | crates/dim-cli/src/ui/sessions_panel.rs:441-445 | crates/dim-cli/src/worktree_command.rs:383-387 — 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) crates/dim-agent-capabilities/src/timeline_tree.rs:3835 — crates/dim-agent-capabilities/src/timeline_tree.rs:3835-3863 | crates/dim-goal/src/branch.rs:1736-1758 — before extracting anything, compare `crates/dim-agent-capabilities/src/timeline_tree.rs` and `crates/dim-goal/src/branch.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/timeline_tree.rs:3835` 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 (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) crates/dim-app-server/src/collaboration/approvals.rs:766 — crates/dim-app-server/src/collaboration/approvals.rs:766-780 | crates/dim-app-server/src/exec_shell_settings.rs:57-71 | crates/dim-app-server/src/settings_methods.rs:140-156 | crates/dim-app-server/src/worktrees.rs:1201-1216 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-app-server/src/collaboration/approvals.rs:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/dim-app-server/src/worktrees.rs:1199` calls `clone` and `crates/dim-app-server/src/exec_shell_settings.rs:56` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/dim-agent-capabilities/src/agent_loop.rs:1021 — crates/dim-agent-capabilities/src/agent_loop.rs:1021-1031 | crates/dim-agent-capabilities/src/context_preparation.rs:690-700 | crates/dim-agent-capabilities/src/model_provider.rs:282-292 | crates/dim-agent-capabilities/src/tool_executor.rs:1062-1072 — before extracting anything, compare `crates/dim-agent-capabilities/src/agent_loop.rs` and `crates/dim-agent-capabilities/src/context_preparation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop.rs:1021` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) crates/dim-agent-capabilities/src/agent_loop.rs:802 — crates/dim-agent-capabilities/src/agent_loop.rs:802-810 | crates/dim-agent-capabilities/src/agent_loop.rs:1020-1028 | crates/dim-agent-capabilities/src/context_preparation.rs:689-697 | crates/dim-agent-capabilities/src/model_provider.rs:281-289 | crates/dim-agent-capabilities/src/model_provider.rs:368-376 — before extracting anything, compare `crates/dim-agent-capabilities/src/agent_loop.rs` and `crates/dim-agent-capabilities/src/context_preparation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dim-agent-capabilities/src/agent_loop.rs:802` 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, `crates/dim-agent-capabilities/src/agent_loop.rs:812` calls `Number` and `crates/dim-agent-capabilities/src/model_provider.rs:377` 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.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 107 typed · 63 plain JS — the untyped files are runtime/light-ocr-helper.test.mjs, runtime/light-ocr-row.test.mjs, runtime/permission-policy.test.mjs, runtime/plugin-sdk.test.mjs, runtime/plugins/light-ocr/helper.cjs, scripts/adr-check.mjs (+57 more).
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (11 matched lines × 2 locations) web/src/features/settings/AgentSettings.vue:84 — web/src/features/settings/AgentSettings.vue:84 · web/src/features/settings/ModalitySettings.vue:92 — the two spans are one implementation copied and then locally edited — 83 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 (10 lines × 3 locations) · ×1
  • Duplicated block (10 lines × 3 locations) web/src/rpc/general-settings.ts:13 — web/src/rpc/general-settings.ts:13 · web/src/rpc/management.ts:45 · web/src/rpc/scheduler.ts:27 — the 3 copies are spread across 3 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 (9 lines × 3 locations) · ×1
  • Duplicated block (9 lines × 3 locations) web/src/features/settings/ProviderConnectionForm.vue:17 — web/src/features/settings/ProviderConnectionForm.vue:17 · web/src/features/settings/ProviderModels.vue:26 · web/src/features/settings/ProviderSettings.vue:26 — the 3 copies are spread across 3 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (8 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (8 matched lines × 2 locations) web/src/features/lines/LinesPanel.vue:10 — web/src/features/lines/LinesPanel.vue:10 · web/src/features/lines/LinesTree.vue:7 — the two spans are one implementation copied and then locally edited — 78 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 (8 lines × 3 locations) · ×1
  • Duplicated block (8 lines × 3 locations) web/src/features/settings/AgentSettings.vue:63 — web/src/features/settings/AgentSettings.vue:63 · web/src/features/settings/ModalitySettings.vue:79 · web/src/features/settings/PermissionsSettings.vue:48 — the 3 copies are spread across 3 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 (7 lines × 3 locations) · ×1
  • Duplicated block (7 lines × 3 locations) runtime/plugins/workflow/engine.ts:300 — runtime/plugins/workflow/engine.ts:300 · runtime/plugins/workflow/engine.ts:364 · runtime/plugins/workflow/engine.ts:374 — 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.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) runtime/plugins/workflow/engine.ts:317 — runtime/plugins/workflow/engine.ts:317 · runtime/plugins/workflow/engine.ts:350 — both copies are in the same file, so extract the 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 (6 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (6 matched lines × 2 locations) scripts/stage-plugins.mjs:273 — scripts/stage-plugins.mjs:273 · scripts/stage-plugins.mjs:329 — the two spans are one implementation copied and then locally edited — 84 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 content (cyclomatic 48, cognitive 45) · ×1
  • Complex function content (cyclomatic 48, cognitive 45) web/src/rpc/read.ts:602 — content has cyclomatic complexity 48 and cognitive complexity 45; 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 apply (cyclomatic 45, cognitive 52) · ×1
  • Complex function apply (cyclomatic 45, cognitive 52) web/src/projection.ts:113 — apply has cyclomatic complexity 45 and cognitive complexity 52; 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 executeStage (cyclomatic 41, cognitive 68) · ×1
  • Complex function executeStage (cyclomatic 41, cognitive 68) runtime/plugins/workflow/engine.ts:261 — executeStage has cyclomatic complexity 41 and cognitive complexity 68; 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 save (cyclomatic 38, cognitive 48) · ×1
  • Complex function save (cyclomatic 38, cognitive 48) web/src/features/settings/ProviderModels.vue:120 — save has cyclomatic complexity 38 and cognitive complexity 48; 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 read (cyclomatic 36, cognitive 73) · ×1
  • Complex function read (cyclomatic 36, cognitive 73) runtime/plugins/workflow/history.ts:25 — read has cyclomatic complexity 36 and cognitive complexity 73; 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 submit (cyclomatic 36, cognitive 40) · ×1
  • Complex function submit (cyclomatic 36, cognitive 40) web/src/features/chat/ComposerPanel.vue:434 — submit has cyclomatic complexity 36 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function update (cyclomatic 33, cognitive 51) · ×1
  • Complex function update (cyclomatic 33, cognitive 51) web/src/features/settings/SchedulePlan.vue:44 — update has cyclomatic complexity 33 and cognitive complexity 51; 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 onKeydown (cyclomatic 31, cognitive 34) · ×1
  • Complex function onKeydown (cyclomatic 31, cognitive 34) web/src/features/chat/ComposerPanel.vue:638 — onKeydown has cyclomatic complexity 31 and cognitive complexity 34; 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 askQuestion (cyclomatic 31, cognitive 32) · ×1
  • Complex function askQuestion (cyclomatic 31, cognitive 32) web/src/rpc/read.ts:733 — askQuestion has cyclomatic complexity 31 and cognitive complexity 32; 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 sync (cyclomatic 29, cognitive 37) · ×1
  • Complex function sync (cyclomatic 29, cognitive 37) web/src/stores/chat.ts:181 — sync has cyclomatic complexity 29 and cognitive complexity 37; 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 applyNotification (cyclomatic 29, cognitive 33) · ×1
  • Complex function applyNotification (cyclomatic 29, cognitive 33) web/src/stores/chat.ts:273 — applyNotification has cyclomatic complexity 29 and cognitive complexity 33; 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 edit (cyclomatic 24, cognitive 23) · ×1
  • Complex function edit (cyclomatic 24, cognitive 23) web/src/features/settings/McpSettings.vue:315 — edit has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 updateLocked (cyclomatic 21, cognitive 29) · ×1
  • Complex function updateLocked (cyclomatic 21, cognitive 29) scripts/stage-plugins.mjs:256 — updateLocked has cyclomatic complexity 21 and cognitive complexity 29; 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 runCommand (cyclomatic 21, cognitive 24) · ×1
  • Complex function runCommand (cyclomatic 21, cognitive 24) web/src/features/chat/ComposerPanel.vue:614 — runCommand has cyclomatic complexity 21 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 patch (cyclomatic 20, cognitive 29) · ×1
  • Complex function patch (cyclomatic 20, cognitive 29) web/src/features/settings/mcp-form.ts:36 — patch has cyclomatic complexity 20 and cognitive complexity 29; 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 (anonymous) (cyclomatic 20, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 20, cognitive 18) web/src/features/extensions/ExtensionPanel.vue:51 — (anonymous) has cyclomatic complexity 20 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 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 readNotification (cyclomatic 20, cognitive 16) · ×1
  • Complex function readNotification (cyclomatic 20, cognitive 16) web/src/rpc/read.ts:822 — readNotification has cyclomatic complexity 20 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 save (cyclomatic 19, cognitive 24) · ×1
  • Complex function save (cyclomatic 19, cognitive 24) web/src/features/settings/AgentSettings.vue:88 — save 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 generateBundle (cyclomatic 18, cognitive 33) · ×1
  • Complex function generateBundle (cyclomatic 18, cognitive 33) web/vite.config.ts:41 — generateBundle has cyclomatic complexity 18 and cognitive complexity 33; 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 loadHistory (cyclomatic 18, cognitive 28) · ×1
  • Complex function loadHistory (cyclomatic 18, cognitive 28) web/src/stores/chat.ts:481 — loadHistory has cyclomatic complexity 18 and cognitive complexity 28; 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 (anonymous) (cyclomatic 18, cognitive 26) · ×1
  • Complex function (anonymous) (cyclomatic 18, cognitive 26) web/src/features/chat/TimelineWorkItem.vue:56 — (anonymous) 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 patch (cyclomatic 18, cognitive 23) · ×1
  • Complex function patch (cyclomatic 18, cognitive 23) web/src/features/settings/ProviderConnectionForm.vue:81 — patch has cyclomatic complexity 18 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validatePolicy (cyclomatic 18, cognitive 20) · ×1
  • Complex function validatePolicy (cyclomatic 18, cognitive 20) scripts/update-provider-catalog.ts:74 — validatePolicy has cyclomatic complexity 18 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 action (cyclomatic 18, cognitive 20) · ×1
  • Complex function action (cyclomatic 18, cognitive 20) web/src/features/settings/McpSettings.vue:411 — action has cyclomatic complexity 18 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 reasoningMetadataFromModel (cyclomatic 18, cognitive 13) · ×1
  • Complex function reasoningMetadataFromModel (cyclomatic 18, cognitive 13) scripts/update-provider-catalog.ts:915 — reasoningMetadataFromModel has cyclomatic complexity 18 and cognitive complexity 13; 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 syncProvider (cyclomatic 17, cognitive 22) · ×1
  • Complex function syncProvider (cyclomatic 17, cognitive 22) scripts/update-provider-catalog.ts:177 — syncProvider has cyclomatic complexity 17 and cognitive complexity 22; 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 poll (cyclomatic 17, cognitive 22) · ×1
  • Complex function poll (cyclomatic 17, cognitive 22) web/src/features/settings/ProviderAuthFlow.vue:49 — poll has cyclomatic complexity 17 and cognitive complexity 22; 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 release (cyclomatic 17, cognitive 16) · ×1
  • Complex function release (cyclomatic 17, cognitive 16) scripts/stage-image.test.mjs:71 — release 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 move (cyclomatic 17, cognitive 15) · ×1
  • Complex function move (cyclomatic 17, cognitive 15) web/src/features/settings/McpSettings.vue:451 — move has cyclomatic complexity 17 and cognitive complexity 15; 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 saveExecution (cyclomatic 17, cognitive 15) · ×1
  • Complex function saveExecution (cyclomatic 17, cognitive 15) web/src/features/settings/PermissionsSettings.vue:89 — saveExecution has cyclomatic complexity 17 and cognitive complexity 15; 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 load (cyclomatic 17, cognitive 13) · ×1
  • Complex function load (cyclomatic 17, cognitive 13) web/src/features/settings/AgentSettings.vue:63 — load has cyclomatic complexity 17 and cognitive complexity 13; 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 validateCatalog (cyclomatic 16, cognitive 25) · ×1
  • Complex function validateCatalog (cyclomatic 16, cognitive 25) scripts/update-provider-catalog.ts:828 — validateCatalog has cyclomatic complexity 16 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 resolveToolDisplay (cyclomatic 16, cognitive 18) · ×1
  • Complex function resolveToolDisplay (cyclomatic 16, cognitive 18) web/src/features/chat/tool-display.ts:27 — resolveToolDisplay has cyclomatic complexity 16 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.
R2 · Cyclomatic Complexity · Complex function readPersisted (cyclomatic 16, cognitive 15) · ×1
  • Complex function readPersisted (cyclomatic 16, cognitive 15) web/src/stores/ui.ts:42 — readPersisted has cyclomatic complexity 16 and cognitive complexity 15; 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 push (cyclomatic 16, cognitive 13) · ×1
  • Complex function push (cyclomatic 16, cognitive 13) web/src/history-window.ts:41 — push has cyclomatic complexity 16 and cognitive complexity 13; 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 save (cyclomatic 16, cognitive 12) · ×1
  • Complex function save (cyclomatic 16, cognitive 12) web/src/features/settings/ScheduledSettings.vue:195 — save has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function applyEvent (cyclomatic 16, cognitive 12) · ×1
  • Complex function applyEvent (cyclomatic 16, cognitive 12) web/src/stores/chat.ts:351 — applyEvent has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function approvalKeyDecision (cyclomatic 16, cognitive 11) · ×1
  • Complex function approvalKeyDecision (cyclomatic 16, cognitive 11) web/src/features/lines/line-state.ts:71 — approvalKeyDecision has cyclomatic complexity 16 and cognitive complexity 11; 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 summarize (cyclomatic 15, cognitive 26) · ×1
  • Complex function summarize (cyclomatic 15, cognitive 26) scripts/update-provider-catalog.ts:360 — summarize has cyclomatic complexity 15 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 main (cyclomatic 15, cognitive 19) · ×1
  • Complex function main (cyclomatic 15, cognitive 19) scripts/update-provider-catalog.ts:121 — main 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.
R3 · Large Files · scripts/update-provider-catalog.ts · ×1
  • scripts/update-provider-catalog.ts: 1110 lines of code scripts/update-provider-catalog.ts:1 — scripts/update-provider-catalog.ts has 1110 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 · web/src/rpc/read.ts · ×1
  • web/src/rpc/read.ts: 983 lines of code web/src/rpc/read.ts:1 — web/src/rpc/read.ts has 983 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 · web/src/stores/chat.ts · ×1
  • web/src/stores/chat.ts: 846 lines of code web/src/stores/chat.ts:1 — web/src/stores/chat.ts has 846 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 · web/src/features/chat/ComposerPanel.vue · ×1
  • web/src/features/chat/ComposerPanel.vue: 824 lines of code web/src/features/chat/ComposerPanel.vue:1 — web/src/features/chat/ComposerPanel.vue has 824 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 · web/src/features/settings/McpSettings.vue · ×1
  • web/src/features/settings/McpSettings.vue: 739 lines of code web/src/features/settings/McpSettings.vue:1 — web/src/features/settings/McpSettings.vue has 739 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 · runtime/plugins/workflow/engine.ts · ×1
  • runtime/plugins/workflow/engine.ts: 471 lines of code runtime/plugins/workflow/engine.ts:1 — runtime/plugins/workflow/engine.ts has 471 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 · web/src/features/settings/ScheduledSettings.vue · ×1
  • web/src/features/settings/ScheduledSettings.vue: 426 lines of code web/src/features/settings/ScheduledSettings.vue:1 — web/src/features/settings/ScheduledSettings.vue has 426 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 · web/src/projection.ts · ×1
  • web/src/projection.ts: 403 lines of code web/src/projection.ts:1 — web/src/projection.ts has 403 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 · web/src/features/chat/ChatPage.vue · ×1
  • web/src/features/chat/ChatPage.vue: 401 lines of code web/src/features/chat/ChatPage.vue:1 — web/src/features/chat/ChatPage.vue has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage · No test reaches this file · ×1
  • No test reaches this file runtime/spikes/session-part.ts: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.
R8 · Dependency Hygiene · Unused dependency '@modelcontextprotocol/sdk' · ×1
  • Unused dependency '@modelcontextprotocol/sdk' REDACTED:12 — Declared in REDACTED 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 '@shikijs/core' · ×1
  • Unused dependency '@shikijs/core' REDACTED:16 — Declared in REDACTED 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 '@shikijs/engine-javascript' · ×1
  • Unused dependency '@shikijs/engine-javascript' REDACTED:17 — Declared in REDACTED 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 '@shikijs/langs' · ×1
  • Unused dependency '@shikijs/langs' REDACTED:18 — Declared in REDACTED 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 '@shikijs/themes' · ×1
  • Unused dependency '@shikijs/themes' REDACTED:19 — Declared in REDACTED 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 'shiki' · ×1
  • Unused dependency 'shiki' REDACTED:25 — Declared in REDACTED 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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×1
  • JavaScript dependencies are not locked npm/package.json:12 — npm/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X1 · Async correctness · Blocking `thread · ×1
  • Blocking `thread::sleep` inside an `async` body crates/dim-cli/src/plugins.rs:152 — This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`.
X22 · Contradicted release guard · Released by hand after an acquire that may have failed · ×1
  • Released by hand after an acquire that may have failed crates/dim-app-server/src/storage/prompt_migration.rs:82 — `require_unowned` tries to take `admission` on line 81, but a failure does not leave: `unlock` on line 82 runs on the failure path too, giving back a permit that was never taken (the pool grows past its limit) or unlocking a lock this thread does not hold. Leave on failure (`let Ok(p) = … else { return … }`, `?`), or release only inside the branch that took it.
Minor — 81 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×32
  • Duplicated predicate web/src/rpc/read.ts:74 — `typeof value !== "number" || !Number.isSafeInteger(value) || value < 0` appears character-identically in 2 files — web/src/rpc/read.ts, web/src/rpc/scheduler.ts. 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 scripts/update-provider-catalog.ts:1193 — `value !== null && typeof value === "object" && !Array.isArray(value)` appears character-identically in 2 files — scripts/update-provider-catalog.ts, web/src/stores/appearance.ts. 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 web/src/rpc/read.ts:309 — `value === "read-only" || value === "workspace-write" || value === "full-access"` appears character-identically in 2 files — web/src/rpc/read.ts, web/src/rpc/scheduler.ts. 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 web/src/stores/composer.ts:11 — `value === null || typeof value !== "object"` appears character-identically in 2 files — web/src/stores/composer.ts, web/src/stores/ui.ts. 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/dim-cli/src/session.rs:305 — `!display.json && client.offers("session.history.display") && client.offers("session.history.detail")` appears character-identically in 2 files — crates/dim-cli/src/session.rs, crates/dim-cli/src/session/window.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/dim-app-server/src/pipe_client.rs:41 — `!name.starts_with(r"\\.\pipe\") || name.len() == r"\\.\pipe\".len() || name.contains('\0')` appears character-identically in 2 files — crates/dim-app-server/src/pipe_client.rs, crates/dim-app-server/src/transport.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/dim-cli/src/mcp_command.rs:122 — `!no_browser && std::env::var_os("SSH_CONNECTION").is_none() && std::env::var_os("SSH_TTY").is_none()` appears character-identically in 2 files — crates/dim-cli/src/mcp_command.rs, crates/dim-cli/src/session_host.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/dim-agent-runtime/src/memory_timeline_store/query.rs:665 — `!query.group_by.is_empty() || query.pick.is_some()` appears character-identically in 2 files — crates/dim-agent-runtime/src/memory_timeline_store/query.rs, crates/dim-app-server/src/storage/query.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/dim-cli/src/management_command.rs:54 — `!std::io::stdin().is_terminal() || !std::io::stdout().is_terminal()` appears character-identically in 2 files — crates/dim-cli/src/management_command.rs, crates/dim-cli/src/prompt_command.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/dim-app-server/src/provider.rs:1428 — `a.credential_epoch == b.credential_epoch && a.generation == b.generation` appears character-identically in 2 files — crates/dim-app-server/src/provider.rs, crates/dim-oauth/src/lib.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/dim-agent-capabilities/src/file_storage.rs:1747 — `a.dev() == b.dev() && a.ino() == b.ino()` appears character-identically in 4 files — crates/dim-agent-capabilities/src/file_storage.rs, crates/dim-agent-capabilities/src/workspace_tools/files.rs, crates/dim-agent-capabilities/src/workspace_tools/files/write.rs, crates/dim-cli/src/client.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/dim-agent-capabilities/src/prompt_suggestion.rs:573 — `config.interactive && config.collaboration_role == CollaborationRole::Leader` appears character-identically in 2 files — crates/dim-agent-capabilities/src/prompt_suggestion.rs, crates/dim-session-title/src/lib.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/dim-cli/src/session_host.rs:4908 — `i > 0 && (digits.len() - i).is_multiple_of(3)` appears character-identically in 2 files — crates/dim-cli/src/session_host.rs, crates/dim-cli/src/ui/oauth_view.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/dim-cli/src/ui/queue_panel.rs:69 — `key.code == KeyCode::Char('x') && key.mods == Modifiers::NONE` appears character-identically in 2 files — crates/dim-cli/src/ui/queue_panel.rs, crates/dim-cli/src/ui/tasks_panel.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/dim-cli/src/ui/management_panel.rs:467 — `key.code == KeyCode::Char('x') && key.mods.contains(Modifiers::CTRL)` appears character-identically in 2 files — crates/dim-cli/src/ui/management_panel.rs, crates/dim-cli/src/ui/sessions_panel.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/dim-agent-capabilities/src/environment_clients.rs:274 — `lifecycle.is_cancelled() || phase.phase() >= BranchPhase::Closing` appears character-identically in 2 files — crates/dim-agent-capabilities/src/environment_clients.rs, crates/dim-agent-capabilities/src/execution_settings/prompt.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/dim-cli/src/modality/task.rs:296 — `matches!(components.next(), Some(Component::Normal(_))) && components.next().is_none()` appears character-identically in 2 files — crates/dim-cli/src/modality/task.rs, crates/dim-cli/src/update/staged.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/dim-agent-capabilities/src/skills/install.rs:266 — `meta.is_dir() && !meta.file_type().is_symlink()` appears character-identically in 4 files — crates/dim-agent-capabilities/src/skills/install.rs, crates/dim-app-server/src/plugin_manager.rs, crates/dim-app-server/src/plugin_manager/acquire.rs, crates/dim-app-server/src/skills_management.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/dim-app-server/src/collaboration_model_policy.rs:43 — `model.provider_id.is_empty() || model.model_id.is_empty()` appears character-identically in 3 files — crates/dim-app-server/src/collaboration_model_policy.rs, crates/dim-modality/src/lib.rs, crates/dim-report/src/draft.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/dim-agent-capabilities/src/workspace_tools/mentions.rs:277 — `next.is_some() || gaps > (count * 2).max(4)` appears character-identically in 2 files — crates/dim-agent-capabilities/src/workspace_tools/mentions.rs, crates/dim-cli/src/ui/composer/mentions.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 REDACTED:1839 — `options.set_limits.is_some() || options.set_missing_limits` appears character-identically in 2 files — REDACTED, crates/dim-cli/src/lib.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/dim-cli/src/modality/media.rs:270 — `provider_id.is_empty() || model_id.is_empty()` appears character-identically in 3 files — crates/dim-cli/src/modality/media.rs, crates/dim-cli/src/modality/mod.rs, crates/dim-cli/src/realtime_command.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/dim-agent-runtime/src/memory_timeline_store/query.rs:666 — `query.group_by.is_empty() && query.pick.is_some()` appears character-identically in 2 files — crates/dim-agent-runtime/src/memory_timeline_store/query.rs, crates/dim-app-server/src/storage/query.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/dim-app-server/src/provider/editing.rs:545 — `record.enabled && record.credential_authority == CredentialAuthority::Static && record.auth != StaticAuth::Anonymous && record.credential.is…` appears character-identically in 2 files — crates/dim-app-server/src/provider/editing.rs, crates/dim-app-server/src/provider/models.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/dim-app-server/src/storage/codec.rs:986 — `rest.is_empty() || rest.starts_with('.') || rest.starts_with('[')` appears character-identically in 2 files — crates/dim-app-server/src/storage/codec.rs, crates/dim-app-server/src/storage/query.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.
  • + 7 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on Err · ×11
  • Silent fallback default on Err crates/dim-agent-capabilities/src/hooks/mod.rs:52 — `settled` turns every `Err` into `"the watch was dropped".into()` — 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/dim-agent-capabilities/src/hooks/runner.rs:687 — `stop_output` turns every `Err` into `StopOutput::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/dim-agent-capabilities/src/host_platform.rs:1641 — `natural_order` 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/dim-agent-capabilities/src/workspace_tools/files/read.rs:747 — `similar_files` 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/dim-app-server/src/connection/subscription.rs:712 — `follow` turns every `Err` into `true` — 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/dim-cli/src/ui/composer/mentions.rs:433 — `candidates` 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/dim-cli/src/ui/composer/mentions.rs:261 — `list_dir` 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/dim-cli/src/ui/progress.rs:83 — `release` 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/dim-cli/src/ui/terminal/input.rs:437 — `numbers` 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/dim-cli/src/update/staged.rs:424 — `live_commands` 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 xtask/src/scenario_eval.rs:2910 — `plugin_default_names` 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.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×5
  • Projects may be oversized for their cohesion crates/dim-cli/Cargo.toml:1 — `crates/dim-cli` (118699 LoC, 575 module-visible types across 26 directories) overshoots its size bounds. 5 of 31 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.8/10. 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.
  • Projects may be oversized for their cohesion crates/dim-app-server/Cargo.toml:1 — `crates/dim-app-server` (90178 LoC, 622 module-visible types across 19 directories) overshoots its size bounds. 5 of 31 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.8/10. 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.
  • Projects may be oversized for their cohesion crates/dim-agent-capabilities/Cargo.toml:1 — `crates/dim-agent-capabilities` (68793 LoC, 470 module-visible types across 17 directories) overshoots its size bounds. 5 of 31 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.8/10. 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.
  • Projects may be oversized for their cohesion xtask/Cargo.toml:1 — `xtask` (23300 LoC, 66 module-visible types across 35 directories) overshoots its size bounds. 5 of 31 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.8/10. 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.
  • Projects may be oversized for their cohesion crates/dim-agent-types/Cargo.toml:1 — `crates/dim-agent-types` (6048 LoC, 238 module-visible types across 1 directories) overshoots its size bounds. 5 of 31 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.8/10. 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.
M2 · Architecture documentation · Architecture diagram out of date · ×5
  • Architecture diagram out of date docs/design/clients.md:12 — `docs/design/clients.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode-plugin-runtime`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/design/web-workspace.md:10 — `docs/design/web-workspace.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode-plugin-runtime`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/design/plugins/RemoteGateway.md:12 — `docs/design/plugins/RemoteGateway.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/zh/design/clients.md:12 — `docs/zh/design/clients.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode-plugin-runtime`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/architecture/rust-agent/generated/modules.mmd:3 — `docs/architecture/rust-agent/generated/modules.mmd` draws the system's parts, and the drawing no longer matches the code: it leaves out `dimcode`, `dim-codemode`, `dim-event-hub`, `dim-modality-aimux`, `dim-oauth`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
D20 · ADR Quality · ADR superseded but its status says otherwise · ×3
  • ADR superseded but its status says otherwise docs/adr/001-harness-foundation.md:10 — docs/adr/001-harness-foundation.md:10 says "Recovery design adopted for this branch. ADR 004 records the approved", but docs/adr/004-loader-plugin-management.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/adr/011-execution-settings.md:3 — docs/adr/011-execution-settings.md:3 says "Proposed.", but docs/adr/017-independent-permission-controls.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/adr/017-independent-permission-controls.md:3 — docs/adr/017-independent-permission-controls.md:3 says "Accepted.", but docs/adr/018-permission-is-the-preset.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 17 significant file(s) lose their only recent owner: crates/dim-agent-aimux/src/request/tests.rs, crates/dim-app-server/src/model_catalog.rs, crates/dim-agent-capabilities/src/workspace_tools/files.rs, crates/dim-agent-capabilities/src/workspace_tools/files/search.rs, crates/dim-agent-aimux/src/request.rs, crates/dim-agent-capabilities/src/file_storage/windows.rs, crates/dim-agent-aimux/src/stream.rs, crates/dim-agent-aimux/src/request/native.rs (+9 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: crates/dim-agent-runtime/src/core/dispatcher.rs, crates/dim-agent-capabilities/src/workspace_tools/file_reads.rs, crates/dim-agent-runtime/src/timeline_store.rs, crates/dim-agent-capabilities/src/context_methods.rs, crates/dim-app-server/src/permission_rules.rs. Pair on, review, or document these before any departure.
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
X4 · Structured logging · Interpolated log message defeats structured logging · ×2
  • Interpolated log message defeats structured logging crates/dim-app-server/src/agents.rs:1617 — `warn!` at line 1617 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/dim-app-server/src/session_typescript.rs:446 — `info!` at line 446 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 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 (23 single-owned of 617 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; 617 of the 770 production source files in this repository met that bar). They are anonymized user #3 (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: runtime/spikes/session-part.ts.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example crates/dim-client/README.md:1 — `dim-client` is a published crate (`[package]` without `publish = false`) and neither `crates/dim-client/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×1
  • REDACTED
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 9/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/dim-cli`, `crates/dim-client`, `crates/dimcode`, `npm` and 1 more.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation REDACTED:6 — `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code · Unused export 'readProviderList' · ×1
  • Unused export 'readProviderList' web/src/rpc/read.ts:358 — Nothing imports this binding — it is safe to review for removal.
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: `axum::serve(` (xtask/src/scenario_eval.rs:3841).
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete — Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options. Missing: Strict-Transport-Security, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−1.0 on this card.) The server: `axum::serve(` (xtask/src/scenario_eval.rs:3841).
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 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) 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.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure xtask/scenario-eval/eventhub/notice-without-a-tool/workspace/validate.py:7 — `valid_port` returns `False` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch web/src/stores/archive.ts:17 — `readHidden` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 22 finding(s)
D12 · Dependency Hygiene · Outdated · ×21
  • Outdated: croner — `croner` is locked at 4.0.2 but 4.0.3 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in crates/dim-agent-scheduler/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p croner` and commit the updated REDACTED.
  • Outdated: encoding_rs — `encoding_rs` is locked at 0.8.42 but 0.8.44 is the current stable release on crates.io, and it already satisfies the `"0.8.35"` requirement declared in crates/dim-agent-capabilities/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: globset — `globset` is locked at 0.4.20 but 0.4.21 is the current stable release on crates.io, and it already satisfies the `"0.4.18"` requirement declared in crates/dim-agent-capabilities/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p globset` and commit the updated REDACTED.
  • Outdated: hyper — `hyper` is locked at 1.11.1 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper` and commit the updated REDACTED.
  • Outdated: hyper-util — `hyper-util` is locked at 0.1.20 but 0.1.21 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper-util` and commit the updated REDACTED.
  • Outdated: ignore — `ignore` is locked at 0.4.33 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4.25"` requirement declared in crates/dim-agent-capabilities/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ignore` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.189 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2.189"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: rustls-native-certs — `rustls-native-certs` is locked at 0.8.4 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls-native-certs` and commit the updated REDACTED.
  • Outdated: rustls-pki-types — `rustls-pki-types` is locked at 1.15.1 but 1.16.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls-pki-types` and commit the updated REDACTED.
  • Outdated: schemars — `schemars` is locked at 1.2.2 but 1.2.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/dim-agent-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p schemars` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: thiserror — `thiserror` is locked at 2.0.20 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"2.0.20"` requirement declared in crates/dim-agent-capabilities/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.53.3 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1.53.3"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • Outdated: tokio-rustls — `tokio-rustls` is locked at 0.26.4 but 0.26.6 is the current stable release on crates.io, and it already satisfies the `"0.26"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-rustls` and commit the updated REDACTED.
  • Outdated: tokio-util — `tokio-util` is locked at 0.7.19 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7.19"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-util` and commit the updated REDACTED.
  • Outdated: toml — `toml` is locked at 1.2.0+spec-1.1.0 but 1.2.1+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml` and commit the updated REDACTED.
  • Outdated: unicode-width — `unicode-width` is locked at 0.2.0 but 0.2.3 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/dim-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-width` and commit the updated REDACTED.
  • Outdated: uuid — `uuid` is locked at 1.26.1 but 1.29.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/dim-acp/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
  • Outdated: webpki-roots — `webpki-roots` is locked at 1.0.10 but 1.0.12 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webpki-roots` and commit the updated REDACTED.
  • Outdated: zip — `zip` is locked at 9.1.2 but 9.6.1 is the current stable release on crates.io, and it already satisfies the `"9.1"` requirement declared in crates/dim-app-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zip` and commit the updated REDACTED.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names web/src/rpc/read.ts:216 — 0 of 0 documented parameters and 1 of 192 summaries in `dim-web` only repeat the member or parameter name (e.g. "`session.fork`: the new Session's id." for `readForkedSessionId`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-4b06717f7c9848f08e263492092ab6e9/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-4b06717f7c9848f08e263492092ab6e9/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-4b06717f7c9848f08e263492092ab6e9/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=3196" --report-format json --report-path /tmp/watchdog-gitleaks-4b06717f7c9848f08e263492092ab6e9/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-4b06717f7c9848f08e263492092ab6e9/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .11artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .21artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 8 file(s) — `npm/branch-services.d.ts`, `npm/plugin.d.ts`, `runtime/plugins/workflow/store.ts`, `web/src/i18n/en.ts`, `web/src/projection.ts`, … (+3 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e985-5bdd-799b-9d56-9ac6af139b15 · 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