Public report of sengac/fspec, published 21 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 21 October 2026, 23:05 UTC · Survey ID cd_52682a39011f4335b019c1397be1dc46

sengac/fspec

Measured 21 October 2026, 22:59 UTC, at code version 38a9552

CAI score 50out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Down 4 since the last survey

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

A large codebase: 381,562 lines of product code in 23 projects, tests not counted · Estimated rebuild effort: about 4.5 person-years · Weakest lens: Production Readiness, 42

Findings by how serious they are

30 critical 1665 serious 218 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
21 October 2026, 22:59 UTC

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

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

78of 85 dimensions measured by tools. The other 7 are advisory notes from an AI model, which explain the code but don't count towards the score.
1839of 1913 findings point to an exact file and line, so you can open each one in the code. The other 74 concern the repository as a whole, such as missing documentation.
85dimensions across 7 lenses, read from 381,562 lines of product code in 23 projects.
Chapters

Executive summary

sengac/fspec scores 50 out of 100 and is rated Adequate, while five of its seven lenses score higher still: Event Sourcing at 100, Architecture at 96 and Performance at 89, all rated Exemplary, and Maturity at 55 and Security and Compliance at 53, both rated Adequate. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The score is lower than those five because the weakest lens counts most, and here that is Production Readiness, which scores 42 and is rated Adequate. Its Security & performance tooling dimension scores 1 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to resolve the 1 Leaked secret finding(s) in Secret Scanning and to add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing, and if Production Readiness rose to 70, the score would rise from 50 to about 55.

30 findings are critical: 14 in Dependency Vulnerabilities, ten in Static Analysis (SAST), four in IaC & Container Security, one in ADR Conformance and one in Secret Scanning.

Watchdog couldn't measure 8 dimensions in this code, among them Code Coverage, Test Reliability and Navigability, so they are left out of the score. The product code is 381,562 lines, which would take an estimated 4.5 person-years, around €660,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 42 · counts for 46%Code Health 47 · counts for 25%Security and Compliance 53 · counts for 14%Maturity 55 · counts for 8%Performance 89 · counts for 4%Architecture 96 · counts for 2%Event Sourcing 100 · counts for 1%

If Production Readiness rose from 42 to 70, the lowest score rated Strong, the score would rise from 50 to about 55.

Code composition: what the lines of code are
Product code 49%Tests 51%
New since the last survey: 52 findings

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

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

Fixed since the last survey: 19 findings

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

  • Cyclomatic Complexity · App::dispatch_menu_mux (cyclomatic 16) rust/fspec-tui/src/app/dispatch_menu.rs
  • Code Duplication · Near-duplicate member pair (46 shared lines) rust/sessions/src/session_manager.rs
  • Code Duplication · Duplicated block (26–27 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs
  • Code Duplication · Duplicated block (25 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs
  • Code Duplication · Duplicated block (20 lines × 2) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs
  • Code Duplication · Duplicated block (18 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs
  • Code Duplication · Duplicated block (17–18 lines × 2) rust/sessions/src/session_manager.rs
  • Code Duplication · Duplicated block (15 lines × 3) rust/fspec-tui/src/components/menu_bar_help.rs
  • Code Duplication · Duplicated block (12–13 lines × 3) rust/sessions/src/session_manager.rs
  • Code Duplication · Duplicated block (7 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs
  • Code Duplication · Duplicated block (8 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs
  • Churn × Complexity Hotspots · Hotspot: rust/sessions/src/handle_impl.rs rust/sessions/src/handle_impl.rs
  • Churn × Complexity Hotspots · Hotspot: rust/agent-loop/src/stream_chunk_json.rs rust/agent-loop/src/stream_chunk_json.rs
  • Churn × Complexity Hotspots · Hotspot: rust/napi/src/types.rs rust/napi/src/types.rs
  • Churn × Complexity Hotspots · Hotspot: rust/cli/src/interactive/gemini_continuation.rs rust/cli/src/interactive/gemini_continuation.rs
  • Dependency Vulnerabilities · Medium vulnerability: RUSTSEC-2026-0187 REDACTED
  • Supply-chain Provenance & Signing REDACTED
  • Cyclomatic Complexity · Complex function handleSlashCommand (cyclomatic 12, cognitive 4) bridge/telegram-slash-commands.ts
  • Large Files · Large Files
Rebuild cost: about €660,000 · Estimate
Cost to rebuild€220,000 to €1,100,000, for 3,627 to 11,507 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.7 at a score of 50. 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: 381,562 lines of product code

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 5 points · Low effort · Secret Scanning
2
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Raises the score by about 4 points · Medium effort · Security & performance tooling
3
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 2 points · Medium effort · Outbound HTTP resilience

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 €660,000 to build again, about 4.5 person-years of work. Its weakest lens is Production Readiness, at 42 (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
Resolve the 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 1 Secret Scanning findings. 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 6.5 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 222,213 lines over the last 90 days, which is about 901,197 lines a year. At that pace, the extra work comes to an estimated 85.1 to 510.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; 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 — a layering smell or cycle. A clean layered graph has none.

arch codelet-agent-loop codelet-agent-loop codelet-cli codelet-cli codelet-agent-loop->codelet-cli codelet-common codelet-common codelet-agent-loop->codelet-common codelet-core codelet-core codelet-agent-loop->codelet-core codelet-fspec-core codelet-fspec-core codelet-agent-loop->codelet-fspec-core codelet-graph codelet-graph codelet-agent-loop->codelet-graph codelet-providers codelet-providers codelet-agent-loop->codelet-providers codelet-rpc-types codelet-rpc-types codelet-agent-loop->codelet-rpc-types codelet-sessions codelet-sessions codelet-agent-loop->codelet-sessions codelet-tools codelet-tools codelet-agent-loop->codelet-tools rig-core rig-core codelet-agent-loop->rig-core codelet-attachment-viewer codelet-attachment-viewer codelet-cli->codelet-common codelet-cli->codelet-core codelet-cli->codelet-providers codelet-cli->codelet-tools codelet-tui codelet-tui codelet-cli->codelet-tui codelet-cli->rig-core codelet-core->codelet-common codelet-git codelet-git codelet-core->codelet-git codelet-core->codelet-providers codelet-core->codelet-rpc-types codelet-core->codelet-tools codelet-core->rig-core codelet-fspec codelet-fspec codelet-fspec->codelet-agent-loop codelet-fspec->codelet-common codelet-fspec->codelet-core codelet-fspec->codelet-fspec-core codelet-fspec-tui codelet-fspec-tui codelet-fspec->codelet-fspec-tui codelet-fspec->codelet-providers codelet-rpc codelet-rpc codelet-fspec->codelet-rpc codelet-rpc-embedded codelet-rpc-embedded codelet-fspec->codelet-rpc-embedded codelet-rpc-server codelet-rpc-server codelet-fspec->codelet-rpc-server codelet-fspec->codelet-rpc-types codelet-fspec->codelet-sessions codelet-fspec->codelet-tools codelet-fspec-core->codelet-git codelet-fspec-tui->codelet-attachment-viewer codelet-fspec-tui->codelet-fspec-core codelet-fspec-tui->codelet-providers codelet-fspec-tui->codelet-rpc codelet-fspec-tui->codelet-rpc-embedded codelet-fspec-tui->codelet-rpc-server codelet-fspec-tui->codelet-rpc-types codelet-fspec-tui->codelet-sessions codelet-git->codelet-rpc-types codelet-graph->codelet-common codelet-graph->codelet-providers codelet-graph->codelet-tools codelet-graph->rig-core codelet-napi codelet-napi codelet-napi->codelet-cli codelet-napi->codelet-common codelet-napi->codelet-core codelet-napi->codelet-git codelet-napi->codelet-graph codelet-napi->codelet-providers codelet-napi->codelet-rpc-types codelet-napi->codelet-sessions codelet-napi->codelet-tools codelet-napi->rig-core codelet-providers->codelet-common codelet-providers->codelet-rpc-types codelet-providers->codelet-tools codelet-providers->rig-core codelet-rpc->codelet-core codelet-rpc->codelet-git codelet-rpc->codelet-providers codelet-rpc->codelet-rpc-types codelet-rpc-embedded->codelet-rpc codelet-rpc-embedded->codelet-rpc-types codelet-rpc-server->codelet-core codelet-rpc-server->codelet-rpc codelet-rpc-server->codelet-rpc-types codelet-sessions->codelet-cli codelet-sessions->codelet-common codelet-sessions->codelet-core codelet-sessions->codelet-git codelet-sessions->codelet-providers codelet-sessions->codelet-rpc-types codelet-sessions->codelet-tools codelet-sessions->rig-core codelet-tools->codelet-common codelet-tools->rig-core codelet-tui->codelet-common rig-core->codelet-common __more__ +3 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.

1274 modules, with 1785 dependencies between them. 10 loops run through 58 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1234 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 codelet_common.types2 codelet_core.compaction.model3 codelet_core.persistence.message_envelope4 codelet_fspec.add_aggregate5 codelet_fspec_core.commands.init6 codelet_fspec_core.commands.query_estimate_accuracy7 codelet_fspec_core.error8 codelet_fspec_tui.components.dialog_theme9 codelet_graph.graph_entities10 codelet_providers.custom.stream11 rig_core.http_client.sse12 codelet_core.compaction_hook13 codelet_fspec_tui.components14 codelet_rpc_types15 rig_core.providers.cohere.completion16 codelet_cli.session17 codelet_fspec_tui.store.agent_view18 codelet_fspec_tui.store.board19 codelet_fspec_tui.views.provider_settings20 codelet_git.session_status21 rig_core.completion.message22 codelet_fspec_tui.views.agent23 codelet_fspec_tui.views.board24 rig_core.providers.gemini.completion.gemini_api_types25 codelet_fspec_tui.views.navigator26 codelet_rpc27 codelet_sessions.session_manager28 rig_core.completion.request29 codelet_fspec_tui.views.multiplex.types30 rig_core.providers.azure31 rig_core.tool32 codelet_fspec_tui.app.state.state_types33 codelet_tools.facade.wrapper34 rig_core.client35 rig_core.client.builder36 rig_core.providers.deepseek37 rig_core.providers.openai.responses_api38 codelet_sessions.background_session39 rig_core.pipeline.op40 codelet_fspec_core.types.work_unit
1 codelet_common.types
2 codelet_core.compaction.model
3 codelet_core.persistence.message_envelope
4 codelet_fspec.add_aggregate
5 codelet_fspec_core.commands.init
6 codelet_fspec_core.commands.query_estimate_accuracy
7 codelet_fspec_core.error
8 codelet_fspec_tui.components.dialog_theme
9 codelet_graph.graph_entities
10 codelet_providers.custom.stream
11 rig_core.http_client.sse
12 codelet_core.compaction_hook1
13 codelet_fspec_tui.components1
14 codelet_rpc_types1
15 rig_core.providers.cohere.completion33711
16 codelet_cli.session121
17 codelet_fspec_tui.store.agent_view119
18 codelet_fspec_tui.store.board3
19 codelet_fspec_tui.views.provider_settings2
20 codelet_git.session_status1
21 rig_core.completion.message1221
22 codelet_fspec_tui.views.agent11221
23 codelet_fspec_tui.views.board12211
24 rig_core.providers.gemini.completion.gemini_api_types12221311
25 codelet_fspec_tui.views.navigator13111111
26 codelet_rpc25832
27 codelet_sessions.session_manager122112
28 rig_core.completion.request615111
29 codelet_fspec_tui.views.multiplex.types111
30 rig_core.providers.azure11610
31 rig_core.tool131
32 codelet_fspec_tui.app.state.state_types1122611121
33 codelet_tools.facade.wrapper9911
34 rig_core.client31
35 rig_core.client.builder121
36 rig_core.providers.deepseek222196
37 rig_core.providers.openai.responses_api1232411
38 codelet_sessions.background_session1111111
39 rig_core.pipeline.op4
40 codelet_fspec_core.types.work_unit4
Uses a module listed above itPart of a loopThe module itself
1 codelet_common.types2 codelet_core.compaction.model3 codelet_core.persistence.message_envelope4 codelet_fspec.add_aggregate5 codelet_fspec_core.commands.init6 codelet_fspec_core.commands.query_estimate_accuracy7 codelet_fspec_core.error8 codelet_fspec_tui.components.dialog_theme9 codelet_graph.graph_entities10 codelet_providers.custom.stream11 rig_core.http_client.sse12 codelet_core.compaction_hook13 codelet_fspec_tui.components14 codelet_rpc_types15 rig_core.providers.cohere.completion16 codelet_cli.session17 codelet_fspec_tui.store.agent_view18 codelet_fspec_tui.store.board19 codelet_fspec_tui.views.provider_settings20 codelet_git.session_status21 rig_core.completion.message22 codelet_fspec_tui.views.agent23 codelet_fspec_tui.views.board24 rig_core.providers.gemini.completion.gemini_api_types25 codelet_fspec_tui.views.navigator26 codelet_rpc27 codelet_sessions.session_manager28 rig_core.completion.request29 codelet_fspec_tui.views.multiplex.types30 rig_core.providers.azure31 rig_core.tool32 codelet_fspec_tui.app.state.state_types33 codelet_tools.facade.wrapper34 rig_core.client35 rig_core.client.builder36 rig_core.providers.deepseek37 rig_core.providers.openai.responses_api38 codelet_sessions.background_session39 rig_core.pipeline.op40 codelet_fspec_core.types.work_unitcodelet_common.types1codelet_core.compaction.model2codelet_core.persistence.message_envelope3codelet_fspec.add_aggregate4codelet_fspec_core.commands.init5codelet_fspec_core.commands.query_estimate_accuracy6codelet_fspec_core.error7codelet_fspec_tui.components.dialog_theme8codelet_graph.graph_entities9codelet_providers.custom.stream10rig_core.http_client.sse11codelet_core.compaction_hook12codelet_fspec_tui.components13codelet_rpc_types14rig_core.providers.cohere.completion15codelet_cli.session16codelet_fspec_tui.store.agent_view17codelet_fspec_tui.store.board18codelet_fspec_tui.views.provider_settings19codelet_git.session_status20rig_core.completion.message21codelet_fspec_tui.views.agent22codelet_fspec_tui.views.board23rig_core.providers.gemini.completion.gemini_api_types24codelet_fspec_tui.views.navigator25codelet_rpc26codelet_sessions.session_manager27rig_core.completion.request28codelet_fspec_tui.views.multiplex.types29rig_core.providers.azure30rig_core.tool31codelet_fspec_tui.app.state.state_types32codelet_tools.facade.wrapper33rig_core.client34rig_core.client.builder35rig_core.providers.deepseek36rig_core.providers.openai.responses_api37codelet_sessions.background_session38rig_core.pipeline.op39codelet_fspec_core.types.work_unit4011133711121119321122111221122111222131113111111258321221126151111111161013111226111219911311212221961232411111111144+1234 more modules (most-connected shown)

At a glance — Code Health · 47% · Adequate · gated by D2, R3, X4, X5 ·

At a glance — Architecture · 96% · Exemplary ·

At a glance — Maturity · 55% · Adequate · gated by M4 ·

At a glance — Readiness · 42% · Adequate · gated by R6, P3, P7 ·

At a glance — Security · 53% · Adequate · gated by D30, D36 ·

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

At a glance — Performance · 89% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures52High / Critical
A05:2025 — Injection11High / Critical
A02:2025 — Security Misconfiguration8High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Immediately resolve the leaked secret in REDACTED and integrate automated security scanning into the CI pipeline to prevent regressions. Strengthen system resilience by enforcing request timeouts and retry logic on all outbound HTTP calls, while simultaneously establishing standard test and linting scripts in CI. Finally, correct the documentation to accurately reflect the current repository structure and installation procedures.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+4.9 ptsLowSecret Scanning
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.7 ptsMediumSecurity & performance tooling
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.+2.5 ptsMediumOutbound HTTP resilience
Add a test runner (vitest / jest / playwright) and eslint as package.json scripts and run them in CI.+2.3 ptsMediumTooling
Reconcile the README with reality: README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist; docs/BUILD.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist; docs/BUILD.md names `target\release-slim\fspec.exe`, but no file or folder `target/release-slim/fspec.exe` exists; docs/BUILD.md names `target/debug/deps`, but no file or folder `target/debug/deps` exists; docs/MULTIPLEXING.md names `fspec-config.json`, but no file or folder `fspec-config.json` exists.+2.2 ptsMediumDocumentation accuracy
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).+2.0 ptsMediumNullable reference types
Interpolated log message defeats structured logging+1.5 ptsMediumStructured logging
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+1.4 ptsMediumDeployment & Rollback

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.7SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedSecret Scanning: Leaked secret: REDACTED
rust/sessions/src/session_manager.rs5.5MixedGod Classes: ClassTooLong: SessionManager
rust/core/src/session_manager_handle.rs5.5MixedCognitive Complexity: StubSessionManagerHandle::add_supervisor (cognitive 17)
rust/sessions/src/background_session.rs5.7MixedGod Classes: TooManyMethods: BackgroundSession
rust/rpc/src/lib.rs5.9MixedGod Classes: FileTooLong: src/lib.rs
rust/agent-loop/src/agent_loop.rs6.0MixedExplicit Debt: TodoComment
rust/napi/src/agent_loop.rs6.0MixedExplicit Debt: TodoComment
rust/tools/src/mcp.rs6.0MixedExplicit Debt: TodoComment
rust/fspec-core/src/dispatch.rs6.0MixedExplicit Debt: TodoComment
rust/cli/src/interactive/stream_loop.rs7.0Near-cleanCyclomatic Complexity: codelet_cli::interactive::stream_loop::run_agent_stream_internal (cyclomatic 129)
rust/fspec-core/src/commands/update_work_unit_status.rs7.0Near-cleanCyclomatic Complexity: codelet_fspec_core::commands::update_work_unit_status::run (cyclomatic 67)
rust/fspec-core/src/commands/review.rs7.0Near-cleanCyclomatic Complexity: codelet_fspec_core::commands::review::run (cyclomatic 54)
rust/fspec-core/src/commands/show_work_unit.rs7.0Near-cleanCyclomatic Complexity: codelet_fspec_core::commands::show_work_unit::render_text (cyclomatic 45)
rust/sessions/src/handle_impl.rs7.0Near-cleanCyclomatic Complexity: SessionManager::restore_session_messages (cyclomatic 35)
rust/napi/src/session_bindings.rs7.0Near-cleanCyclomatic Complexity: codelet_napi::session_bindings::session_restore_messages (cyclomatic 34)

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

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

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

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

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 78 of 85 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 7 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 85 dimensions across the health lenses
D1D2D3D4D5D6D7D9D10D12D13D14D15D17D19D20D21D22D25D26D29D30D31D34D35D36D37D43AX10AX3AX5AX6AX8AX9C2ES1ES2M1M2M3M4P1P10P11P2P3P4P6P7PF1PF3R1R10R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X27X28X29X3X30X4X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a160b0-ff8a-7e37-be59-ec88e673620a.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.ts, .rs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 182 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,345 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.ts, .rs) and this repository declares a Cargo test suite (rust, 1715 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 1401 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D28 Secrets (history) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `gitleaks` TIMED OUT after 226.2s against a 226.2s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `rust/napi/index.d.ts` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via Dockerfile (REDACTED). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; runtime evidence skipped.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 545 further occurrence(s) are not listed individually; the score already reflects all 585.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
  • 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.
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (7): D19, D20, D21, D22, D25, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

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

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

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

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

126 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was codelet_fspec::main at 200. A further 15 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 codelet_fspec::intercept_ts_help at 167 — they are counted neither in the figure above nor in this dimension's score. 11 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: rust/fspec-core/src/dispatch.rs (codelet_fspec_core::dispatch::run_ported at 166), rust/fspec-core/src/help_dispatch_table.rs (codelet_fspec_core::help_dispatch_table::config_for at 159), rust/agent-loop/src/stream_chunk_json.rs (codelet_agent_loop::stream_chunk_json::stream_chunk_to_json_value at 26), rust/fspec-core/src/validators/json_schema.rs (codelet_fspec_core::validators::json_schema::ajv_message at 26), rust/napi/src/types.rs (codelet_napi::types::stream_chunk_to_json_value at 26), and 6 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.

codelet_fspec_core::commands::update_work_unit_status::run (cyclomatic 67) · ×29rust/fspec-core/src/commands/update_work_unit_status.rs:87
codelet_graph::ast_pipeline::deduplicate_entities (cyclomatic 30) · ×15rust/graph/src/ast_pipeline/mod.rs:288
codelet_fspec_tui::views::board::menu_keys::handle_menu_keys (cyclomatic 40) · ×11rust/fspec-tui/src/views/board/menu_keys.rs:41
codelet_napi::agent_loop::agent_loop (cyclomatic 78) · ×7rust/napi/src/agent_loop.rs:180
codelet_tools::bridge_relay::handle_multiplexed_inbound (cyclomatic 31) · ×7rust/tools/src/bridge_relay.rs:418

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

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with codelet_fspec::main (cyclomatic 200), codelet_cli::interactive::stream_loop::run_agent_stream_internal (cyclomatic 129). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 5.3 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

331 method(s) exceeded the cognitive complexity threshold of 15; the worst was codelet_cli::interactive::stream_loop::run_agent_stream_internal at 412.

codelet_fspec_core::commands::review::run (cognitive 105) · ×82rust/fspec-core/src/commands/review.rs:238
codelet_graph::ast_pipeline::ast_dart_extractor::extract_qualified_calls (cognitive 77) · ×58rust/graph/src/ast_pipeline/ast_dart_extractor.rs:761
codelet_fspec_tui::views::board::menu_keys::handle_menu_keys (cognitive 71) · ×36rust/fspec-tui/src/views/board/menu_keys.rs:41
codelet_tools::bridge_relay::connect_and_relay (cognitive 55) · ×19rust/tools/src/bridge_relay.rs:903
codelet_napi::agent_loop::agent_loop (cognitive 237) · ×14rust/napi/src/agent_loop.rs:180

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with codelet_cli::interactive::stream_loop::run_agent_stream_internal (cognitive 412), codelet_agent_loop::agent_loop::agent_loop (cognitive 279), codelet_napi::agent_loop::agent_loop (cognitive 237). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 2.1 to about 4.3/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 Classes8.8 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

135 god class(es) detected.

FunctionTooLong: codelet_fspec::main · ×53rust/fspec/src/main.rs:2401
FileTooLong: src/main.rs · ×35rust/fspec/src/main.rs
MethodTooLong: AstGrepRefactorTool.execute · ×19rust/tools/src/astgrep_refactor.rs:144
TooManyMethods: App · ×14rust/fspec-tui/src/app/state/state_types.rs:29
ClassTooLong: Mode · ×10rust/fspec/src/main.rs:246

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

What to do

  1. Resolve the 53 FunctionTooLong finding(s) in God Classes — start with main.rs (2), agent_loop.rs (2), review.rs (2). — One of this dimension's main actionable groups (53 warning-level).
  2. Resolve the 35 FileTooLong finding(s) in God Classes — start with lib.rs (2), agent_loop.rs (2), agent_manager_handler.rs (2). — One of this dimension's main actionable groups (35 warning-level).
  3. Resolve the 19 MethodTooLong finding(s) in God Classes — start with dispatch.rs (3), session_manager.rs (3), astgrep_refactor.rs. — One of this dimension's main actionable groups (19 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

860 duplicated block group(s) detected. A further 72 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 932 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (10 lines × 2) · ×64rust/agent-loop/src/inject_summary_handler.rs:54
Duplicated block (7 lines × 2) · ×64rust/agent-loop/src/agent_loop.rs:1573
Duplicated block (8 lines × 2) · ×49rust/fspec-core/src/commands/add_aggregate.rs:154
Duplicated block (6 lines × 2) · ×45rust/agent-loop/src/schedule_handler.rs:41
Duplicated block (9 lines × 2) · ×44rust/agent-loop/src/schedule_handler.rs:30

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

What to do

  1. Resolve the 64 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with session_search_handler.rs (3), wrapper.rs (3), manifest.rs (2). — One of this dimension's main actionable groups (64 warning-level).
  2. Resolve the 64 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with generate_foundation_md.rs (2), composer_dep_extractor.rs (2), background_output.rs (2). — One of this dimension's main actionable groups (64 warning-level).
  3. Resolve the 49 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with remove_command_from_foundation.rs (3), astgrep.rs (3), add_domain_event.rs (2). — One of this dimension's main actionable groups (49 warning-level).

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

D5 · Coupling8.3 / 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.3 / 10 · rule-coverage 100% · ceiling Prevented

23 production modules (Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 6 module(s) off the main sequence, with abstractness counted on 21 of the 23 (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: codelet-attachment-viewer · ×5
Off the main sequence: codelet-common

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.7 / 10Stronggated by 5 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.7 / 10 · rule-coverage 100% · ceiling Verified

5 of 188 classes have LCOM4 above 3.

Low cohesion: SessionManager (LCOM4 26) · ×5rust/sessions/src/session_manager.rs:148

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with session_manager.rs, session_manager_handle.rs, background_session.rs. — One of this dimension's main actionable groups (5 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D7 · Architectural Integrity10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

All 4 mechanizable ADR(s) are enforced: 4 by analyzers, 0 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

✓ On the Gold path — maintain.

Detailed fixes: d7_recommendation.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

12919 test methods: 4211 unit, 8690 integration, 0 BDD, 18 e2e. The JavaScript/TypeScript suite contributes 182 `it`/`test` case(s) across 11 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 12737 `#[test]` function(s) across 1715 file(s) declaring at least one; its unit/integration split is Cargo's own — 1158 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

Mock-dominated test: should forward message when user ID is in whitelist · ×6bridge/__tests__/telegram-endpoint.test.ts:1118

✓ On the Gold path — maintain.

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

D12 · Dependency Hygiene8.0 7.7 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 7.7 / 10 · rule-coverage 96% · ceiling Verified

45 outdated, 0 yanked direct Cargo dependencies. 113 of 118 direct crates were graded against crates.io (0 not published there, 5 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: anyhow · ×45

What to do

  1. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

1 secret(s) detected.

REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: rust/fspec-tui/src/app/dispatch.rs (12×93=1116); rust/fspec/src/main.rs (5×200=1000); rust/cli/src/interactive/stream_loop.rs (5×129=645)

Hotspot: rust/fspec-tui/src/app/dispatch.rs · ×30rust/fspec-tui/src/app/dispatch.rs:11

What to do

  1. Resolve the 30 Hotspot finding(s) in Churn × Complexity Hotspots — start with dispatch.rs (3), agent_loop.rs (2), menu_mouse.rs (2). — One of this dimension's main actionable groups (30 warning-level).

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

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

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

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

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

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

TodoComment · ×12rust/agent-loop/src/agent_loop.rs:236

What to do

  1. Resolve the 12 TodoComment finding(s) in Explicit Debt — start with agent_loop.rs (2), token_tracking.rs (2), configure_tools.rs (2). — One of this dimension's main actionable groups (12 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

The repository's root README and the architecture/Docs markdown files form a complete documentation set: the root README covers installation, update behavior, how it differs from agent harnesses, why Kanban?, the dark factory, quick start, first run, and six key capabilities; the architecture/Docs set documents fspec Bridge Server with an architecture diagram plus component breakdowns (Relay Server, Telegram Endpoint, Relay Endpoint), two-level config for hooks, the 6 lifecycle events, integration tests, RPC-066 parity, a Rust library Rig with features, installation, and a blocklist guide. The README files are well structured with headings and the outline is present in every document. This repository is well documented: the READMEs cover each directory's purpose and usage; architecture/design docs describe the client/server daemon model, the Telegram/relay bridge, Alloy formal verification, and multiplexing configuration; a dedicated Testing Guide covers testing philosophy, Rust fixtures, test filters, workspace rules, and every test type (property-based, snapshot, async). The documentation is comprehensive, well-organized, and complete for its scope. The documentation is excellent: the READMEs and architecture/design docs are all present and well-structured for a research project, covering every documented document in an outline. The Windows Notes, Isolated Sessions & Worktrees, and Research series each show clear problem statements, precise diagnostics, and verified fixes; the unclipped sections (e.g., Why it happens — three separate issues stack up) confirm completeness. There is no missing overview, installation/usage examples, contributing guidance, or licence statement among the visible documents.

Documentation: contradicts the codedocs/BUILD.md

✓ On the Gold path — maintain.

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

D20 · ADR QualityStrong◐ Sampled · advisory

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

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

Evaluated 6 ADR(s) individually; mean quality 8.5/10 (consistently complete and clear). 0 flagged with a specific gap.

ADR has no Decision and Consequences sectionspec/attachments/PROV-029/discovery-context.md:1detected by adr-integrity
ADR has no Context and Consequences sectionspec/attachments/RPC-308/ast-research-show-work-unit.md:1detected by adr-integrity
ADR has no Context and Decision and Consequences sectionspec/attachments/TUI-040/delete-session-research.md:1detected by adr-integrity

What to do

  1. Resolve the 1 ADR has no Decision and Consequences section finding(s) in ADR Quality — start with discovery-context.md. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 ADR has no Context and Consequences section finding(s) in ADR Quality — start with ast-research-show-work-unit.md. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 ADR has no Context and Decision and Consequences section finding(s) in ADR Quality — start with delete-session-research.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyAdequate◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

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

4 API inconsistencies across a 400-member sample of 2063 exposed types.

Duplicate token counting functionality exposed at both the type level (TokenEstimator) and the module level (token_estimator). The module-level function appears to be a static wrapper or duplicate of the type's method, creating confusion on which entry point to use.
Two methods with nearly identical names and signatures (`set_debug_directory` vs `set_debug_directory_raw`) suggest an internal implementation detail (e.g., raw vs validated path) leaked into the public API. This forces users to guess the semantic difference between 'directory' and 'raw directory'.
Two methods for signaling completion: one generic and one specific. This creates an inconsistent API where the caller must decide whether to pass a stop reason or not, rather than having a single `emit_done` that accepts an optional reason.
Inconsistent provider management. `switch_provider` changes the provider on an existing session instance, while `from_provider_manager` appears to be a constructor/factory method that creates a new session or re-initializes it. The distinction between 'switching' and 'creating from manager' is unclear and potentially redundant if the manager is the source of truth.

What to do

  1. Resolve the 1 Duplicate token counting functionality exposed at both the type level… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Two methods with nearly identical names and signatures… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Two methods for signaling completion finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D25 · ADR ConformanceAdequate◐ Sampled · advisory

What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.

Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.

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

1 conform / 1 violate across 6 ADRs.

ADR not followed: PROV-120 — Restore TS-parity first-available model initialization removed by PROV-101spec/attachments/PROV-120/PROV-120-analysis.md

What to do

  1. Resolve the 1 ADR not followed finding(s) in ADR Conformance — start with PROV-120-analysis.md. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce ADR Conformance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D26 · Project Cohesion4.8 / 10Weak✓ Tool-verified

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

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

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

6 of 23 build units (Cargo, checkout, npm) flagged as possibly oversized/incoherent.

Split rust/fspec
Split rust/fspec-core
Split rust/tools

What to do

  1. Resolve the 1 Split rust/fspec finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Split rust/fspec-core finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 Split rust/tools finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

11 finding(s): 0 critical, 10 high, 1 medium, 0 low. 7 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 8 file(s) — `rust/napi/index.d.ts` (line 2839), `scripts/install.sh` (lines 199–204, lines 250–258), `spec/attachments/PROV-002/ast-research-bytes-per-token.json`, `spec/attachments/PROV-002/ast-research-estimate-tokens.json`, `spec/attachments/PROV-002/ast-research-tool-structs.json`, … (+3 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 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

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

45 finding(s): 0 critical, 14 high, 30 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D31 · IaC & Container Security8.3 / 10Adequategated by 4 critical findings✓ Tool-verified

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 4 High IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 warning-level).

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

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

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 1373 of the 1610 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 Coupling10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (docs/SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.8 / 10Exemplary✓ Tool-verified

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

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

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

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

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

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

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

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 Controls4.7 / 10Weak✓ Tool-verified

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.

  • Only 1 place(s) refuse an unauthorized caller — too few to demonstrate default-deny across handlers.

What to do

  • Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

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

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

M1 · Documentation (README)7.5 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add a README to the 23 of 25 project(s) that lack one — worth up to 1.8 pts.
M2 · Architecture documentation7.0 / 10Strong✓ 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.

  • 6 ADR-shaped document(s) detected by content — `spec/attachments/CTX-005/context-window-unification-overview.md`, `spec/attachments/PROV-029/discovery-context.md`, `spec/attachments/PROV-120/PROV-120-analysis.md`, `spec/attachments/RLCD-001/rlcd-integration-research.md`, `spec/attachments/RPC-308/ast-research-show-work-unit.md`, `spec/attachments/TUI-040/delete-session-research.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy0.0 / 10Critical◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:25
  • docs/BUILD.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/BUILD.md:141
  • docs/BUILD.md names `target\release-slim\fspec.exe`, but no file or folder `target/release-slim/fspec.exe` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/BUILD.md:244
  • docs/BUILD.md names `target/debug/deps`, but no file or folder `target/debug/deps` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/BUILD.md:355
  • docs/MULTIPLEXING.md names `fspec-config.json`, but no file or folder `fspec-config.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/MULTIPLEXING.md:112
  • docs/TESTING.md names `target/debug/deps`, but no file or folder `target/debug/deps` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/TESTING.md:65
  • docs/TESTING.md names `temp_dir.rs`, but no file or folder `temp_dir.rs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/TESTING.md:167
  • docs/research/BUG-169-slash-submit-interception-research.md names `src/tui`, but no file or folder `src/tui` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/research/BUG-169-slash-submit-interception-research.md:305
  • docs/research/BUG-181-board-checkpoint-counter-stale-research.md names `update-work-unit-status.ts`, but no file or folder `update-work-unit-status.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/research/BUG-181-board-checkpoint-counter-stale-research.md:98
  • docs/research/BUG-181-board-checkpoint-counter-stale-research.md names `restore-checkpoint.ts`, but no file or folder `restore-checkpoint.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/research/BUG-181-board-checkpoint-counter-stale-research.md:98
  • docs/research/BUG-181-board-checkpoint-counter-stale-research.md names `cleanup-checkpoints.ts`, but no file or folder `cleanup-checkpoints.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/research/BUG-181-board-checkpoint-counter-stale-research.md:99
  • spec/docs/wt-audit/wt-011.md names `rust/git/src/isolated_session.rs`, but no file or folder `rust/git/src/isolated_session.rs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — spec/docs/wt-audit/wt-011.md:52
  • spec/docs/wt-audit/wt-011.md names `isolated_session.rs`, but no file or folder `isolated_session.rs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — spec/docs/wt-audit/wt-011.md:83

What to do

  • Reconcile the README with reality: README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist; docs/BUILD.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist; docs/BUILD.md names `target\release-slim\fspec.exe`, but no file or folder `target/release-slim/fspec.exe` exists; docs/BUILD.md names `target/debug/deps`, but no file or folder `target/debug/deps` exists; docs/MULTIPLEXING.md names `fspec-config.json`, but no file or folder `fspec-config.json` exists.
P1 · CI/CD gates8.5 / 10Exemplary✓ Tool-verified

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

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

What to do

  • Run the test suite in CI via an explicit runner step (`cargo test` for the toolchain this pipeline already uses) and gate merges on it.
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified

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

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

  • 1537/2071 types (74%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.

What to do

  • Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
P11 · BDD / executable specs10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether behaviour is captured as executable Gherkin specifications (a plus for shared understanding) — only assessed when a BDD framework is present.

Method: Filesystem scan: BDD framework presence (SpecFlow, Gherkin files) when a project references a BDD tool. Exhaustive, deterministic.

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

What to do

  • Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ 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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

P7 · Outbound HTTP 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::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. (×13) — rust/fspec-core/src/update/github.rs:42, rust/fspec-core/src/update/github.rs:136, rust/fspec-core/src/update/verify.rs:51, …
  • `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. (×4) — rust/patches/rig-core/src/client/completion.rs:55, rust/patches/rig-core/src/client/completion.rs:138, rust/patches/rig-core/src/extractor.rs:226, …
  • `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. — rust/patches/rig-core/src/providers/openai/client.rs:179
  • `reqwest::blocking::Client::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. — rust/providers/src/codex/codex_auth.rs:177
  • `ureq::post(` 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. — rust/providers/src/oauth/building_blocks.rs:63
  • `ureq::get(` 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. — rust/providers/src/oauth/building_blocks.rs:93

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.
PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

R1 · Type Safety10.0 / 10Exemplary✓ 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.

R10 · Code Duplication8.7 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • bridge/telegram-endpoint.ts:287 · bridge/telegram-formatting.ts:34 — the two spans are one implementation copied and then locally edited — 481 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. — bridge/telegram-endpoint.ts:287
  • bridge/telegram-buffering.ts:51 · bridge/telegram-endpoint.ts:456 — the two spans are one implementation copied and then locally edited — 244 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. — bridge/telegram-buffering.ts:51
  • bridge/telegram-endpoint.ts:248 · bridge/telegram-formatting.ts:192 — 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. — bridge/telegram-endpoint.ts:248
  • bridge/relay-endpoint.ts:399 · bridge/telegram-endpoint.ts:1190 — 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. — bridge/relay-endpoint.ts:399
  • bridge/relay-endpoint.ts:163 · bridge/relay-server.ts:288 — the two spans are one implementation copied and then locally edited — 92 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. — bridge/relay-endpoint.ts:163
  • bridge/relay-server-cli.ts:22 · bridge/telegram-endpoint.ts:1190 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — bridge/relay-server-cli.ts:22
  • bridge/telegram-content-chunker.ts:593 · bridge/telegram-content-chunker.ts:611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — bridge/telegram-content-chunker.ts:593
  • bridge/relay-endpoint-handlers.ts:263 · bridge/relay-server.ts:192 — 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. — bridge/relay-endpoint-handlers.ts:263
  • bridge/relay-endpoint.ts:164 · bridge/relay-endpoint.ts:219 — the two spans are one implementation copied and then locally edited — 62 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. — bridge/relay-endpoint.ts:164
  • bridge/telegram-content-chunker.ts:83 · bridge/telegram-content-chunker.ts:113 — 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. — bridge/telegram-content-chunker.ts:83

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity9.7 / 10Exemplary✓ 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.

  • handleStreamChunk has cyclomatic complexity 31 and cognitive complexity 42; 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. — bridge/telegram-endpoint.ts:529
  • (anonymous) has cyclomatic complexity 23 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — bridge/telegram-endpoint.ts:905
  • formatForTelegram has cyclomatic complexity 21 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 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. — bridge/telegram-endpoint.ts:395
  • getBestSplitPoint has cyclomatic complexity 19 and cognitive complexity 27; 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. — bridge/telegram-content-chunker.ts:329
  • formatForTelegram has cyclomatic complexity 18 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. — bridge/telegram-formatting.ts:143
  • findTableBoundary has cyclomatic complexity 17 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. — bridge/telegram-content-chunker.ts:272
  • handleRelayMessage has cyclomatic complexity 15 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. — bridge/relay-endpoint-handlers.ts:185
  • findListBoundary has cyclomatic complexity 13 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. — bridge/telegram-content-chunker.ts:176
  • handleInboundEnvelope has cyclomatic complexity 13 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 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. — bridge/telegram-endpoint.ts:770

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files3.8 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • bridge/telegram-endpoint.ts has 1069 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — bridge/telegram-endpoint.ts:1
  • bridge/telegram-content-chunker.ts has 548 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — bridge/telegram-content-chunker.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage8.2 / 10Strong✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×2) — bridge/telegram-buffering.ts:1, bridge/relay-server-cli.ts:1

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness10.0 / 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 · Tooling3.3 / 10Weak✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • test ✗ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add a test runner (vitest / jest / playwright) and eslint as package.json scripts and run them in CI.
R7 · Dead Code9.2 / 10Exemplary✓ Tool-verified

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

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

  • Unreachable from the 3 application, 0 tooling and 13 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (3 application, 0 tooling, 13 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make — bridge/telegram-buffering.ts
  • Nothing imports THIS copy of 'formatForTelegram' — but bridge/telegram-endpoint.ts:395 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep bridge/telegram-endpoint.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other. — bridge/telegram-formatting.ts:143
  • Nothing imports THIS copy of 'getMediaTypeFromPath' — but bridge/telegram-endpoint.ts:248 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep bridge/telegram-endpoint.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other. — bridge/telegram-formatting.ts:192
  • Nothing imports this binding — it is safe to review for removal. — bridge/telegram-thinking-handler.ts:107

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

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

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (rust/attachment-viewer/src/lib.rs:71)), 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(` (rust/attachment-viewer/src/lib.rs:71).
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (rust/attachment-viewer/src/lib.rs:71).

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.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

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

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

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X2 · Cancellation 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/1 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `downloadPhotoAsBase64` 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 })`. — bridge/telegram-endpoint.ts:269

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 guard10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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

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

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

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

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

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

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

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

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

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

X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

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

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

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 logging3.5 / 10Weak✓ 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 `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info!` at line 48 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`. — rust/agent-loop/src/terminal_overflow_recovery.rs:48
  • `debug!` at line 61 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: `debug!(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`. — rust/agent-loop/src/persist.rs:61
  • `debug!` at line 132 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: `debug!(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`. — rust/agent-loop/src/persist.rs:132
  • `debug!` at line 190 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: `debug!(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`. — rust/agent-loop/src/persist.rs:190
  • `debug!` at line 221 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: `debug!(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`. — rust/agent-loop/src/persist.rs:221
  • `warn!` at line 251 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`. — rust/agent-loop/src/persist.rs:251
  • `warn!` at line 263 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`. — rust/agent-loop/src/persist.rs:263
  • `debug!` at line 274 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: `debug!(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`. — rust/agent-loop/src/persist.rs:274
  • `debug!` at line 283 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: `debug!(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`. — rust/agent-loop/src/persist.rs:283
  • `warn!` at line 294 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`. — rust/agent-loop/src/persist.rs:294
  • `warn!` at line 306 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`. — rust/agent-loop/src/persist.rs:306
  • `debug!` at line 58 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: `debug!(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`. — rust/agent-loop/src/hooks.rs:58
  • `debug!` at line 63 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: `debug!(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`. — rust/agent-loop/src/hooks.rs:63
  • `debug!` at line 83 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: `debug!(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`. — rust/agent-loop/src/generate_compaction_handler.rs:83
  • `info!` at line 147 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`. — rust/agent-loop/src/generate_compaction_handler.rs:147
  • `warn!` at line 158 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`. — rust/agent-loop/src/generate_compaction_handler.rs:158
  • `warn!` at line 221 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`. — rust/agent-loop/src/generate_compaction_handler.rs:221
  • `info!` at line 559 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`. — rust/agent-loop/src/generate_compaction_handler.rs:559
  • `warn!` at line 710 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`. — rust/agent-loop/src/generate_compaction_handler.rs:710
  • `warn!` at line 720 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`. — rust/agent-loop/src/generate_compaction_handler.rs:720
  • `error!` at line 749 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: `error!(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`. — rust/agent-loop/src/generate_compaction_handler.rs:749
  • `info!` at line 809 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`. — rust/agent-loop/src/generate_compaction_handler.rs:809
  • `debug!` at line 42 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: `debug!(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`. — rust/agent-loop/src/dispatch.rs:42
  • `info!` at line 67 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`. — rust/agent-loop/src/dispatch.rs:67
  • `warn!` at line 74 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`. — rust/agent-loop/src/dispatch.rs:74
  • `warn!` at line 106 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`. — rust/agent-loop/src/dispatch.rs:106
  • `warn!` at line 134 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`. — rust/agent-loop/src/deep_search_handler.rs:134
  • `warn!` at line 258 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`. — rust/agent-loop/src/deep_search_handler.rs:258
  • `warn!` at line 322 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`. — rust/agent-loop/src/deep_search_handler.rs:322
  • `warn!` at line 344 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`. — rust/agent-loop/src/deep_search_handler.rs:344
  • `info!` at line 401 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`. — rust/agent-loop/src/deep_search_handler.rs:401
  • `warn!` at line 466 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`. — rust/agent-loop/src/deep_search_handler.rs:466
  • `warn!` at line 497 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`. — rust/agent-loop/src/deep_search_handler.rs:497
  • `warn!` at line 512 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`. — rust/agent-loop/src/deep_search_handler.rs:512
  • `warn!` at line 519 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`. — rust/agent-loop/src/deep_search_handler.rs:519
  • `warn!` at line 529 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`. — rust/agent-loop/src/deep_search_handler.rs:529
  • `warn!` at line 535 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`. — rust/agent-loop/src/deep_search_handler.rs:535
  • `error!` at line 298 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: `error!(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`. — rust/agent-loop/src/background_output.rs:298
  • `error!` at line 369 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: `error!(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`. — rust/agent-loop/src/background_output.rs:369
  • `warn!` at line 412 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`. — rust/agent-loop/src/background_output.rs:412

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

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

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

  • This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.
  • ~0.3 `!` null assertions per 1k TypeScript source lines — 1 assertion(s) across the 3991 source line(s) of the 13 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: bridge/relay-endpoint-handlers.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

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

Reference — by lens

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

LensScoreRatingImpact
Code Health47%Adequate — gated by D2, R3, X4, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture96%ExemplarySolid.
Maturity55%Adequate — gated by M4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness42%Adequate — gated by R6, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security53%Adequate — gated by D30, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Performance89%ExemplarySolid.
Unscored — 3 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 38 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 45 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's 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)
  • 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 — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — 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 included — the .rs suite was found but not re-run
  • D16 Bus Factor — single-contributor repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • 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.
  • D28 Secrets (history) — gitleaks killed before it finished — this repository's git history not scanned
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 27 value object(s); 7 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • 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
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — 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 — 30 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · Secret Scanning · Leaked secret · ×1
  • REDACTED
D25 · ADR Conformance · ADR not followed · ×1
  • ADR not followed: PROV-120 — Restore TS-parity first-available model initialization removed by PROV-101 spec/attachments/PROV-120/PROV-120-analysis.md — The decision is a correctness correction that the summary reveals via observable behavior — every fresh launch defaults to None, contradicting the original intent of first-available selection. (spec/attachments/PROV-120/PROV-120-analysis.md)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 1665 finding(s)
D2 · Cognitive Complexity · codelet_fspec_core · ×82
  • codelet_fspec_core::commands::review::run (cognitive 105) rust/fspec-core/src/commands/review.rs:238 — codelet_fspec_core::commands::review::run has cognitive complexity 105 (threshold 15). Drivers by points: if/else 44 (67 pts), loops 9 (23 pts), match/switch 2 (12 pts), boolean chains 3 (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.
  • codelet_fspec_core::commands::show_work_unit::render_text (cognitive 100) rust/fspec-core/src/commands/show_work_unit.rs:828 — codelet_fspec_core::commands::show_work_unit::render_text has cognitive complexity 100 (threshold 15). Drivers by points: if/else 36 (64 pts), loops 11 (36 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_core::commands::update_work_unit_status::run (cognitive 82) rust/fspec-core/src/commands/update_work_unit_status.rs:87 — codelet_fspec_core::commands::update_work_unit_status::run has cognitive complexity 82 (threshold 15). Drivers by points: if/else 49 (64 pts), boolean chains 17, loops 1 (nesting depth added 15). 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.
  • codelet_fspec_core::commands::update_work_unit::run (cognitive 72) rust/fspec-core/src/commands/update_work_unit.rs:89 — codelet_fspec_core::commands::update_work_unit::run has cognitive complexity 72 (threshold 15). Drivers by points: if/else 30 (71 pts), match/switch 1 (nesting depth added 41). 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.
  • codelet_fspec_core::commands::update_work_unit_status::step_docstrings::validate_test_step_docstrings (cognitive 60) rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:52 — codelet_fspec_core::commands::update_work_unit_status::step_docstrings::validate_test_step_docstrings has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 5 (14 pts), match/switch 2 (5 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_fspec_core::commands::suggest_dependencies::compute_suggestions (cognitive 54) rust/fspec-core/src/commands/suggest_dependencies.rs:104 — codelet_fspec_core::commands::suggest_dependencies::compute_suggestions has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 7 (11 pts), boolean chains 4 (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.
  • codelet_fspec_core::commands::check::run (cognitive 52) rust/fspec-core/src/commands/check.rs:71 — codelet_fspec_core::commands::check::run has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 4 (12 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 31). 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.
  • codelet_fspec_core::commands::validate_work_units::run (cognitive 52) rust/fspec-core/src/commands/validate_work_units.rs:52 — codelet_fspec_core::commands::validate_work_units::run has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 7 (10 pts), match/switch 3 (8 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.
  • codelet_fspec_core::help::format_command_help (cognitive 51) rust/fspec-core/src/help/mod.rs:88 — codelet_fspec_core::help::format_command_help has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 8 (16 pts), match/switch 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_core::commands::link_coverage::update_stats (cognitive 47) rust/fspec-core/src/commands/link_coverage.rs:590 — codelet_fspec_core::commands::link_coverage::update_stats has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 3 (7 pts), match/switch 1 (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.
  • codelet_fspec_core::commands::add_tag_to_feature::run (cognitive 46) rust/fspec-core/src/commands/add_tag_to_feature.rs:67 — codelet_fspec_core::commands::add_tag_to_feature::run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 4 (7 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_fspec_core::commands::show_work_unit::project_work_unit (cognitive 46) rust/fspec-core/src/commands/show_work_unit.rs:315 — codelet_fspec_core::commands::show_work_unit::project_work_unit has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 3 (12 pts), loops 1 (3 pts) (nesting depth added 31). 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.
  • codelet_fspec_core::commands::unlink_coverage::update_stats (cognitive 45) rust/fspec-core/src/commands/unlink_coverage.rs:289 — codelet_fspec_core::commands::unlink_coverage::update_stats has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (37 pts), loops 3 (7 pts), match/switch 1 (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.
  • codelet_fspec_core::commands::generate_scenarios::run_inner (cognitive 44) rust/fspec-core/src/commands/generate_scenarios.rs:93 — codelet_fspec_core::commands::generate_scenarios::run_inner has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_core::commands::review::build_ai_analysis_reminder (cognitive 42) rust/fspec-core/src/commands/review.rs:794 — codelet_fspec_core::commands::review::build_ai_analysis_reminder has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 5 (16 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_fspec_core::commands::compare_implementations::collect_coverage (cognitive 38) rust/fspec-core/src/commands/compare_implementations.rs:118 — codelet_fspec_core::commands::compare_implementations::collect_coverage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 5 (12 pts), match/switch 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_core::commands::prioritize_work_unit::run (cognitive 38) rust/fspec-core/src/commands/prioritize_work_unit.rs:90 — codelet_fspec_core::commands::prioritize_work_unit::run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (34 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.
  • codelet_fspec_core::commands::validate_tags::render_cli_output (cognitive 38) rust/fspec-core/src/commands/validate_tags.rs:432 — codelet_fspec_core::commands::validate_tags::render_cli_output has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_fspec_core::commands::tag_stats::build_categories (cognitive 37) rust/fspec-core/src/commands/tag_stats.rs:179 — codelet_fspec_core::commands::tag_stats::build_categories has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (14 pts), match/switch 1 (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.
  • codelet_fspec_core::commands::add_background::insert_or_replace_background (cognitive 36) rust/fspec-core/src/commands/add_background.rs:172 — codelet_fspec_core::commands::add_background::insert_or_replace_background has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 10, loops 5 (8 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.
  • codelet_fspec_core::commands::add_tag_to_scenario::run (cognitive 36) rust/fspec-core/src/commands/add_tag_to_scenario.rs:71 — codelet_fspec_core::commands::add_tag_to_scenario::run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 6 (8 pts), boolean chains 3, match/switch 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_core::commands::answer_question::run (cognitive 34) rust/fspec-core/src/commands/answer_question.rs:66 — codelet_fspec_core::commands::answer_question::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 5 (8 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.
  • codelet_fspec_core::commands::remove_tag_from_scenario::run (cognitive 32) rust/fspec-core/src/commands/remove_tag_from_scenario.rs:43 — codelet_fspec_core::commands::remove_tag_from_scenario::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (5 pts), match/switch 3, 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.
  • codelet_fspec_core::commands::search_implementation::read_impl_refs (cognitive 32) rust/fspec-core/src/commands/search_implementation.rs:168 — codelet_fspec_core::commands::search_implementation::read_impl_refs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 5 (11 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.
  • codelet_fspec_core::commands::show_coverage::render_single_markdown (cognitive 32) rust/fspec-core/src/commands/show_coverage.rs:288 — codelet_fspec_core::commands::show_coverage::render_single_markdown has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (13 pts), match/switch 1 (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.
  • + 57 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×64
  • Duplicated block (10 lines × 2) rust/agent-loop/src/inject_summary_handler.rs:54 — rust/agent-loop/src/inject_summary_handler.rs:54-63 | rust/napi/src/inject_summary_handler.rs:59-68 — before extracting anything, compare `rust/agent-loop/src/inject_summary_handler.rs` and `rust/napi/src/inject_summary_handler.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) rust/agent-loop/src/session_search_handler.rs:42 — rust/agent-loop/src/session_search_handler.rs:42-51 | rust/napi/src/session_search_handler.rs:42-51 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) rust/cli/src/interactive/gemini_continuation.rs:266 — rust/cli/src/interactive/gemini_continuation.rs:266-275 | rust/cli/src/interactive/stream_loop.rs:977-986 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/core/src/gemini_history_hook.rs:79 — rust/core/src/gemini_history_hook.rs:79-88 | rust/tools/src/facade/gemini_history.rs:81-90 — 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) rust/core/src/persistence/manifest.rs:689 — rust/core/src/persistence/manifest.rs:689-698 | rust/core/src/persistence/manifest.rs:744-753 — both copies are in the same file, so extract the block into 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) rust/core/src/persistence/manifest.rs:760 — rust/core/src/persistence/manifest.rs:760-769 | rust/core/src/persistence/manifest.rs:1206-1215 — both copies are in the same file, so extract the block into 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) rust/core/src/session_manager_handle.rs:457 — rust/core/src/session_manager_handle.rs:457-466 | rust/sessions/src/handle_impl.rs:239-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:194 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:194-203 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:140-149 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:237 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:237-246 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:207-216 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate_to_foundation.rs` and `rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) rust/fspec-core/src/commands/add_architecture.rs:172 — rust/fspec-core/src/commands/add_architecture.rs:172-181 | rust/fspec-core/src/commands/add_background.rs:173-182 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture.rs` and `rust/fspec-core/src/commands/add_background.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) rust/fspec-core/src/commands/add_command_to_foundation.rs:158 — rust/fspec-core/src/commands/add_command_to_foundation.rs:158-167 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:152-161 — before extracting anything, compare `rust/fspec-core/src/commands/add_command_to_foundation.rs` and `rust/fspec-core/src/commands/remove_command_from_foundation.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/add_domain_event.rs:216 — rust/fspec-core/src/commands/add_domain_event.rs:216-225 | rust/fspec-core/src/commands/add_hotspot.rs:189-198 — before extracting anything, compare `rust/fspec-core/src/commands/add_domain_event.rs` and `rust/fspec-core/src/commands/add_hotspot.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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) rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:166 — rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:166-175 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:155-164 — before extracting anything, compare `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` and `rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/add_tag_to_feature.rs:350 — rust/fspec-core/src/commands/add_tag_to_feature.rs:350-359 | rust/fspec-core/src/commands/add_tag_to_scenario.rs:219-228 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/add_tag_to_scenario.rs:76 — rust/fspec-core/src/commands/add_tag_to_scenario.rs:76-85 | rust/fspec-core/src/commands/remove_tag_from_scenario.rs:48-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/delete_scenario.rs:49 — rust/fspec-core/src/commands/delete_scenario.rs:49-58 | rust/fspec-core/src/commands/delete_step.rs:49-58 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_step.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) rust/fspec-core/src/commands/link_coverage.rs:66 — rust/fspec-core/src/commands/link_coverage.rs:66-75 | rust/fspec-core/src/commands/unlink_coverage.rs:80-89 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 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) rust/fspec-core/src/commands/link_coverage.rs:308 — rust/fspec-core/src/commands/link_coverage.rs:308-317 | rust/fspec-core/src/commands/unlink_coverage.rs:148-157 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 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) rust/fspec-core/src/commands/link_coverage/step.rs:85 — rust/fspec-core/src/commands/link_coverage/step.rs:85-94 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:303-312 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/restore_architecture_note.rs:96 — rust/fspec-core/src/commands/restore_architecture_note.rs:96-105 | rust/fspec-core/src/commands/restore_question.rs:109-118 — before extracting anything, compare `rust/fspec-core/src/commands/restore_architecture_note.rs` and `rust/fspec-core/src/commands/restore_question.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 102 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) rust/fspec-core/src/commands/review.rs:472 — rust/fspec-core/src/commands/review.rs:472-481 | rust/fspec-core/src/commands/review.rs:488-497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/suggest_dependencies.rs:124 — rust/fspec-core/src/commands/suggest_dependencies.rs:124-133 | rust/fspec-core/src/commands/suggest_dependencies.rs:179-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/commands/update_scenario.rs:55 — rust/fspec-core/src/commands/update_scenario.rs:55-64 | rust/fspec-core/src/commands/update_step.rs:65-74 — before extracting anything, compare `rust/fspec-core/src/commands/update_scenario.rs` and `rust/fspec-core/src/commands/update_step.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 98 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) rust/fspec-core/src/commands/update_work_unit_status.rs:1357 — rust/fspec-core/src/commands/update_work_unit_status.rs:1357-1366 | rust/fspec-core/src/virtual_hooks_exec.rs:54-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) rust/fspec-core/src/update/replace.rs:100 — rust/fspec-core/src/update/replace.rs:100-109 | rust/fspec-core/src/update/replace.rs:133-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.
  • + 39 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×64
  • Duplicated block (7 lines × 2) rust/agent-loop/src/agent_loop.rs:1573 — rust/agent-loop/src/agent_loop.rs:1573-1579 | rust/napi/src/agent_loop.rs:1436-1442 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust/core/src/session_manager_handle.rs:2529 — rust/core/src/session_manager_handle.rs:2529-2535 | rust/core/src/session_manager_handle.rs:2551-2557 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/add_dependencies.rs:168 — rust/fspec-core/src/commands/add_dependencies.rs:168-174 | rust/fspec-core/src/commands/add_dependencies.rs:204-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/fspec-core/src/commands/add_rule.rs:110 — rust/fspec-core/src/commands/add_rule.rs:110-120 | rust/fspec-core/src/commands/answer_question.rs:208-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) rust/fspec-core/src/commands/add_tag_to_feature.rs:331 — rust/fspec-core/src/commands/add_tag_to_feature.rs:331-337 | rust/fspec-core/src/commands/add_tag_to_scenario.rs:204-210 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/delete_tag.rs:88 — rust/fspec-core/src/commands/delete_tag.rs:88-94 | rust/fspec-core/src/commands/update_tag.rs:93-99 — before extracting anything, compare `rust/fspec-core/src/commands/delete_tag.rs` and `rust/fspec-core/src/commands/update_tag.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust/fspec-core/src/commands/generate_foundation_md.rs:50 — rust/fspec-core/src/commands/generate_foundation_md.rs:50-56 | rust/fspec-core/src/commands/generate_tags_md.rs:50-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/generate_scenarios.rs:916 — rust/fspec-core/src/commands/generate_scenarios.rs:916-923 | rust/fspec-core/src/commands/generate_scenarios.rs:1029-1035 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/review.rs:567 — rust/fspec-core/src/commands/review.rs:567-573 | rust/fspec-core/src/commands/update_work_unit_status.rs:860-866 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/show_acceptance_criteria.rs:226 — rust/fspec-core/src/commands/show_acceptance_criteria.rs:226-232 | rust/fspec-core/src/commands/show_foundation.rs:158-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) rust/fspec-core/src/commands/show_deleted.rs:133 — rust/fspec-core/src/commands/show_deleted.rs:133-139 | rust/fspec-core/src/commands/show_work_unit.rs:378-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 (7 lines × 2) rust/fspec-tui/src/app/dispatch_provider_settings_oauth.rs:205 — rust/fspec-tui/src/app/dispatch_provider_settings_oauth.rs:205-211 | rust/fspec-tui/src/app/dispatch_provider_settings_oauth.rs:227-233 — both copies are in the same file, so extract the block into 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) rust/fspec-tui/src/views/agent/file_search_popup.rs:171 — rust/fspec-tui/src/views/agent/file_search_popup.rs:171-177 | rust/fspec-tui/src/views/agent/slash_command_popup.rs:169-175 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-tui/src/views/agent/hitl_prompt.rs:150 — rust/fspec-tui/src/views/agent/hitl_prompt.rs:150-156 | rust/fspec-tui/src/views/agent/pause_prompt.rs:147-153 — before extracting anything, compare `rust/fspec-tui/src/views/agent/hitl_prompt.rs` and `rust/fspec-tui/src/views/agent/pause_prompt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust/fspec/src/combined.rs:47 — rust/fspec/src/combined.rs:47-53 | rust/fspec/src/daemon.rs:55-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) rust/fspec/src/delete_features.rs:80 — rust/fspec/src/delete_features.rs:80-86 | rust/fspec/src/retag.rs:77-83 — before extracting anything, compare `rust/fspec/src/delete_features.rs` and `rust/fspec/src/retag.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) rust/fspec/src/generate_foundation_md.rs:27 — rust/fspec/src/generate_foundation_md.rs:27-33 | rust/fspec/src/generate_tags_md.rs:28-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.
  • Duplicated block (7 lines × 2) rust/fspec/src/pause_schedule.rs:54 — rust/fspec/src/pause_schedule.rs:54-60 | rust/fspec/src/resume_schedule.rs:54-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) rust/fspec/src/query_estimation_guide.rs:28 — rust/fspec/src/query_estimation_guide.rs:28-34 | rust/fspec/src/remove_dependency.rs:96-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/git/src/repo_ops.rs:162 — rust/git/src/repo_ops.rs:162-168 | rust/git/src/repo_ops.rs:390-396 — both copies are in the same file, so extract the block into 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) rust/git/src/status.rs:190 — rust/git/src/status.rs:190-196 | rust/git/src/status.rs:262-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:37 — rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:37-43 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:60-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/graph/src/ast_pipeline/ast_rust_extractor.rs:325 — rust/graph/src/ast_pipeline/ast_rust_extractor.rs:325-331 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:369-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust/graph/src/ast_pipeline/cargo_dep_extractor.rs:70 — rust/graph/src/ast_pipeline/cargo_dep_extractor.rs:70-76 | rust/graph/src/ast_pipeline/cargo_dep_extractor.rs:111-117 — both copies are in the same file, so extract the block into 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) rust/graph/src/ast_pipeline/composer_dep_extractor.rs:26 — rust/graph/src/ast_pipeline/composer_dep_extractor.rs:26-32 | rust/graph/src/ast_pipeline/npm_dep_extractor.rs:30-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 39 more in this group — see findings.md.
D2 · Cognitive Complexity · codelet_graph · ×58
  • codelet_graph::ast_pipeline::ast_dart_extractor::extract_qualified_calls (cognitive 77) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:761 — codelet_graph::ast_pipeline::ast_dart_extractor::extract_qualified_calls has cognitive complexity 77 (threshold 15). Drivers by points: if/else 10 (37 pts), loops 7 (27 pts), boolean chains 13 (nesting depth added 47). 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.
  • codelet_graph::ast_pipeline::edge_helpers::extract_call_names_from_body (cognitive 58) rust/graph/src/ast_pipeline/edge_helpers.rs:78 — codelet_graph::ast_pipeline::edge_helpers::extract_call_names_from_body has cognitive complexity 58 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 7 (19 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.
  • codelet_graph::ast_pipeline::deduplicate_entities (cognitive 53) rust/graph/src/ast_pipeline/mod.rs:288 — codelet_graph::ast_pipeline::deduplicate_entities has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (45 pts), match/switch 3 (4 pts), loops 3, boolean chains 1 (nesting depth added 32). Of this number, 51 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_graph::ast_dispatch::dispatch_ast_search (cognitive 52) rust/graph/src/ast_dispatch.rs:185 — codelet_graph::ast_dispatch::dispatch_ast_search has cognitive complexity 52 (threshold 15). Drivers by points: if/else 10 (37 pts), match/switch 4 (10 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::pip_dep_extractor::extract_python_dependencies (cognitive 52) rust/graph/src/ast_pipeline/pip_dep_extractor.rs:14 — codelet_graph::ast_pipeline::pip_dep_extractor::extract_python_dependencies has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 4 (13 pts), boolean chains 1 (nesting depth added 36). 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.
  • codelet_graph::ast_pipeline::ast_ts_extractor::extract_call_names_from_body (cognitive 51) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:351 — codelet_graph::ast_pipeline::ast_ts_extractor::extract_call_names_from_body has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 6 (16 pts), boolean chains 11 (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.
  • codelet_graph::ast_pipeline::ast_python_extractor::extract_imports (cognitive 43) rust/graph/src/ast_pipeline/ast_python_extractor.rs:198 — codelet_graph::ast_pipeline::ast_python_extractor::extract_imports has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (8 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::learnings_dispatch::dispatch_learnings_related (cognitive 42) rust/graph/src/learnings_dispatch.rs:159 — codelet_graph::learnings_dispatch::dispatch_learnings_related has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (34 pts), loops 3 (7 pts), match/switch 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_graph::ast_call_chain::bfs::find_paths (cognitive 36) rust/graph/src/ast_call_chain/bfs.rs:25 — codelet_graph::ast_call_chain::bfs::find_paths has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 2 (7 pts), loops 2 (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.
  • codelet_graph::ast_pipeline::ast_c_extractor::extract_types (cognitive 36) rust/graph/src/ast_pipeline/ast_c_extractor.rs:180 — codelet_graph::ast_pipeline::ast_c_extractor::extract_types has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (8 pts), boolean chains 7 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::pubspec_dep_extractor::parse_pubspec_dependencies (cognitive 36) rust/graph/src/ast_pipeline/pubspec_dep_extractor.rs:55 — codelet_graph::ast_pipeline::pubspec_dep_extractor::parse_pubspec_dependencies has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 5, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::complexity::strip_hash_style (cognitive 35) rust/graph/src/ast_pipeline/complexity.rs:230 — codelet_graph::ast_pipeline::complexity::strip_hash_style has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (10 pts), boolean chains 9 (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.
  • codelet_graph::ast_pipeline::ast_dart_extractor::extract_constructor_invocations_from_body (cognitive 33) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:862 — codelet_graph::ast_pipeline::ast_dart_extractor::extract_constructor_invocations_from_body has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (10 pts), boolean chains 8 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::complexity::strip_c_style (cognitive 33) rust/graph/src/ast_pipeline/complexity.rs:185 — codelet_graph::ast_pipeline::complexity::strip_c_style has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (10 pts), boolean chains 7 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::helpers::strip_comments (cognitive 32) rust/graph/src/ast_pipeline/helpers.rs:345 — codelet_graph::ast_pipeline::helpers::strip_comments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (10 pts), boolean chains 6 (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.
  • codelet_graph::learnings_dispatch::dispatch_learnings_search (cognitive 32) rust/graph/src/learnings_dispatch.rs:22 — codelet_graph::learnings_dispatch::dispatch_learnings_search has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (24 pts), loops 2 (4 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.
  • codelet_graph::ast_pipeline::ast_java_extractor::extract_java_type_annotations (cognitive 31) rust/graph/src/ast_pipeline/ast_java_extractor.rs:418 — codelet_graph::ast_pipeline::ast_java_extractor::extract_java_type_annotations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::java_dep_extractor::extract_java_dependencies (cognitive 31) rust/graph/src/ast_pipeline/java_dep_extractor.rs:12 — codelet_graph::ast_pipeline::java_dep_extractor::extract_java_dependencies has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). 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.
  • codelet_graph::ast_pipeline::ast_ts_extractor::extract_calls (cognitive 30) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:284 — codelet_graph::ast_pipeline::ast_ts_extractor::extract_calls has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 3 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::variables::extract_variables (cognitive 29) rust/graph/src/ast_pipeline/variables.rs:355 — codelet_graph::ast_pipeline::variables::extract_variables has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (7 pts), boolean chains 6, 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.
  • codelet_graph::ast_pipeline::ast_dart_extractor::extract_calls (cognitive 28) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:503 — codelet_graph::ast_pipeline::ast_dart_extractor::extract_calls has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 2 (5 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.
  • codelet_graph::ast_pipeline::ast_go_extractor::extract_go_type_annotations (cognitive 28) rust/graph/src/ast_pipeline/ast_go_extractor.rs:515 — codelet_graph::ast_pipeline::ast_go_extractor::extract_go_type_annotations has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (8 pts), boolean chains 6 (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.
  • codelet_graph::ast_pipeline::ast_java_extractor::extract_calls (cognitive 27) rust/graph/src/ast_pipeline/ast_java_extractor.rs:297 — codelet_graph::ast_pipeline::ast_java_extractor::extract_calls has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_graph::ast_pipeline::incremental::read_stored_mtimes (cognitive 27) rust/graph/src/ast_pipeline/incremental.rs:52 — codelet_graph::ast_pipeline::incremental::read_stored_mtimes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_graph::ast_pipeline::ast_ts_extractor::extract_type_refs (cognitive 24) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:449 — codelet_graph::ast_pipeline::ast_ts_extractor::extract_type_refs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 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.
  • + 33 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×53
  • FunctionTooLong: codelet_fspec::main rust/fspec/src/main.rs:2401 — FunctionTooLong — codelet_fspec::main runs 1225 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 1125 over it, 12.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_agent_loop::agent_loop::agent_loop rust/agent-loop/src/agent_loop.rs:73 — FunctionTooLong — codelet_agent_loop::agent_loop::agent_loop runs 854 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 754 over it, 8.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: codelet_napi::agent_loop::agent_loop rust/napi/src/agent_loop.rs:180 — FunctionTooLong — codelet_napi::agent_loop::agent_loop runs 709 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 609 over it, 7.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_fspec_core::commands::review::run rust/fspec-core/src/commands/review.rs:238 — FunctionTooLong — codelet_fspec_core::commands::review::run runs 288 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 188 over it, 2.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: codelet_fspec_core::dispatch::run_ported rust/fspec-core/src/dispatch.rs:205 — FunctionTooLong — codelet_fspec_core::dispatch::run_ported runs 228 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 128 over it, 2.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: codelet_tools::bridge_relay::handle_multiplexed_inbound rust/tools/src/bridge_relay.rs:418 — FunctionTooLong — codelet_tools::bridge_relay::handle_multiplexed_inbound 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: codelet_agent_loop::generate_compaction_handler::execute_generate_compaction rust/agent-loop/src/generate_compaction_handler.rs:504 — FunctionTooLong — codelet_agent_loop::generate_compaction_handler::execute_generate_compaction runs 204 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_fspec::intercept_ts_help rust/fspec/src/main.rs:4227 — FunctionTooLong — codelet_fspec::intercept_ts_help runs 203 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 103 over it, 2.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: codelet_agent_loop::graph_search_handler::dispatch_action rust/agent-loop/src/graph_search_handler.rs:44 — FunctionTooLong — codelet_agent_loop::graph_search_handler::dispatch_action runs 193 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 93 over it, 1.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: codelet_napi::graph_search_handler::dispatch_action rust/napi/src/graph_search_handler.rs:44 — FunctionTooLong — codelet_napi::graph_search_handler::dispatch_action runs 193 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 93 over it, 1.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: codelet_fspec_core::commands::update_work_unit_status::run rust/fspec-core/src/commands/update_work_unit_status.rs:87 — FunctionTooLong — codelet_fspec_core::commands::update_work_unit_status::run runs 186 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 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_agent_loop::stream_chunk_json::stream_chunk_to_json_value rust/agent-loop/src/stream_chunk_json.rs:16 — FunctionTooLong — codelet_agent_loop::stream_chunk_json::stream_chunk_to_json_value runs 183 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 83 over it, 1.83× 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: codelet_napi::types::stream_chunk_to_json_value rust/napi/src/types.rs:159 — FunctionTooLong — codelet_napi::types::stream_chunk_to_json_value runs 183 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 83 over it, 1.83× 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: codelet_cli::interactive::gemini_continuation::run_continuation_loop rust/cli/src/interactive/gemini_continuation.rs:202 — FunctionTooLong — codelet_cli::interactive::gemini_continuation::run_continuation_loop runs 180 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 80 over it, 1.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.
  • FunctionTooLong: codelet_fspec_core::help_dispatch_table::config_for rust/fspec-core/src/help_dispatch_table.rs:17 — FunctionTooLong — codelet_fspec_core::help_dispatch_table::config_for runs 175 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 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: relay-endpoint.createRelayEndpoint bridge/relay-endpoint.ts:91 — FunctionTooLong — createRelayEndpoint runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.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.
  • FunctionTooLong: codelet_fspec_core::commands::generate_scenarios::run_inner rust/fspec-core/src/commands/generate_scenarios.rs:93 — FunctionTooLong — codelet_fspec_core::commands::generate_scenarios::run_inner runs 170 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 70 over it, 1.70× 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: codelet_sessions::session_creation_helper::create_background_session_inner rust/sessions/src/session_creation_helper.rs:113 — FunctionTooLong — codelet_sessions::session_creation_helper::create_background_session_inner runs 170 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 70 over it, 1.70× 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: codelet_agent_loop::deep_search_handler::build_and_run_agent rust/agent-loop/src/deep_search_handler.rs:445 — FunctionTooLong — codelet_agent_loop::deep_search_handler::build_and_run_agent runs 167 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 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_napi::deep_search_handler::build_and_run_agent rust/napi/src/deep_search_handler.rs:433 — FunctionTooLong — codelet_napi::deep_search_handler::build_and_run_agent runs 167 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 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_tools::bridge_relay::connect_and_relay rust/tools/src/bridge_relay.rs:903 — FunctionTooLong — codelet_tools::bridge_relay::connect_and_relay runs 163 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 63 over it, 1.63× 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: codelet_fspec_core::commands::answer_question::run rust/fspec-core/src/commands/answer_question.rs:66 — FunctionTooLong — codelet_fspec_core::commands::answer_question::run runs 145 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 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_agent_loop::generate_compaction_handler::build_and_run_compactor_agent rust/agent-loop/src/generate_compaction_handler.rs:177 — FunctionTooLong — codelet_agent_loop::generate_compaction_handler::build_and_run_compactor_agent runs 143 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 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_tools::unified_exec::spawning::spawn_pty_process rust/tools/src/unified_exec/spawning.rs:341 — FunctionTooLong — codelet_tools::unified_exec::spawning::spawn_pty_process runs 143 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 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: codelet_graph::ast_pipeline::ast_c_extractor::extract_types rust/graph/src/ast_pipeline/ast_c_extractor.rs:180 — FunctionTooLong — codelet_graph::ast_pipeline::ast_c_extractor::extract_types runs 142 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 42 over it, 1.42× 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.
  • + 28 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×49
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/add_aggregate.rs:154 — rust/fspec-core/src/commands/add_aggregate.rs:154-161 | rust/fspec-core/src/commands/add_command.rs:148-155 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/add_bounded_context.rs:89 — rust/fspec-core/src/commands/add_bounded_context.rs:89-96 | rust/fspec-core/src/commands/add_external_system.rs:90-97 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:309 — rust/fspec-core/src/commands/add_dependencies.rs:309-316 | rust/fspec-core/src/commands/add_dependency.rs:264-271 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/add_domain_event.rs:206 — rust/fspec-core/src/commands/add_domain_event.rs:206-213 | rust/fspec-core/src/commands/add_hotspot.rs:176-183 — before extracting anything, compare `rust/fspec-core/src/commands/add_domain_event.rs` and `rust/fspec-core/src/commands/add_hotspot.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/add_schedule.rs:213 — rust/fspec-core/src/commands/add_schedule.rs:213-220 | rust/fspec-core/src/commands/remove_schedule.rs:107-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/add_tag_to_feature.rs:72 — rust/fspec-core/src/commands/add_tag_to_feature.rs:72-79 | rust/fspec-core/src/commands/remove_tag_from_feature.rs:43-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/compact_work_unit.rs:193 — rust/fspec-core/src/commands/compact_work_unit.rs:193-200 | rust/fspec-core/src/commands/update_work_unit_status.rs:1322-1329 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/compare_implementations.rs:156 — rust/fspec-core/src/commands/compare_implementations.rs:156-163 | rust/fspec-core/src/commands/search_implementation.rs:201-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/generate_scenarios.rs:682 — rust/fspec-core/src/commands/generate_scenarios.rs:682-689 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:241-248 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/remove_command_from_foundation.rs:94 — rust/fspec-core/src/commands/remove_command_from_foundation.rs:94-101 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:97-104 — before extracting anything, compare `rust/fspec-core/src/commands/remove_command_from_foundation.rs` and `rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/remove_command_from_foundation.rs:102 — rust/fspec-core/src/commands/remove_command_from_foundation.rs:102-109 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:105-112 — before extracting anything, compare `rust/fspec-core/src/commands/remove_command_from_foundation.rs` and `rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/remove_command_from_foundation.rs:120 — rust/fspec-core/src/commands/remove_command_from_foundation.rs:120-127 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:123-130 — before extracting anything, compare `rust/fspec-core/src/commands/remove_command_from_foundation.rs` and `rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/remove_example.rs:146 — rust/fspec-core/src/commands/remove_example.rs:146-153 | rust/fspec-core/src/commands/restore_example.rs:148-155 — before extracting anything, compare `rust/fspec-core/src/commands/remove_example.rs` and `rust/fspec-core/src/commands/restore_example.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/review.rs:261 — rust/fspec-core/src/commands/review.rs:261-268 | rust/fspec-core/src/commands/show_work_unit.rs:91-98 — before extracting anything, compare `rust/fspec-core/src/commands/review.rs` and `rust/fspec-core/src/commands/show_work_unit.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec-core/src/commands/review.rs:507 — rust/fspec-core/src/commands/review.rs:507-514 | rust/fspec-core/src/commands/review.rs:804-811 — both copies are in the same file, so extract the block into 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) rust/fspec/src/add_attachment.rs:45 — rust/fspec/src/add_attachment.rs:45-52 | rust/fspec/src/remove_attachment.rs:46-53 — before extracting anything, compare `rust/fspec/src/add_attachment.rs` and `rust/fspec/src/remove_attachment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/fspec/src/main.rs:4110 — rust/fspec/src/main.rs:4110-4117 | rust/fspec/src/main.rs:4184-4191 — both copies are in the same file, so extract the block into 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) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:45 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:45-52 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:45-52 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_swift_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/graph/src/ast_pipeline/ast_python_extractor.rs:325 — rust/graph/src/ast_pipeline/ast_python_extractor.rs:325-332 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:351-358 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_python_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/graph/src/ast_pipeline/ast_python_extractor.rs:418 — rust/graph/src/ast_pipeline/ast_python_extractor.rs:418-425 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:398-405 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_python_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/napi/src/astgrep.rs:317 — rust/napi/src/astgrep.rs:317-324 | rust/napi/src/astgrep.rs:456-463 — both copies are in the same file, so extract the block into 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) rust/napi/src/astgrep.rs:540 — rust/napi/src/astgrep.rs:540-547 | rust/tools/src/astgrep_refactor.rs:374-381 — before extracting anything, compare `rust/napi/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) rust/providers/src/manager.rs:1248 — rust/providers/src/manager.rs:1248-1255 | rust/providers/src/zai.rs:93-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) rust/rpc-types/src/lib.rs:1678 — rust/rpc-types/src/lib.rs:1678-1685 | rust/rpc-types/src/lib.rs:1698-1714 — both copies are in the same file, so extract the block into 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) rust/tools/src/bridge_multiplexed.rs:393 — rust/tools/src/bridge_multiplexed.rs:393-400 | rust/tools/src/bridge_multiplexed.rs:434-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×45
  • Duplicated block (6 lines × 2) rust/agent-loop/src/schedule_handler.rs:41 — rust/agent-loop/src/schedule_handler.rs:41-46 | rust/napi/src/schedule_handler.rs:41-46 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/add_dependency.rs:132 — rust/fspec-core/src/commands/add_dependency.rs:132-137 | rust/fspec-core/src/commands/add_dependency.rs:164-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/add_tag_to_scenario.rs:247 — rust/fspec-core/src/commands/add_tag_to_scenario.rs:247-253 | rust/fspec-core/src/commands/remove_tag_from_scenario.rs:190-195 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/answer_question.rs:239 — rust/fspec-core/src/commands/answer_question.rs:239-244 | rust/fspec-core/src/commands/discover_foundation.rs:537-542 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/delete_scenario.rs:249 — rust/fspec-core/src/commands/delete_scenario.rs:249-259 | rust/fspec-core/src/commands/delete_scenarios.rs:337-342 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/discover_foundation.rs:280 — rust/fspec-core/src/commands/discover_foundation.rs:280-285 | rust/fspec-core/src/commands/show_foundation.rs:99-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/get_scenarios.rs:101 — rust/fspec-core/src/commands/get_scenarios.rs:101-106 | rust/fspec-core/src/commands/tag_stats.rs:117-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:125 — rust/fspec-core/src/commands/link_coverage/step.rs:125-130 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:343-348 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/list_feature_tags.rs:337 — rust/fspec-core/src/commands/list_feature_tags.rs:337-342 | rust/fspec-core/src/commands/list_scenario_tags.rs:346-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.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/query_metrics.rs:225 — rust/fspec-core/src/commands/query_metrics.rs:225-230 | rust/fspec-core/src/commands/query_metrics.rs:242-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/commands/show_foundation.rs:309 — rust/fspec-core/src/commands/show_foundation.rs:309-314 | rust/fspec-core/src/commands/show_foundation.rs:322-330 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/update_work_unit.rs:172 — rust/fspec-core/src/commands/update_work_unit.rs:172-177 | rust/fspec-core/src/commands/update_work_unit_estimate.rs:166-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/fspec-core/src/types/work_unit.rs:167 — rust/fspec-core/src/types/work_unit.rs:167-172 | rust/fspec-core/src/types/work_unit.rs:576-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/fspec-tui/src/app/dispatch_git_state.rs:153 — rust/fspec-tui/src/app/dispatch_git_state.rs:153-158 | rust/fspec-tui/src/app/dispatch_git_state.rs:175-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/fspec-tui/src/components/attachment_picker_dialog.rs:162 — rust/fspec-tui/src/components/attachment_picker_dialog.rs:162-167 | rust/fspec-tui/src/components/role_dialog.rs:181-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) rust/fspec-tui/src/transport/websocket.rs:347 — rust/fspec-tui/src/transport/websocket.rs:347-352 | rust/fspec-tui/src/transport/websocket.rs:373-378 — both copies are in the same file, so extract the block into 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) rust/fspec-tui/src/views/agent/mode_view_render.rs:51 — rust/fspec-tui/src/views/agent/mode_view_render.rs:51-56 | rust/fspec-tui/src/views/agent/mode_view_render.rs:73-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/graph/src/ast_pipeline/ast_rust_extractor.rs:173 — rust/graph/src/ast_pipeline/ast_rust_extractor.rs:173-178 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:174-179 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_rust_extractor.rs` and `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/napi/src/session_bindings.rs:1963 — rust/napi/src/session_bindings.rs:1963-1968 | rust/napi/src/session_bindings.rs:2128-2133 — both copies are in the same file, so extract the block into 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) rust/providers/src/custom/custom_provider.rs:300 — rust/providers/src/custom/custom_provider.rs:300-305 | rust/providers/src/custom/custom_provider.rs:326-331 — both copies are in the same file, so extract the block into 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) rust/providers/src/custom/rig_model.rs:258 — rust/providers/src/custom/rig_model.rs:258-263 | rust/providers/src/custom/rig_model.rs:375-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust/providers/src/openai.rs:499 — rust/providers/src/openai.rs:499-504 | rust/providers/src/zai.rs:329-334 — before extracting anything, compare `rust/providers/src/openai.rs` and `rust/providers/src/zai.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) rust/sessions/src/handle_impl.rs:2523 — rust/sessions/src/handle_impl.rs:2523-2528 | rust/sessions/src/handle_impl.rs:2550-2555 — both copies are in the same file, so extract the block into 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) rust/sessions/src/last_used_model_persistence.rs:82 — rust/sessions/src/last_used_model_persistence.rs:82-88 | rust/tools/src/rlcd/config.rs:231-236 — 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) rust/tools/src/web_search.rs:320 — rust/tools/src/web_search.rs:320-325 | rust/tools/src/web_search.rs:332-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 20 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×44
  • Duplicated block (9 lines × 2) rust/agent-loop/src/schedule_handler.rs:30 — rust/agent-loop/src/schedule_handler.rs:30-38 | rust/napi/src/schedule_handler.rs:30-38 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/core/src/lifecycle_hooks/loader.rs:181 — rust/core/src/lifecycle_hooks/loader.rs:181-189 | rust/core/src/lifecycle_hooks/loader.rs:203-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) rust/fspec-core/src/commands/add_scenario.rs:42 — rust/fspec-core/src/commands/add_scenario.rs:42-50 | rust/fspec-core/src/commands/update_scenario.rs:50-59 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/update_scenario.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/fspec-core/src/commands/add_tag_to_scenario.rs:182 — rust/fspec-core/src/commands/add_tag_to_scenario.rs:182-190 | rust/fspec-core/src/commands/remove_tag_from_scenario.rs:136-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/compare_implementations.rs:147 — rust/fspec-core/src/commands/compare_implementations.rs:147-155 | rust/fspec-core/src/io/coverage_glob.rs:68-76 — 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) rust/fspec-core/src/commands/remove_question.rs:201 — rust/fspec-core/src/commands/remove_question.rs:201-209 | rust/fspec-core/src/commands/restore_question.rs:149-157 — before extracting anything, compare `rust/fspec-core/src/commands/remove_question.rs` and `rust/fspec-core/src/commands/restore_question.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/fspec-core/src/commands/update_work_unit_status.rs:1100 — rust/fspec-core/src/commands/update_work_unit_status.rs:1100-1108 | rust/test-helpers/src/dependency_rules.rs:74-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.
  • Duplicated block (9 lines × 2) rust/fspec/src/add_aggregate.rs:57 — rust/fspec/src/add_aggregate.rs:57-65 | rust/fspec/src/add_command.rs:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) rust/fspec/src/link_coverage.rs:34 — rust/fspec/src/link_coverage.rs:34-42 | rust/fspec/src/unlink_coverage.rs:31-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec/src/validate_config.rs:35 — rust/fspec/src/validate_config.rs:35-43 | rust/fspec/src/validate_hooks.rs:53-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) rust/graph/src/ast_call_chain/snapshot.rs:33 — rust/graph/src/ast_call_chain/snapshot.rs:33-41 | rust/graph/src/ast_dispatch.rs:130-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:349 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:349-357 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:156-164 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_python_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/graph/src/ast_pipeline/ast_java_extractor.rs:519 — rust/graph/src/ast_pipeline/ast_java_extractor.rs:519-527 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:478-486 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_java_extractor.rs` and `rust/graph/src/ast_pipeline/ast_rust_extractor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/graph/src/ast_pipeline/pip_dep_extractor.rs:35 — rust/graph/src/ast_pipeline/pip_dep_extractor.rs:35-43 | rust/graph/src/ast_pipeline/pip_dep_extractor.rs:70-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) rust/napi/src/astgrep.rs:862 — rust/napi/src/astgrep.rs:862-870 | rust/tools/src/astgrep_refactor.rs:801-809 — before extracting anything, compare `rust/napi/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/providers/src/codex/refreshing_client.rs:108 — rust/providers/src/codex/refreshing_client.rs:108-116 | rust/providers/src/oauth/http_middleware.rs:85-93 — 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) rust/sessions/src/handle_impl.rs:1193 — rust/sessions/src/handle_impl.rs:1193-1201 | rust/sessions/src/handle_impl.rs:1623-1631 — both copies are in the same file, so extract the block into 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) rust/sessions/src/model_parsing.rs:70 — rust/sessions/src/model_parsing.rs:70-78 | rust/sessions/src/model_resolution.rs:216-228 — before extracting anything, compare `rust/sessions/src/model_parsing.rs` and `rust/sessions/src/model_resolution.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/tools/src/apply_patch/mod.rs:151 — rust/tools/src/apply_patch/mod.rs:151-159 | rust/tools/src/apply_patch/mod.rs:194-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) rust/tools/src/bridge_relay.rs:546 — rust/tools/src/bridge_relay.rs:546-554 | rust/tools/src/bridge_relay.rs:562-570 — both copies are in the same file, so extract the block into 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) rust/tools/src/bridge_relay.rs:623 — rust/tools/src/bridge_relay.rs:623-631 | rust/tools/src/bridge_relay.rs:640-648 — both copies are in the same file, so extract the block into 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) rust/agent-loop/src/graph_search_handler.rs:33 — rust/agent-loop/src/graph_search_handler.rs:33-41 | rust/napi/src/graph_search_handler.rs:33-41 — before extracting anything, compare `rust/agent-loop/src/graph_search_handler.rs` and `rust/napi/src/graph_search_handler.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/agent-loop/src/thinking_level_detection.rs:155 — rust/agent-loop/src/thinking_level_detection.rs:155-163 | rust/napi/src/thinking_level_detection.rs:186-194 — before extracting anything, compare `rust/agent-loop/src/thinking_level_detection.rs` and `rust/napi/src/thinking_level_detection.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/fspec-core/src/commands/delete_scenario.rs:204 — rust/fspec-core/src/commands/delete_scenario.rs:204-212 | rust/fspec-core/src/commands/delete_step.rs:165-173 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_step.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) rust/fspec-tui/src/app/dispatch_slash_loop.rs:126 — rust/fspec-tui/src/app/dispatch_slash_loop.rs:126-134 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:195-203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×38
  • Duplicated block (11 lines × 2) rust/agent-loop/src/session_search_handler.rs:521 — rust/agent-loop/src/session_search_handler.rs:521-531 | rust/napi/src/session_search_handler.rs:521-531 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/cli/src/interactive/stream_loop.rs:1380 — rust/cli/src/interactive/stream_loop.rs:1380-1390 | rust/cli/src/interactive/stream_loop.rs:1997-2007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/core/src/persistence/manifest.rs:869 — rust/core/src/persistence/manifest.rs:869-879 | rust/core/src/persistence/manifest.rs:897-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/fspec-core/src/commands/link_coverage.rs:591 — rust/fspec-core/src/commands/link_coverage.rs:591-601 | rust/fspec-core/src/commands/unlink_coverage.rs:290-300 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/fspec-core/src/commands/query_metrics.rs:345 — rust/fspec-core/src/commands/query_metrics.rs:345-355 | rust/fspec-core/src/commands/query_work_units.rs:297-307 — before extracting anything, compare `rust/fspec-core/src/commands/query_metrics.rs` and `rust/fspec-core/src/commands/query_work_units.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/fspec-core/src/commands/unlink_coverage.rs:193 — rust/fspec-core/src/commands/unlink_coverage.rs:193-203 | rust/fspec-core/src/commands/unlink_coverage.rs:244-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/fspec-core/src/commands/update_work_unit_status.rs:70 — rust/fspec-core/src/commands/update_work_unit_status.rs:70-80 | rust/fspec-core/src/commands/workflow_automation.rs:109-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/update_work_unit_status.rs:866 — rust/fspec-core/src/commands/update_work_unit_status.rs:866-876 | rust/fspec-core/src/commands/update_work_unit_status.rs:912-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/fspec-tui/src/components/menu_bar/dropdown_paint.rs:198 — rust/fspec-tui/src/components/menu_bar/dropdown_paint.rs:198-208 | rust/fspec-tui/src/components/menu_bar/paint.rs:239-249 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-tui/src/store/agent_view/chunk_tool_result.rs:56 — rust/fspec-tui/src/store/agent_view/chunk_tool_result.rs:56-66 | rust/fspec-tui/src/store/agent_view/chunk_tool_result.rs:136-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/fspec-tui/src/views/full_screen_shell.rs:104 — rust/fspec-tui/src/views/full_screen_shell.rs:104-114 | rust/fspec-tui/src/views/full_screen_shell.rs:142-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/fspec-tui/src/views/multiplex/menu_keys.rs:173 — rust/fspec-tui/src/views/multiplex/menu_keys.rs:173-183 | rust/fspec-tui/src/views/multiplex/menu_keys.rs:197-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/fspec-tui/src/views/provider_settings/list.rs:237 — rust/fspec-tui/src/views/provider_settings/list.rs:237-247 | rust/fspec-tui/src/views/provider_settings/list_nav_render.rs:35-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) rust/fspec/src/add_aggregate.rs:69 — rust/fspec/src/add_aggregate.rs:69-79 | rust/fspec/src/add_command.rs:56-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec/src/add_bounded_context.rs:61 — rust/fspec/src/add_bounded_context.rs:61-71 | rust/fspec/src/add_external_system.rs:62-72 — before extracting anything, compare `rust/fspec/src/add_bounded_context.rs` and `rust/fspec/src/add_external_system.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/fspec/src/checkpoint.rs:67 — rust/fspec/src/checkpoint.rs:67-77 | rust/fspec/src/restore_checkpoint.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) rust/git/src/checkout.rs:41 — rust/git/src/checkout.rs:41-51 | rust/git/src/tree_utils.rs:216-226 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:737 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:737-747 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:529-539 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:810 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:810-820 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:891-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/napi/src/git.rs:122 — rust/napi/src/git.rs:122-132 | rust/napi/src/git.rs:148-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.
  • Duplicated block (11 lines × 2) rust/napi/src/git.rs:223 — rust/napi/src/git.rs:223-233 | rust/napi/src/git.rs:607-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/providers/src/gemini.rs:190 — rust/providers/src/gemini.rs:190-200 | rust/providers/src/zai.rs:261-271 — before extracting anything, compare `rust/providers/src/gemini.rs` and `rust/providers/src/zai.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) rust/rpc/src/lib.rs:785 — rust/rpc/src/lib.rs:785-795 | rust/rpc/src/lib.rs:812-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.
  • Duplicated block (11 lines × 2) rust/sessions/src/handle_impl.rs:359 — rust/sessions/src/handle_impl.rs:359-369 | rust/sessions/src/handle_impl.rs:1222-1232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust/sessions/src/session_manager.rs:847 — rust/sessions/src/session_manager.rs:847-859 | rust/sessions/src/session_manager.rs:1019-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 13 more in this group — see findings.md.
D2 · Cognitive Complexity · codelet_fspec_tui · ×36
  • codelet_fspec_tui::views::board::menu_keys::handle_menu_keys (cognitive 71) rust/fspec-tui/src/views/board/menu_keys.rs:41 — codelet_fspec_tui::views::board::menu_keys::handle_menu_keys has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (54 pts), boolean chains 15, match/switch 1 (2 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.
  • codelet_fspec_tui::views::multiplex::menu_mouse::classify_bar_mouse (cognitive 66) rust/fspec-tui/src/views/multiplex/menu_mouse.rs:81 — codelet_fspec_tui::views::multiplex::menu_mouse::classify_bar_mouse has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (40 pts), match/switch 5 (17 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 37). 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.
  • codelet_fspec_tui::views::board::menu_mouse::handle_menu_mouse (cognitive 54) rust/fspec-tui/src/views/board/menu_mouse.rs:65 — codelet_fspec_tui::views::board::menu_mouse::handle_menu_mouse has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 3 (9 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 31). 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.
  • codelet_fspec_tui::store::agent_view::chunk_tool_result::handle_tool_result (cognitive 38) rust/fspec-tui/src/store/agent_view/chunk_tool_result.rs:55 — codelet_fspec_tui::store::agent_view::chunk_tool_result::handle_tool_result has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (37 pts), match/switch 1 (nesting depth added 26). 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.
  • codelet_fspec_tui::views::multiplex::menu_keys::classify_bar_key (cognitive 38) rust/fspec-tui/src/views/multiplex/menu_keys.rs:120 — codelet_fspec_tui::views::multiplex::menu_keys::classify_bar_key has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 4 (9 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_tui::components::dialog_theme::render_dialog_at (cognitive 36) rust/fspec-tui/src/components/dialog_theme.rs:159 — codelet_fspec_tui::components::dialog_theme::render_dialog_at has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (25 pts), loops 4 (7 pts), boolean chains 4 (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.
  • codelet_fspec_tui::components::menu_bar::paint::paint_menu_bar (cognitive 35) rust/fspec-tui/src/components/menu_bar/paint.rs:34 — codelet_fspec_tui::components::menu_bar::paint::paint_menu_bar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 5 (9 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.
  • codelet_fspec_tui::app::slash_parser::parse_slash_command (cognitive 31) rust/fspec-tui/src/app/slash_parser.rs:109 — codelet_fspec_tui::app::slash_parser::parse_slash_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 6, 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.
  • codelet_fspec_tui::views::agent::text_wrap::wrap_paragraph (cognitive 30) rust/fspec-tui/src/views/agent/text_wrap.rs:57 — codelet_fspec_tui::views::agent::text_wrap::wrap_paragraph has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (26 pts), 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.
  • codelet_fspec_tui::transport::websocket::run_supervisor (cognitive 28) rust/fspec-tui/src/transport/websocket.rs:1549 — codelet_fspec_tui::transport::websocket::run_supervisor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (9 pts), loops 3 (6 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.
  • codelet_fspec_tui::views::agent::scrollback_arrows::paint_selection_arrow_bars (cognitive 27) rust/fspec-tui/src/views/agent/scrollback_arrows.rs:65 — codelet_fspec_tui::views::agent::scrollback_arrows::paint_selection_arrow_bars has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 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.
  • codelet_fspec_tui::views::model_selector::form_render::render_form (cognitive 27) rust/fspec-tui/src/views/model_selector/form_render.rs:44 — codelet_fspec_tui::views::model_selector::form_render::render_form has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 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.
  • codelet_fspec_tui::components::menu_bar::paint::paint_cell (cognitive 25) rust/fspec-tui/src/components/menu_bar/paint.rs:152 — codelet_fspec_tui::components::menu_bar::paint::paint_cell 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_tui::store::agent_view::chunk_wrap::wrap_source (cognitive 25) rust/fspec-tui/src/store/agent_view/chunk_wrap.rs:54 — codelet_fspec_tui::store::agent_view::chunk_wrap::wrap_source has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), boolean chains 2, match/switch 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.
  • codelet_fspec_tui::views::blocklist::panes::render_left_pane (cognitive 25) rust/fspec-tui/src/views/blocklist/panes.rs:28 — codelet_fspec_tui::views::blocklist::panes::render_left_pane has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 1, 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.
  • codelet_fspec_tui::components::help_dialog_scroll::handle_dialog_mouse (cognitive 23) rust/fspec-tui/src/components/help_dialog_scroll.rs:116 — codelet_fspec_tui::components::help_dialog_scroll::handle_dialog_mouse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (4 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_fspec_tui::store::agent_view::chunk_wrap::wrap_tool_call (cognitive 23) rust/fspec-tui/src/store/agent_view/chunk_wrap.rs:130 — codelet_fspec_tui::store::agent_view::chunk_wrap::wrap_tool_call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5 (9 pts), boolean chains 2, 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.
  • codelet_fspec_tui::views::multiplex::layout::split_sizes (cognitive 23) rust/fspec-tui/src/views/multiplex/layout.rs:136 — codelet_fspec_tui::views::multiplex::layout::split_sizes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (5 pts), match/switch 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec_tui::views::provider_settings::list::render_list (cognitive 23) rust/fspec-tui/src/views/provider_settings/list.rs:202 — codelet_fspec_tui::views::provider_settings::list::render_list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 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.
  • codelet_fspec_tui::views::provider_settings::nav_item::build_nav_items (cognitive 23) rust/fspec-tui/src/views/provider_settings/nav_item.rs:79 — codelet_fspec_tui::views::provider_settings::nav_item::build_nav_items has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 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.
  • codelet_fspec_tui::components::dialog_button_hits::content_row_y (cognitive 21) rust/fspec-tui/src/components/dialog_button_hits.rs:89 — codelet_fspec_tui::components::dialog_button_hits::content_row_y has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • codelet_fspec_tui::views::provider_settings::list::handle_list_key (cognitive 21) rust/fspec-tui/src/views/provider_settings/list.rs:27 — codelet_fspec_tui::views::provider_settings::list::handle_list_key has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 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.
  • codelet_fspec_tui::app::dispatch_fspec_runner::run_fspec_command (cognitive 20) rust/fspec-tui/src/app/dispatch_fspec_runner.rs:17 — codelet_fspec_tui::app::dispatch_fspec_runner::run_fspec_command has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (20 pts) (nesting depth added 13). 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.
  • codelet_fspec_tui::app::dispatch_slash_loop::format_interval (cognitive 20) rust/fspec-tui/src/app/dispatch_slash_loop.rs:144 — codelet_fspec_tui::app::dispatch_slash_loop::format_interval has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 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.
  • codelet_fspec_tui::components::menu_bar::dropdown_paint::render_menu_dropdown (cognitive 20) rust/fspec-tui/src/components/menu_bar/dropdown_paint.rs:38 — codelet_fspec_tui::components::menu_bar::dropdown_paint::render_menu_dropdown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 11 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×35
  • FileTooLong: src/main.rs rust/fspec/src/main.rs — FileTooLong — 3278 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 2778 over it, 6.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/session_bindings.rs rust/napi/src/session_bindings.rs — FileTooLong — 1410 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 71 free functions. The bar is 500 significant lines; this is 910 over it, 2.82× 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/handle_impl.rs rust/sessions/src/handle_impl.rs — FileTooLong — 1378 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: SessionManager (101-2436). The bar is 500 significant lines; this is 878 over it, 2.76× 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/session_manager_handle.rs rust/core/src/session_manager_handle.rs — FileTooLong — 1359 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: StubSessionManagerHandle (4 blocks, 1025-2627). The bar is 500 significant lines; this is 859 over it, 2.72× 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: interactive/stream_loop.rs rust/cli/src/interactive/stream_loop.rs — FileTooLong — 1263 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 763 over it, 2.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs rust/rpc/src/lib.rs — FileTooLong — 1233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: FspecServiceImpl (3 blocks, 1122-2404). The bar is 500 significant lines; this is 733 over it, 2.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: transport/websocket.rs rust/fspec-tui/src/transport/websocket.rs — FileTooLong — 1115 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: WebSocketFspecBackend (3 blocks, 56-1529). The bar is 500 significant lines; this is 615 over it, 2.23× 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: facade/wrapper.rs rust/tools/src/facade/wrapper.rs — FileTooLong — 1024 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 524 over it, 2.05× 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/agent_loop.rs rust/napi/src/agent_loop.rs — FileTooLong — 995 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 495 over it, 1.99× 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: commands/generate_scenarios.rs rust/fspec-core/src/commands/generate_scenarios.rs — FileTooLong — 891 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 391 over it, 1.78× 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/agent_loop.rs rust/agent-loop/src/agent_loop.rs — FileTooLong — 873 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 373 over it, 1.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: commands/update_work_unit_status.rs rust/fspec-core/src/commands/update_work_unit_status.rs — FileTooLong — 866 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 366 over it, 1.73× 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/lib.rs rust/rpc-types/src/lib.rs — FileTooLong — 814 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 314 over it, 1.63× 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/mcp.rs rust/tools/src/mcp.rs — FileTooLong — 803 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 303 over it, 1.61× 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_manager.rs rust/sessions/src/session_manager.rs — FileTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: SessionManager (3 blocks, 148-1482). The bar is 500 significant lines; this is 289 over it, 1.58× 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/background_session.rs rust/sessions/src/background_session.rs — FileTooLong — 779 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: BackgroundSession (2 blocks, 270-1852). The bar is 500 significant lines; this is 279 over it, 1.56× 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: transport/embedded.rs rust/fspec-tui/src/transport/embedded.rs — FileTooLong — 746 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: EmbeddedFspecBackend (3 blocks, 41-1132). The bar is 500 significant lines; this is 246 over it, 1.49× 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: persistence/manifest.rs rust/core/src/persistence/manifest.rs — FileTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 227 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/astgrep_refactor.rs rust/tools/src/astgrep_refactor.rs — FileTooLong — 722 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: AstGrepRefactorTool (4 blocks, 117-1180). The bar is 500 significant lines; this is 222 over it, 1.44× 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/canonical.rs rust/fspec-core/src/canonical.rs — FileTooLong — 702 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 202 over it, 1.40× 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/bridge_relay.rs rust/tools/src/bridge_relay.rs — FileTooLong — 673 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 173 over it, 1.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: src/agent_manager_handler.rs rust/agent-loop/src/agent_manager_handler.rs — FileTooLong — 653 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 153 over it, 1.31× 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/agent_manager_handler.rs rust/napi/src/agent_manager_handler.rs — FileTooLong — 635 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 135 over it, 1.27× 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: bridge/telegram-endpoint.ts bridge/telegram-endpoint.ts — FileTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 134 over it, 1.27× 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: commands/review.rs rust/fspec-core/src/commands/review.rs — FileTooLong — 608 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 108 over it, 1.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×31
  • Duplicated block (5 lines × 2) rust/agent-loop/src/session_search_handler.rs:618 — rust/agent-loop/src/session_search_handler.rs:618-622 | rust/napi/src/session_search_handler.rs:618-622 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) rust/common/src/tool_usage.rs:225 — rust/common/src/tool_usage.rs:225-231 | rust/common/src/tool_usage.rs:259-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:271 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:271-275 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:70-74 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate_to_foundation.rs` and `rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) rust/fspec-core/src/commands/create_epic.rs:181 — rust/fspec-core/src/commands/create_epic.rs:181-185 | rust/fspec-core/src/commands/discover_foundation.rs:516-520 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/fspec-core/src/commands/generate_scenarios.rs:1142 — rust/fspec-core/src/commands/generate_scenarios.rs:1142-1147 | rust/fspec-core/src/commands/generate_scenarios.rs:1157-1161 — both copies are in the same file, so extract the block into 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) rust/fspec-tui/src/components/thinking_level_dialog.rs:154 — rust/fspec-tui/src/components/thinking_level_dialog.rs:154-158 | rust/fspec-tui/src/components/thinking_level_dialog.rs:195-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/fspec-tui/src/views/agent/file_search_popup.rs:153 — rust/fspec-tui/src/views/agent/file_search_popup.rs:153-157 | rust/fspec-tui/src/views/agent/slash_command_popup.rs:160-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) rust/fspec/src/add_command_to_foundation.rs:46 — rust/fspec/src/add_command_to_foundation.rs:46-51 | rust/fspec/src/remove_command_from_foundation.rs:45-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) rust/fspec/src/add_domain_event_to_foundation.rs:46 — rust/fspec/src/add_domain_event_to_foundation.rs:46-51 | rust/fspec/src/remove_domain_event_from_foundation.rs:45-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) rust/fspec/src/list_work_units.rs:65 — rust/fspec/src/list_work_units.rs:65-71 | rust/fspec/src/query_work_units.rs:55-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.
  • Duplicated block (5 lines × 2) rust/graph/src/graph_entities.rs:45 — rust/graph/src/graph_entities.rs:45-49 | rust/graph/src/graph_entities.rs:60-64 — both copies are in the same file, so extract the block into 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) rust/graph/src/learnings_context.rs:178 — rust/graph/src/learnings_context.rs:178-182 | rust/graph/src/learnings_context.rs:198-203 — both copies are in the same file, so extract the block into 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) rust/napi/src/models/napi_bindings.rs:164 — rust/napi/src/models/napi_bindings.rs:164-168 | rust/sessions/src/cloud_models.rs:99-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) rust/napi/src/models/napi_bindings.rs:164 — rust/napi/src/models/napi_bindings.rs:164-168 | rust/napi/src/models/testing.rs:49-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) rust/providers/src/claude_auth.rs:97 — rust/providers/src/claude_auth.rs:97-101 | rust/providers/src/codex/codex_auth.rs:74-78 — 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) rust/providers/src/oauth/building_blocks.rs:83 — rust/providers/src/oauth/building_blocks.rs:83-87 | rust/providers/src/oauth/building_blocks.rs:113-117 — both copies are in the same file, so extract the block into 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) rust/sessions/src/session_creation_helper.rs:199 — rust/sessions/src/session_creation_helper.rs:199-203 | rust/sessions/src/session_creation_helper.rs:269-273 — both copies are in the same file, so extract the block into 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) rust/tools/src/ls.rs:253 — rust/tools/src/ls.rs:253-257 | rust/tools/src/ls.rs:270-274 — both copies are in the same file, so extract the block into 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) rust/fspec-tui/src/views/changed_files/mod.rs:249 — rust/fspec-tui/src/views/changed_files/mod.rs:249-253 | rust/fspec-tui/src/views/checkpoints/mod.rs:292-296 — 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) rust/fspec-core/src/commands/update_work_unit.rs:231 — rust/fspec-core/src/commands/update_work_unit.rs:231-237 | rust/fspec-core/src/commands/update_work_unit.rs:293-297 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/update_work_unit_status.rs:469 — rust/fspec-core/src/commands/update_work_unit_status.rs:469-473 | rust/fspec-core/src/commands/update_work_unit_status.rs:483-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust/graph/src/ast_pipeline/ast_c_extractor.rs:257 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:257-261 | rust/graph/src/ast_pipeline/ast_c_extractor.rs:281-285 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/update_scenario.rs:111 — rust/fspec-core/src/commands/update_scenario.rs:111-115 | rust/fspec-core/src/commands/update_step.rs:132-136 — before extracting anything, compare `rust/fspec-core/src/commands/update_scenario.rs` and `rust/fspec-core/src/commands/update_step.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) rust/tools/src/astgrep.rs:459 — rust/tools/src/astgrep.rs:459-463 | rust/tools/src/grep.rs:430-434 — before extracting anything, compare `rust/tools/src/astgrep.rs` and `rust/tools/src/grep.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) rust/fspec-core/src/commands/review.rs:254 — rust/fspec-core/src/commands/review.rs:254-258 | rust/fspec-core/src/commands/show_work_unit.rs:84-88 — before extracting anything, compare `rust/fspec-core/src/commands/review.rs` and `rust/fspec-core/src/commands/show_work_unit.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
  • + 6 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×30
  • Hotspot: rust/fspec-tui/src/app/dispatch.rs rust/fspec-tui/src/app/dispatch.rs:11 — rust/fspec-tui/src/app/dispatch.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in App::dispatch at line 11. 1 of those changes was a fix/bug commit, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/dispatch.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust/fspec/src/main.rs rust/fspec/src/main.rs:2401 — rust/fspec/src/main.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 200 in codelet_fspec::main at line 2401. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust/cli/src/interactive/stream_loop.rs rust/cli/src/interactive/stream_loop.rs:232 — rust/cli/src/interactive/stream_loop.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 129 in codelet_cli::interactive::stream_loop::run_agent_stream_internal at line 232. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/cli/src/interactive/stream_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: rust/fspec-core/src/dispatch.rs rust/fspec-core/src/dispatch.rs:205 — rust/fspec-core/src/dispatch.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 166 in codelet_fspec_core::dispatch::run_ported at line 205. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-core/src/dispatch.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust/agent-loop/src/agent_loop.rs rust/agent-loop/src/agent_loop.rs:73 — rust/agent-loop/src/agent_loop.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in codelet_agent_loop::agent_loop::agent_loop at line 73. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/agent-loop/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: rust/fspec-core/src/help_dispatch_table.rs rust/fspec-core/src/help_dispatch_table.rs:17 — rust/fspec-core/src/help_dispatch_table.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 159 in codelet_fspec_core::help_dispatch_table::config_for at line 17. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-core/src/help_dispatch_table.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: rust/napi/src/agent_loop.rs rust/napi/src/agent_loop.rs:180 — rust/napi/src/agent_loop.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in codelet_napi::agent_loop::agent_loop at line 180. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/napi/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: rust/fspec-tui/src/app/bootstrap.rs rust/fspec-tui/src/app/bootstrap.rs:138 — rust/fspec-tui/src/app/bootstrap.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in App::spawn_subscriber_tasks at line 138. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/bootstrap.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: rust/agent-loop/src/background_output.rs rust/agent-loop/src/background_output.rs:309 — rust/agent-loop/src/background_output.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in BackgroundOutput::emit at line 309. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/agent-loop/src/background_output.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: rust/fspec-tui/src/app/dispatch_slash_commands.rs rust/fspec-tui/src/app/dispatch_slash_commands.rs:28 — rust/fspec-tui/src/app/dispatch_slash_commands.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in App::handle_slash_command at line 28. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/dispatch_slash_commands.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: rust/fspec-tui/src/views/agent/slash_commands.rs rust/fspec-tui/src/views/agent/slash_commands.rs:48 — rust/fspec-tui/src/views/agent/slash_commands.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in SlashCommandAction::name at line 48. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/agent/slash_commands.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: rust/sessions/src/session_creation_helper.rs rust/sessions/src/session_creation_helper.rs:113 — rust/sessions/src/session_creation_helper.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in codelet_sessions::session_creation_helper::create_background_session_inner at line 113. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/sessions/src/session_creation_helper.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: rust/fspec-tui/src/app/events.rs rust/fspec-tui/src/app/events.rs:50 — rust/fspec-tui/src/app/events.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in App::handle_event at line 50. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/events.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: rust/fspec-tui/src/views/agent/dispatch.rs rust/fspec-tui/src/views/agent/dispatch.rs:53 — rust/fspec-tui/src/views/agent/dispatch.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in AgentView::handle_event at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/agent/dispatch.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust/fspec-tui/src/views/navigator.rs rust/fspec-tui/src/views/navigator.rs:167 — rust/fspec-tui/src/views/navigator.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Navigator::apply_action at line 167. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/navigator.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: rust/fspec-tui/src/components/dialog_theme.rs rust/fspec-tui/src/components/dialog_theme.rs:159 — rust/fspec-tui/src/components/dialog_theme.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in codelet_fspec_tui::components::dialog_theme::render_dialog_at at line 159. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/components/dialog_theme.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: rust/fspec-tui/src/app/slash_parser.rs rust/fspec-tui/src/app/slash_parser.rs:109 — rust/fspec-tui/src/app/slash_parser.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in codelet_fspec_tui::app::slash_parser::parse_slash_command at line 109. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/slash_parser.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: rust/fspec-tui/src/views/navigator_mux_events.rs rust/fspec-tui/src/views/navigator_mux_events.rs:25 — rust/fspec-tui/src/views/navigator_mux_events.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Navigator::handle_mux_event at line 25. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/navigator_mux_events.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: rust/fspec-tui/src/app/dispatch_menu.rs rust/fspec-tui/src/app/dispatch_menu.rs:84 — rust/fspec-tui/src/app/dispatch_menu.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in App::dispatch_menu at line 84. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/dispatch_menu.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: rust/fspec-tui/src/views/board.rs rust/fspec-tui/src/views/board.rs:155 — rust/fspec-tui/src/views/board.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in BoardView::handle_event at line 155. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/board.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: rust/fspec-tui/src/views/checkpoints/keys.rs rust/fspec-tui/src/views/checkpoints/keys.rs:81 — rust/fspec-tui/src/views/checkpoints/keys.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in CheckpointsView::handle_mouse at line 81. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/checkpoints/keys.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: rust/fspec-tui/src/app/dispatch_stream_chunks.rs rust/fspec-tui/src/app/dispatch_stream_chunks.rs:46 — rust/fspec-tui/src/app/dispatch_stream_chunks.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in App::handle_stream_chunk_state_updates at line 46. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/dispatch_stream_chunks.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: rust/fspec-tui/src/app/dispatch_checkpoints.rs rust/fspec-tui/src/app/dispatch_checkpoints.rs:195 — rust/fspec-tui/src/app/dispatch_checkpoints.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in App::try_dispatch_checkpoints at line 195. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/app/dispatch_checkpoints.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: rust/fspec-tui/src/views/board/menu_mouse.rs rust/fspec-tui/src/views/board/menu_mouse.rs:65 — rust/fspec-tui/src/views/board/menu_mouse.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in codelet_fspec_tui::views::board::menu_mouse::handle_menu_mouse at line 65. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/fspec-tui/src/views/board/menu_mouse.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: rust/git/src/ghost_commit.rs rust/git/src/ghost_commit.rs:493 — rust/git/src/ghost_commit.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in codelet_git::ghost_commit::restore_ghost_commit at line 493. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-17..2026-10-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-17 21:20:16 +10:00' --until='2026-10-15 21:20:16 +10:00' --full-history --no-merges -- rust/git/src/ghost_commit.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.
  • + 5 more in this group — see findings.md.
D1 · Cyclomatic Complexity · codelet_fspec_core · ×29
  • codelet_fspec_core::commands::update_work_unit_status::run (cyclomatic 67) rust/fspec-core/src/commands/update_work_unit_status.rs:87 — codelet_fspec_core::commands::update_work_unit_status::run has cyclomatic complexity 67 (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.
  • codelet_fspec_core::commands::review::run (cyclomatic 54) rust/fspec-core/src/commands/review.rs:238 — codelet_fspec_core::commands::review::run has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_fspec_core::commands::show_work_unit::render_text (cyclomatic 45) rust/fspec-core/src/commands/show_work_unit.rs:828 — codelet_fspec_core::commands::show_work_unit::render_text 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.
  • codelet_fspec_core::commands::update_work_unit::run (cyclomatic 32) rust/fspec-core/src/commands/update_work_unit.rs:89 — codelet_fspec_core::commands::update_work_unit::run 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.
  • codelet_fspec_core::commands::generate_scenarios::run_inner (cyclomatic 27) rust/fspec-core/src/commands/generate_scenarios.rs:93 — codelet_fspec_core::commands::generate_scenarios::run_inner 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.
  • codelet_fspec_core::help::format_command_help (cyclomatic 27) rust/fspec-core/src/help/mod.rs:88 — codelet_fspec_core::help::format_command_help 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.
  • codelet_fspec_core::commands::add_tag_to_feature::run (cyclomatic 26) rust/fspec-core/src/commands/add_tag_to_feature.rs:67 — codelet_fspec_core::commands::add_tag_to_feature::run 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.
  • codelet_fspec_core::commands::prioritize_work_unit::run (cyclomatic 26) rust/fspec-core/src/commands/prioritize_work_unit.rs:90 — codelet_fspec_core::commands::prioritize_work_unit::run 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.
  • codelet_fspec_core::commands::validate_work_units::run (cyclomatic 26) rust/fspec-core/src/commands/validate_work_units.rs:52 — codelet_fspec_core::commands::validate_work_units::run 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.
  • codelet_fspec_core::commands::add_background::insert_or_replace_background (cyclomatic 25) rust/fspec-core/src/commands/add_background.rs:172 — codelet_fspec_core::commands::add_background::insert_or_replace_background 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.
  • codelet_fspec_core::commands::add_tag_to_scenario::run (cyclomatic 25) rust/fspec-core/src/commands/add_tag_to_scenario.rs:71 — codelet_fspec_core::commands::add_tag_to_scenario::run 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.
  • codelet_fspec_core::commands::suggest_dependencies::compute_suggestions (cyclomatic 25) rust/fspec-core/src/commands/suggest_dependencies.rs:104 — codelet_fspec_core::commands::suggest_dependencies::compute_suggestions 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.
  • codelet_fspec_core::commands::check::run (cyclomatic 23) rust/fspec-core/src/commands/check.rs:71 — codelet_fspec_core::commands::check::run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_fspec_core::commands::add_step::run (cyclomatic 22) rust/fspec-core/src/commands/add_step.rs:46 — codelet_fspec_core::commands::add_step::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.
  • codelet_fspec_core::commands::update_work_unit_status::step_docstrings::validate_test_step_docstrings (cyclomatic 21) rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:52 — codelet_fspec_core::commands::update_work_unit_status::step_docstrings::validate_test_step_docstrings 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.
  • codelet_fspec_core::commands::show_acceptance_criteria::run (cyclomatic 20) rust/fspec-core/src/commands/show_acceptance_criteria.rs:52 — codelet_fspec_core::commands::show_acceptance_criteria::run 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.
  • codelet_fspec_core::commands::answer_question::run (cyclomatic 19) rust/fspec-core/src/commands/answer_question.rs:66 — codelet_fspec_core::commands::answer_question::run 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.
  • codelet_fspec_core::commands::delete_scenarios::run (cyclomatic 17) rust/fspec-core/src/commands/delete_scenarios.rs:62 — codelet_fspec_core::commands::delete_scenarios::run 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.
  • codelet_fspec_core::commands::delete_work_unit::run (cyclomatic 17) rust/fspec-core/src/commands/delete_work_unit.rs:71 — codelet_fspec_core::commands::delete_work_unit::run 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.
  • codelet_fspec_core::commands::generate_scenarios::similarity::jaro_winkler_similarity (cyclomatic 17) rust/fspec-core/src/commands/generate_scenarios.rs:835 — codelet_fspec_core::commands::generate_scenarios::similarity::jaro_winkler_similarity 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.
  • codelet_fspec_core::commands::link_coverage::update_stats (cyclomatic 17) rust/fspec-core/src/commands/link_coverage.rs:590 — codelet_fspec_core::commands::link_coverage::update_stats 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.
  • codelet_fspec_core::commands::link_coverage::step::jaro_winkler (cyclomatic 17) rust/fspec-core/src/commands/link_coverage/step.rs:316 — codelet_fspec_core::commands::link_coverage::step::jaro_winkler 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.
  • codelet_fspec_core::commands::repair_work_units::run (cyclomatic 17) rust/fspec-core/src/commands/repair_work_units.rs:132 — codelet_fspec_core::commands::repair_work_units::run 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.
  • codelet_fspec_core::commands::unlink_coverage::run (cyclomatic 17) rust/fspec-core/src/commands/unlink_coverage.rs:78 — codelet_fspec_core::commands::unlink_coverage::run 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.
  • codelet_fspec_core::commands::update_scenario::run (cyclomatic 17) rust/fspec-core/src/commands/update_scenario.rs:46 — codelet_fspec_core::commands::update_scenario::run 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×28
  • Duplicated block (12 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:1148 — rust/agent-loop/src/agent_manager_handler.rs:1148-1159 | rust/napi/src/agent_manager_handler.rs:1112-1123 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/agent-loop/src/deep_search_provider_config.rs:30 — rust/agent-loop/src/deep_search_provider_config.rs:30-41 | rust/napi/src/deep_search_provider_config.rs:30-41 — before extracting anything, compare `rust/agent-loop/src/deep_search_provider_config.rs` and `rust/napi/src/deep_search_provider_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/agent-loop/src/session_search_handler.rs:688 — rust/agent-loop/src/session_search_handler.rs:688-699 | rust/napi/src/session_search_handler.rs:688-699 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/agent-loop/src/thinking_config.rs:127 — rust/agent-loop/src/thinking_config.rs:127-138 | rust/napi/src/thinking_config.rs:194-207 — before extracting anything, compare `rust/agent-loop/src/thinking_config.rs` and `rust/napi/src/thinking_config.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.
  • Duplicated block (12 lines × 2) rust/agent-loop/src/thinking_config.rs:148 — rust/agent-loop/src/thinking_config.rs:148-159 | rust/napi/src/thinking_config.rs:222-235 — before extracting anything, compare `rust/agent-loop/src/thinking_config.rs` and `rust/napi/src/thinking_config.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.
  • Duplicated block (12 lines × 2) rust/core/src/streaming_display/streaming_token_display.rs:238 — rust/core/src/streaming_display/streaming_token_display.rs:238-249 | rust/core/src/streaming_display/streaming_token_display.rs:295-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/add_question.rs:143 — rust/fspec-core/src/commands/add_question.rs:143-154 | rust/fspec-core/src/commands/add_rule.rs:130-141 — before extracting anything, compare `rust/fspec-core/src/commands/add_question.rs` and `rust/fspec-core/src/commands/add_rule.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/clear_dependencies.rs:196 — rust/fspec-core/src/commands/clear_dependencies.rs:196-207 | rust/fspec-core/src/commands/remove_dependency.rs:176-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:398 — rust/fspec-core/src/commands/link_coverage/step.rs:398-409 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:621-632 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:476 — rust/fspec-core/src/commands/link_coverage/step.rs:476-487 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:696-707 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/unlink_coverage.rs:209 — rust/fspec-core/src/commands/unlink_coverage.rs:209-220 | rust/fspec-core/src/commands/unlink_coverage.rs:237-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/io/gherkin_format.rs:285 — rust/fspec-core/src/io/gherkin_format.rs:285-296 | rust/fspec-core/src/io/gherkin_format.rs:308-319 — both copies are in the same file, so extract the block into 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) rust/fspec-tui/src/components/dialog_button_hits.rs:248 — rust/fspec-tui/src/components/dialog_button_hits.rs:248-259 | rust/fspec-tui/src/components/dialog_button_hits.rs:283-294 — both copies are in the same file, so extract the block into 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) rust/fspec-tui/src/views/changed_files/mod.rs:368 — rust/fspec-tui/src/views/changed_files/mod.rs:368-379 | rust/fspec-tui/src/views/checkpoints/mod.rs:505-516 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) rust/fspec-tui/src/views/multiplex/layout.rs:167 — rust/fspec-tui/src/views/multiplex/layout.rs:167-178 | rust/fspec-tui/src/views/multiplex/layout.rs:205-216 — both copies are in the same file, so extract the block into 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) rust/fspec/src/add_bounded_context.rs:75 — rust/fspec/src/add_bounded_context.rs:75-86 | rust/fspec/src/add_external_system.rs:76-87 — before extracting anything, compare `rust/fspec/src/add_bounded_context.rs` and `rust/fspec/src/add_external_system.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/graph/src/ast_complexity.rs:54 — rust/graph/src/ast_complexity.rs:54-65 | rust/graph/src/ast_complexity.rs:121-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/napi/src/persistence/napi_bindings.rs:698 — rust/napi/src/persistence/napi_bindings.rs:698-709 | rust/napi/src/persistence/napi_bindings.rs:725-736 — both copies are in the same file, so extract the block into 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) rust/providers/src/custom/rig_model.rs:267 — rust/providers/src/custom/rig_model.rs:267-278 | rust/providers/src/custom/rig_model.rs:384-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/rpc-server/src/pump.rs:267 — rust/rpc-server/src/pump.rs:267-278 | rust/rpc-server/src/pump.rs:294-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) rust/tools/src/astgrep.rs:467 — rust/tools/src/astgrep.rs:467-478 | rust/tools/src/astgrep_refactor.rs:1101-1112 — before extracting anything, compare `rust/tools/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:168 — rust/fspec-core/src/commands/link_coverage/step.rs:168-179 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:386-397 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/fspec-core/src/commands/prioritize_work_unit.rs:141 — rust/fspec-core/src/commands/prioritize_work_unit.rs:141-152 | rust/fspec-core/src/commands/prioritize_work_unit.rs:155-166 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/delete_scenario.rs:152 — rust/fspec-core/src/commands/delete_scenario.rs:152-163 | rust/fspec-core/src/commands/delete_step.rs:130-141 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_step.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) rust/fspec/src/add_diagram.rs:56 — rust/fspec/src/add_diagram.rs:56-67 | rust/fspec/src/delete_diagram.rs:45-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 3 more in this group — see findings.md.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×21
  • Outbound HTTP without resilience rust/fspec-core/src/update/github.rs:42 — `reqwest::Client::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 rust/fspec-core/src/update/github.rs:136 — `reqwest::Client::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 rust/fspec-core/src/update/verify.rs:51 — `reqwest::Client::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 rust/patches/rig-core/src/client/completion.rs:55 — `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 rust/patches/rig-core/src/client/completion.rs:138 — `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 rust/patches/rig-core/src/extractor.rs:226 — `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 rust/patches/rig-core/src/providers/openai/client.rs:179 — `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 rust/providers/src/claude_oauth.rs:190 — `reqwest::Client::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 rust/providers/src/claude_refreshing_client.rs:93 — `reqwest::Client::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 rust/providers/src/codex/codex_auth.rs:177 — `reqwest::blocking::Client::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 rust/providers/src/codex/codex_oauth.rs:209 — `reqwest::Client::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 rust/providers/src/codex/refreshing_client.rs:94 — `reqwest::Client::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 rust/providers/src/copilot/oauth_device_code.rs:38 — `reqwest::Client::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 rust/providers/src/copilot/refreshing_client.rs:49 — `reqwest::Client::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 rust/providers/src/custom/custom_provider.rs:209 — `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 rust/providers/src/custom/management.rs:289 — `reqwest::Client::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 rust/providers/src/custom/provider.rs:134 — `reqwest::Client::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 rust/providers/src/oauth/building_blocks.rs:63 — `ureq::post(` 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 rust/providers/src/oauth/building_blocks.rs:93 — `ureq::get(` 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 rust/providers/src/oauth/http_middleware.rs:66 — `reqwest::Client::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 rust/providers/src/oauth/http_middleware.rs:77 — `reqwest::Client::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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×20
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rust/agent-loop/src/agent_manager_handler.rs:377 — rust/agent-loop/src/agent_manager_handler.rs:377-421 | rust/agent-loop/src/agent_manager_handler.rs:424-464 | rust/napi/src/agent_manager_handler.rs:361-405 | rust/napi/src/agent_manager_handler.rs:408-448 — 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) rust/agent-loop/src/agent_manager_handler.rs:932 — rust/agent-loop/src/agent_manager_handler.rs:932-1110 | rust/agent-loop/src/agent_manager_handler.rs:1117-1140 | rust/napi/src/agent_manager_handler.rs:902-1074 | rust/napi/src/agent_manager_handler.rs:1081-1104 — 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) rust/agent-loop/src/schedule_handler.rs:291 — rust/agent-loop/src/schedule_handler.rs:291-317 | rust/agent-loop/src/schedule_handler.rs:319-345 | rust/napi/src/schedule_handler.rs:291-317 | rust/napi/src/schedule_handler.rs:319-345 — 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) rust/core/src/lifecycle_hooks/engine.rs:36 — rust/core/src/lifecycle_hooks/engine.rs:36-77 | rust/core/src/lifecycle_hooks/engine.rs:84-121 | rust/core/src/lifecycle_hooks/engine.rs:128-203 | rust/core/src/lifecycle_hooks/engine.rs:212-251 — 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) rust/core/src/lifecycle_hooks/engine.rs:36 — rust/core/src/lifecycle_hooks/engine.rs:36-77 | rust/core/src/lifecycle_hooks/engine.rs:84-121 | rust/core/src/lifecycle_hooks/engine.rs:128-203 | rust/core/src/lifecycle_hooks/tool_engine.rs:96-150 — 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) rust/fspec-core/src/commands/add_architecture_note.rs:70 — rust/fspec-core/src/commands/add_architecture_note.rs:70-161 | rust/fspec-core/src/commands/remove_architecture_note.rs:100-200 | rust/fspec-core/src/commands/restore_architecture_note.rs:61-193 | rust/fspec-core/src/commands/restore_question.rs:58-187 — 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) rust/fspec-core/src/commands/add_dependencies.rs:159 — rust/fspec-core/src/commands/add_dependencies.rs:159-189 | rust/fspec-core/src/commands/add_dependencies.rs:195-227 | rust/fspec-core/src/commands/add_dependency.rs:123-149 | rust/fspec-core/src/commands/add_dependency.rs:155-186 — 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) rust/fspec-core/src/commands/add_dependencies.rs:370 — rust/fspec-core/src/commands/add_dependencies.rs:370-380 | rust/fspec-core/src/commands/add_dependency.rs:311-321 | rust/fspec-core/src/commands/prioritize_work_unit.rs:70-80 | rust/fspec-core/src/commands/repair_work_units.rs:104-115 — 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) rust/fspec-core/src/commands/add_scenario.rs:38 — rust/fspec-core/src/commands/add_scenario.rs:38-179 | rust/fspec-core/src/commands/add_step.rs:46-231 | rust/fspec-core/src/commands/update_scenario.rs:46-180 | rust/fspec-core/src/commands/update_step.rs:49-186 — 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) rust/fspec-core/src/commands/add_scenario.rs:210 — rust/fspec-core/src/commands/add_scenario.rs:210-231 | rust/fspec-core/src/commands/add_step.rs:308-329 | rust/fspec-core/src/commands/update_scenario.rs:197-218 | rust/fspec-core/src/commands/update_step.rs:202-219 — 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) rust/fspec-core/src/commands/add_scenario.rs:235 — rust/fspec-core/src/commands/add_scenario.rs:235-254 | rust/fspec-core/src/commands/add_step.rs:333-352 | rust/fspec-core/src/commands/update_scenario.rs:222-241 | rust/fspec-core/src/commands/update_step.rs:223-241 — 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) rust/fspec-core/src/commands/check.rs:71 — rust/fspec-core/src/commands/check.rs:71-208 | rust/fspec-core/src/commands/delete_features.rs:46-150 | rust/fspec-core/src/commands/delete_scenarios.rs:62-216 | rust/fspec-core/src/commands/format.rs:38-98 — 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) rust/fspec-core/src/commands/compare_implementations.rs:118 — rust/fspec-core/src/commands/compare_implementations.rs:118-183 | rust/fspec-core/src/commands/search_implementation.rs:168-224 | rust/fspec-core/src/commands/show_test_patterns.rs:142-189 | rust/fspec-core/src/io/coverage_glob.rs:41-104 — 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) rust/fspec-core/src/commands/list_attachments.rs:188 — rust/fspec-core/src/commands/list_attachments.rs:188-211 | rust/fspec-core/src/io/ensure.rs:327-350 | rust/fspec-core/src/io/time.rs:56-79 | rust/tools/src/ls.rs:98-111 — 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) rust/fspec-tui/src/views/agent/multiline_input_select.rs:179 — rust/fspec-tui/src/views/agent/multiline_input_select.rs:179-184 | rust/fspec-tui/src/views/agent/scrollback_copy.rs:142-147 | rust/fspec-tui/src/views/agent/turn_modal_select.rs:193-198 | rust/fspec-tui/src/views/board/details_select.rs:193-198 — 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) rust/fspec/src/add_command_to_foundation.rs:45 — rust/fspec/src/add_command_to_foundation.rs:45-81 | rust/fspec/src/add_domain_event_to_foundation.rs:45-81 | rust/fspec/src/remove_command_from_foundation.rs:44-76 | rust/fspec/src/remove_domain_event_from_foundation.rs:44-76 — 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) rust/fspec/src/remove_example.rs:47 — rust/fspec/src/remove_example.rs:47-73 | rust/fspec/src/remove_question.rs:40-69 | rust/fspec/src/restore_example.rs:58-84 | rust/fspec/src/restore_rule.rs:58-82 — 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) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:43 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:43-84 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:41-90 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:82-131 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:43-92 — 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) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:150 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:150-198 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:337-381 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:510-611 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:664-716 — 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) rust/providers/src/claude.rs:511 — rust/providers/src/claude.rs:511-602 | rust/providers/src/gemini.rs:135-280 | rust/providers/src/openai.rs:429-488 | rust/providers/src/zai.rs:223-318 — 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.
D2 · Cognitive Complexity · codelet_tools · ×19
  • codelet_tools::bridge_relay::connect_and_relay (cognitive 55) rust/tools/src/bridge_relay.rs:903 — codelet_tools::bridge_relay::connect_and_relay has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 9 (25 pts), boolean chains 2, loops 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.
  • codelet_tools::bridge_relay::handle_multiplexed_inbound (cognitive 49) rust/tools/src/bridge_relay.rs:418 — codelet_tools::bridge_relay::handle_multiplexed_inbound has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 8 (17 pts) (nesting depth added 25). 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.
  • codelet_tools::facade::wrapper::validate_and_resolve_path_with_isolation (cognitive 46) rust/tools/src/facade/wrapper.rs:842 — codelet_tools::facade::wrapper::validate_and_resolve_path_with_isolation has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (35 pts), match/switch 3 (7 pts), boolean chains 4 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • codelet_tools::session_search::reassembly::tokenize_line (cognitive 45) rust/tools/src/session_search/reassembly.rs:39 — codelet_tools::session_search::reassembly::tokenize_line has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (42 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_tools::rlcd::decision_validate::validate_questions (cognitive 35) rust/tools/src/rlcd/decision_validate.rs:22 — codelet_tools::rlcd::decision_validate::validate_questions has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (7 pts), match/switch 2 (4 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.
  • codelet_tools::unified_exec::spawning::spawn_reader_task (cognitive 33) rust/tools/src/unified_exec/spawning.rs:63 — codelet_tools::unified_exec::spawning::spawn_reader_task has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (11 pts), match/switch 2 (8 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.
  • codelet_tools::session_search::reassembly::reassemble_content (cognitive 25) rust/tools/src/session_search/reassembly.rs:137 — codelet_tools::session_search::reassembly::reassemble_content has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (6 pts), 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.
  • codelet_tools::unified_exec::spawning::spawn_pty_process (cognitive 25) rust/tools/src/unified_exec/spawning.rs:341 — codelet_tools::unified_exec::spawning::spawn_pty_process has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 7 (9 pts), match/switch 3 (5 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.
  • codelet_tools::unified_exec::exec_stdin::spawn_exec_stdin_detector (cognitive 23) rust/tools/src/unified_exec/exec_stdin.rs:168 — codelet_tools::unified_exec::exec_stdin::spawn_exec_stdin_detector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_tools::apply_patch::parser::parse_update_file (cognitive 22) rust/tools/src/apply_patch/parser.rs:116 — codelet_tools::apply_patch::parser::parse_update_file has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 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.
  • codelet_tools::rlcd::decision::render (cognitive 21) rust/tools/src/rlcd/decision.rs:85 — codelet_tools::rlcd::decision::render has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 2 (9 pts), loops 2 (7 pts), if/else 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_tools::bash_binary_guard::detect_bash_binary_output (cognitive 19) rust/tools/src/bash_binary_guard.rs:52 — codelet_tools::bash_binary_guard::detect_bash_binary_output has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 8. 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.
  • codelet_tools::file_type::detect_by_magic_bytes (cognitive 19) rust/tools/src/file_type.rs:69 — codelet_tools::file_type::detect_by_magic_bytes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • codelet_tools::rlcd::discover::loopback_listen_ports_for_inodes (cognitive 19) rust/tools/src/rlcd/discover.rs:45 — codelet_tools::rlcd::discover::loopback_listen_ports_for_inodes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_tools::profile::attribution::attribute_samples (cognitive 18) rust/tools/src/profile/attribution.rs:135 — codelet_tools::profile::attribution::attribute_samples has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1, 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.
  • codelet_tools::pdf::extract_pdf_images (cognitive 17) rust/tools/src/pdf.rs:324 — codelet_tools::pdf::extract_pdf_images has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_tools::request_user_input::validate_questions (cognitive 17) rust/tools/src/request_user_input.rs:111 — codelet_tools::request_user_input::validate_questions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.
  • codelet_tools::rlcd::spawn::ensure_local_server (cognitive 17) rust/tools/src/rlcd/spawn.rs:131 — codelet_tools::rlcd::spawn::ensure_local_server has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (4 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_tools::web_search::deserialize_web_search_action (cognitive 17) rust/tools/src/web_search.rs:289 — codelet_tools::web_search::deserialize_web_search_action has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (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.
D3 · God Classes · MethodTooLong · ×19
  • MethodTooLong: AstGrepRefactorTool.execute rust/tools/src/astgrep_refactor.rs:144 — MethodTooLong — execute runs 268 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 168 over it, 2.68× 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: BackgroundOutput.emit rust/agent-loop/src/background_output.rs:309 — MethodTooLong — emit runs 185 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 85 over it, 1.85× 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.dispatch rust/fspec-tui/src/app/dispatch.rs:11 — MethodTooLong — dispatch runs 167 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 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BackgroundOutput.emit rust/napi/src/agent_loop.rs:1548 — MethodTooLong — emit runs 164 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 64 over it, 1.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.
  • MethodTooLong: RhaiCustomProviderModel.stream rust/providers/src/custom/rig_model.rs:371 — MethodTooLong — stream runs 161 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 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ReadTool.call rust/tools/src/read.rs:273 — MethodTooLong — call runs 131 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 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionManager.restore_session_messages rust/sessions/src/handle_impl.rs:539 — MethodTooLong — restore_session_messages runs 129 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 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AstGrepTool.execute rust/tools/src/astgrep.rs:175 — MethodTooLong — execute runs 124 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 24 over it, 1.24× 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: GrepTool.execute rust/tools/src/grep.rs:174 — MethodTooLong — execute runs 121 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 21 over it, 1.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.
  • MethodTooLong: SessionManager.create_session_with_id rust/sessions/src/session_manager.rs:715 — MethodTooLong — create_session_with_id runs 118 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 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FileToolFacadeWrapper.call rust/tools/src/facade/wrapper.rs:440 — MethodTooLong — call runs 113 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 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionManager.create_session_from_manifest rust/sessions/src/session_manager.rs:912 — MethodTooLong — create_session_from_manifest runs 112 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 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LsTool.call rust/tools/src/ls.rs:147 — MethodTooLong — call runs 111 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 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ModelSelectorView.handle_key rust/fspec-tui/src/views/model_selector/dispatch.rs:10 — MethodTooLong — handle_key runs 109 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 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentView.handle_event rust/fspec-tui/src/views/agent/dispatch.rs:53 — MethodTooLong — handle_event runs 108 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 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionManager.create_isolated_session_with_id rust/sessions/src/session_manager.rs:1093 — MethodTooLong — create_isolated_session_with_id runs 107 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 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConnectMcpTool.call rust/tools/src/mcp.rs:1223 — MethodTooLong — call runs 106 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 6 over it, 1.06× 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: WebSearchTool.call rust/tools/src/web_search.rs:475 — MethodTooLong — call runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentView.render_session_pane rust/fspec-tui/src/views/agent/pane_render.rs:90 — MethodTooLong — render_session_pane runs 101 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 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×18
  • Duplicated block (15 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:85 — rust/agent-loop/src/agent_manager_handler.rs:85-99 | rust/napi/src/agent_manager_handler.rs:73-87 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:360 — rust/agent-loop/src/agent_manager_handler.rs:360-374 | rust/napi/src/agent_manager_handler.rs:344-358 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/cli/src/interactive/stream_loop.rs:1419 — rust/cli/src/interactive/stream_loop.rs:1419-1434 | rust/cli/src/interactive/stream_loop.rs:2141-2155 — both copies are in the same file, so extract the block into 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) rust/common/src/tool_usage.rs:333 — rust/common/src/tool_usage.rs:333-347 | rust/common/src/tool_usage.rs:404-418 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/add_scenario.rs:46 — rust/fspec-core/src/commands/add_scenario.rs:46-60 | rust/fspec-core/src/commands/add_step.rs:68-82 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/add_step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/fspec-core/src/commands/delete_features.rs:58 — rust/fspec-core/src/commands/delete_features.rs:58-72 | rust/fspec-core/src/commands/delete_scenarios.rs:76-90 — before extracting anything, compare `rust/fspec-core/src/commands/delete_features.rs` and `rust/fspec-core/src/commands/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/fspec-core/src/commands/delete_scenario.rs:217 — rust/fspec-core/src/commands/delete_scenario.rs:217-231 | rust/fspec-core/src/commands/delete_step.rs:178-192 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_step.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/fspec-core/src/commands/list_epics.rs:117 — rust/fspec-core/src/commands/list_epics.rs:117-131 | rust/fspec-core/src/commands/list_prefixes.rs:109-123 — before extracting anything, compare `rust/fspec-core/src/commands/list_epics.rs` and `rust/fspec-core/src/commands/list_prefixes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/fspec-tui/src/components/error_dialog.rs:66 — rust/fspec-tui/src/components/error_dialog.rs:66-80 | rust/fspec-tui/src/components/notification_dialog.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.
  • Duplicated block (15 lines × 2) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:769 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:769-783 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:867-881 — both copies are in the same file, so extract the block into 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) rust/providers/src/claude_refreshing_client.rs:223 — rust/providers/src/claude_refreshing_client.rs:223-237 | rust/providers/src/claude_refreshing_client.rs:277-291 — both copies are in the same file, so extract the block into 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) rust/providers/src/codex/refreshing_client.rs:247 — rust/providers/src/codex/refreshing_client.rs:247-261 | rust/providers/src/codex/refreshing_client.rs:301-315 — both copies are in the same file, so extract the block into 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) rust/providers/src/custom/http.rs:27 — rust/providers/src/custom/http.rs:27-41 | rust/providers/src/custom/http.rs:90-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) rust/tools/src/bash_streams.rs:158 — rust/tools/src/bash_streams.rs:158-172 | rust/tools/src/bash_streams.rs:216-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) rust/tools/src/facade/wrapper.rs:511 — rust/tools/src/facade/wrapper.rs:511-525 | rust/tools/src/facade/wrapper.rs:570-584 — both copies are in the same file, so extract the block into 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) rust/agent-loop/src/background_output.rs:286 — rust/agent-loop/src/background_output.rs:286-300 | rust/napi/src/agent_loop.rs:1525-1539 — before extracting anything, compare `rust/agent-loop/src/background_output.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 267 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) rust/core/src/scheduler/engine.rs:79 — rust/core/src/scheduler/engine.rs:79-93 | rust/core/src/scheduler/engine.rs:104-118 — both copies are in the same file, so extract the block into 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) rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:282 — rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:282-296 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:302-316 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×17
  • Duplicated block (14 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:621 — rust/agent-loop/src/agent_manager_handler.rs:621-634 | rust/napi/src/agent_manager_handler.rs:605-618 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/agent-loop/src/deep_search_handler.rs:461 — rust/agent-loop/src/deep_search_handler.rs:461-474 | rust/napi/src/deep_search_handler.rs:449-462 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/agent-loop/src/session_search_handler.rs:122 — rust/agent-loop/src/session_search_handler.rs:122-135 | rust/napi/src/session_search_handler.rs:122-135 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:234 — rust/fspec-core/src/commands/add_dependencies.rs:234-247 | rust/fspec-core/src/commands/add_dependency.rs:193-206 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:322 — rust/fspec-core/src/commands/add_dependencies.rs:322-335 | rust/fspec-core/src/commands/add_dependency.rs:274-287 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/fspec-core/src/commands/restore_architecture_note.rs:108 — rust/fspec-core/src/commands/restore_architecture_note.rs:108-121 | rust/fspec-core/src/commands/restore_question.rs:121-134 — before extracting anything, compare `rust/fspec-core/src/commands/restore_architecture_note.rs` and `rust/fspec-core/src/commands/restore_question.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/fspec-core/src/commands/update_work_unit.rs:254 — rust/fspec-core/src/commands/update_work_unit.rs:254-267 | rust/fspec-core/src/commands/update_work_unit.rs:302-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/git/src/diff.rs:90 — rust/git/src/diff.rs:90-103 | rust/git/src/diff.rs:130-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:265 — rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:265-278 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:280-293 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/napi/src/astgrep.rs:574 — rust/napi/src/astgrep.rs:574-587 | rust/tools/src/astgrep_refactor.rs:498-511 — before extracting anything, compare `rust/napi/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/providers/src/codex/codex_device_auth.rs:292 — rust/providers/src/codex/codex_device_auth.rs:292-305 | rust/providers/src/codex/codex_oauth_server.rs:173-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) rust/tools/src/bash_output.rs:136 — rust/tools/src/bash_output.rs:136-149 | rust/tools/src/grep.rs:336-349 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) rust/agent-loop/src/deep_search_provider_config.rs:113 — rust/agent-loop/src/deep_search_provider_config.rs:113-126 | rust/napi/src/deep_search_provider_config.rs:113-126 — before extracting anything, compare `rust/agent-loop/src/deep_search_provider_config.rs` and `rust/napi/src/deep_search_provider_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/agent-loop/src/thinking_level_detection.rs:139 — rust/agent-loop/src/thinking_level_detection.rs:139-152 | rust/napi/src/thinking_level_detection.rs:168-183 — before extracting anything, compare `rust/agent-loop/src/thinking_level_detection.rs` and `rust/napi/src/thinking_level_detection.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/providers/src/custom/rig_model.rs:279 — rust/providers/src/custom/rig_model.rs:279-292 | rust/providers/src/custom/rig_model.rs:396-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) rust/fspec-core/src/commands/add_aggregate.rs:121 — rust/fspec-core/src/commands/add_aggregate.rs:121-134 | rust/fspec-core/src/commands/add_command.rs:115-128 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) rust/fspec-core/src/commands/remove_command_from_foundation.rs:75 — rust/fspec-core/src/commands/remove_command_from_foundation.rs:75-88 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:78-91 — before extracting anything, compare `rust/fspec-core/src/commands/remove_command_from_foundation.rs` and `rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×17
  • Duplicated block (13 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:641 — rust/agent-loop/src/agent_manager_handler.rs:641-653 | rust/napi/src/agent_manager_handler.rs:625-637 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/core/src/persistence/manifest.rs:675 — rust/core/src/persistence/manifest.rs:675-687 | rust/core/src/persistence/manifest.rs:730-742 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/add_aggregate.rs:180 — rust/fspec-core/src/commands/add_aggregate.rs:180-192 | rust/fspec-core/src/commands/add_command.rs:168-180 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/commands/add_hotspot.rs:94 — rust/fspec-core/src/commands/add_hotspot.rs:94-106 | rust/fspec-core/src/commands/add_policy.rs:122-134 — before extracting anything, compare `rust/fspec-core/src/commands/add_hotspot.rs` and `rust/fspec-core/src/commands/add_policy.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:378 — rust/fspec-core/src/commands/link_coverage/step.rs:378-390 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:601-613 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/commands/remove_question.rs:137 — rust/fspec-core/src/commands/remove_question.rs:137-149 | rust/fspec-core/src/commands/restore_question.rs:92-104 — before extracting anything, compare `rust/fspec-core/src/commands/remove_question.rs` and `rust/fspec-core/src/commands/restore_question.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/commands/show_test_patterns.rs:169 — rust/fspec-core/src/commands/show_test_patterns.rs:169-181 | rust/fspec-core/src/io/coverage_glob.rs:76-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/generators/tags_md.rs:258 — rust/fspec-core/src/generators/tags_md.rs:258-270 | rust/fspec-core/src/generators/tags_md.rs:274-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) rust/git/src/session_diff.rs:280 — rust/git/src/session_diff.rs:280-292 | rust/git/src/session_diff.rs:304-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) rust/graph/src/ast_dead_code.rs:180 — rust/graph/src/ast_dead_code.rs:180-192 | rust/graph/src/ast_dead_code.rs:207-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) rust/graph/src/ast_pipeline/ast_rust_extractor.rs:135 — rust/graph/src/ast_pipeline/ast_rust_extractor.rs:135-147 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:137-149 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_rust_extractor.rs` and `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:264 — rust/graph/src/ast_pipeline/ast_ts_extractor.rs:264-276 | rust/graph/src/ast_pipeline/edge_helpers.rs:38-50 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` and `rust/graph/src/ast_pipeline/edge_helpers.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/sessions/src/profile_persistence.rs:299 — rust/sessions/src/profile_persistence.rs:299-311 | rust/sessions/src/profile_persistence.rs:378-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 (13 lines × 2) rust/fspec-core/src/commands/add_virtual_hook.rs:72 — rust/fspec-core/src/commands/add_virtual_hook.rs:72-87 | rust/fspec-core/src/commands/remove_virtual_hook.rs:79-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/commands/add_aggregate.rs:104 — rust/fspec-core/src/commands/add_aggregate.rs:104-117 | rust/fspec-core/src/commands/add_command.rs:99-111 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/fspec-core/src/commands/add_hotspot.rs:109 — rust/fspec-core/src/commands/add_hotspot.rs:109-121 | rust/fspec-core/src/commands/add_policy.rs:137-150 — before extracting anything, compare `rust/fspec-core/src/commands/add_hotspot.rs` and `rust/fspec-core/src/commands/add_policy.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) rust/tools/src/facade/fspec_facade.rs:211 — rust/tools/src/facade/fspec_facade.rs:211-223 | rust/tools/src/facade/fspec_facade.rs:356-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · codelet_graph · ×15
  • codelet_graph::ast_pipeline::deduplicate_entities (cyclomatic 30) rust/graph/src/ast_pipeline/mod.rs:288 — codelet_graph::ast_pipeline::deduplicate_entities has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_graph::ast_pipeline::ast_dart_extractor::extract_qualified_calls (cyclomatic 30) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:761 — codelet_graph::ast_pipeline::ast_dart_extractor::extract_qualified_calls 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.
  • codelet_graph::ast_pipeline::edge_helpers::extract_call_names_from_body (cyclomatic 30) rust/graph/src/ast_pipeline/edge_helpers.rs:78 — codelet_graph::ast_pipeline::edge_helpers::extract_call_names_from_body 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.
  • codelet_graph::ast_pipeline::ast_ts_extractor::extract_call_names_from_body (cyclomatic 26) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:351 — codelet_graph::ast_pipeline::ast_ts_extractor::extract_call_names_from_body 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.
  • codelet_graph::ast_dispatch::dispatch_ast_search (cyclomatic 24) rust/graph/src/ast_dispatch.rs:185 — codelet_graph::ast_dispatch::dispatch_ast_search 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.
  • codelet_graph::ast_pipeline::ast_c_extractor::extract_types (cyclomatic 23) rust/graph/src/ast_pipeline/ast_c_extractor.rs:180 — codelet_graph::ast_pipeline::ast_c_extractor::extract_types 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.
  • codelet_graph::ast_pipeline::complexity::strip_hash_style (cyclomatic 20) rust/graph/src/ast_pipeline/complexity.rs:230 — codelet_graph::ast_pipeline::complexity::strip_hash_style 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.
  • codelet_graph::ast_pipeline::ast_dart_extractor::extract_constructor_invocations_from_body (cyclomatic 18) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:862 — codelet_graph::ast_pipeline::ast_dart_extractor::extract_constructor_invocations_from_body 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.
  • codelet_graph::ast_pipeline::ast_java_extractor::extract_java_type_annotations (cyclomatic 18) rust/graph/src/ast_pipeline/ast_java_extractor.rs:418 — codelet_graph::ast_pipeline::ast_java_extractor::extract_java_type_annotations 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.
  • codelet_graph::ast_pipeline::complexity::strip_c_style (cyclomatic 18) rust/graph/src/ast_pipeline/complexity.rs:185 — codelet_graph::ast_pipeline::complexity::strip_c_style 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.
  • codelet_graph::ast_pipeline::pubspec_dep_extractor::parse_pubspec_dependencies (cyclomatic 18) rust/graph/src/ast_pipeline/pubspec_dep_extractor.rs:55 — codelet_graph::ast_pipeline::pubspec_dep_extractor::parse_pubspec_dependencies 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.
  • codelet_graph::ast_pipeline::helpers::strip_comments (cyclomatic 17) rust/graph/src/ast_pipeline/helpers.rs:345 — codelet_graph::ast_pipeline::helpers::strip_comments 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.
  • codelet_graph::ast_pipeline::pip_dep_extractor::extract_python_dependencies (cyclomatic 17) rust/graph/src/ast_pipeline/pip_dep_extractor.rs:14 — codelet_graph::ast_pipeline::pip_dep_extractor::extract_python_dependencies 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.
  • codelet_graph::ast_pipeline::ast_dart_extractor::extract_dart_function_name (cyclomatic 16) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:210 — codelet_graph::ast_pipeline::ast_dart_extractor::extract_dart_function_name 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.
  • codelet_graph::ast_pipeline::variables::extract_variables (cyclomatic 16) rust/graph/src/ast_pipeline/variables.rs:355 — codelet_graph::ast_pipeline::variables::extract_variables 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×15
  • Duplicated block (7 lines × 3) rust/core/src/lifecycle_hooks/engine.rs:41 — rust/core/src/lifecycle_hooks/engine.rs:41-47 | rust/core/src/lifecycle_hooks/engine.rs:133-139 | rust/core/src/lifecycle_hooks/tool_engine.rs:103-109 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) rust/core/src/persistence/messages.rs:268 — rust/core/src/persistence/messages.rs:268-274 | rust/core/src/persistence/messages.rs:356-362 | rust/core/src/persistence/messages.rs:430-436 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) rust/fspec-core/src/commands/remove_question.rs:185 — rust/fspec-core/src/commands/remove_question.rs:185-191 | rust/fspec-core/src/commands/restore_architecture_note.rs:120-127 | rust/fspec-core/src/commands/restore_question.rs:133-140 — before extracting anything, compare `rust/fspec-core/src/commands/remove_question.rs` and `rust/fspec-core/src/commands/restore_architecture_note.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rust/fspec/src/add_aggregate.rs:69 — rust/fspec/src/add_aggregate.rs:69-75 | rust/fspec/src/add_command.rs:56-62 | rust/fspec/src/add_policy.rs:63-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) rust/fspec/src/add_capability.rs:48 — rust/fspec/src/add_capability.rs:48-54 | rust/fspec/src/add_persona.rs:50-56 | rust/fspec/src/remove_persona.rs:46-52 — before extracting anything, compare `rust/fspec/src/add_capability.rs` and `rust/fspec/src/add_persona.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rust/agent-loop/src/schedule_handler.rs:113 — rust/agent-loop/src/schedule_handler.rs:113-119 | rust/core/src/scheduler/crud.rs:80-86 | rust/napi/src/schedule_handler.rs:113-119 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rust/fspec-core/src/commands/query_estimate_accuracy.rs:95 — rust/fspec-core/src/commands/query_estimate_accuracy.rs:95-101 | rust/fspec-core/src/commands/query_example_mapping_stats.rs:103-109 | rust/fspec-core/src/commands/show_epic.rs:91-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) rust/core/src/persistence/blob.rs:202 — rust/core/src/persistence/blob.rs:202-208 | rust/core/src/persistence/manifest.rs:505-511 | rust/core/src/persistence/manifest.rs:513-519 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) rust/fspec-core/src/commands/add_question.rs:122 — rust/fspec-core/src/commands/add_question.rs:122-133 | rust/fspec-core/src/commands/add_rule.rs:110-120 | rust/fspec-core/src/commands/answer_question.rs:208-214 — before extracting anything, compare `rust/fspec-core/src/commands/add_question.rs` and `rust/fspec-core/src/commands/add_rule.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rust/agent-loop/src/deep_search_handler.rs:631 — rust/agent-loop/src/deep_search_handler.rs:631-640 | rust/agent-loop/src/generate_compaction_handler.rs:342-348 | rust/napi/src/deep_search_handler.rs:619-628 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/agent-loop/src/generate_compaction_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rust/agent-loop/src/deep_search_handler.rs:613 — rust/agent-loop/src/deep_search_handler.rs:613-622 | rust/agent-loop/src/generate_compaction_handler.rs:333-339 | rust/napi/src/deep_search_handler.rs:601-610 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/agent-loop/src/generate_compaction_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) rust/fspec/src/add_tag_to_scenario.rs:58 — rust/fspec/src/add_tag_to_scenario.rs:58-64 | rust/fspec/src/remove_tag_from_scenario.rs:54-60 | rust/fspec/src/unlink_coverage.rs:49-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) rust/graph/src/ast_pipeline/csproj_dep_extractor.rs:35 — rust/graph/src/ast_pipeline/csproj_dep_extractor.rs:35-43 | rust/graph/src/ast_pipeline/java_dep_extractor.rs:22-28 | rust/graph/src/ast_pipeline/pip_dep_extractor.rs:24-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) rust/tools/src/bridge_relay.rs:1052 — rust/tools/src/bridge_relay.rs:1052-1058 | rust/tools/src/bridge_relay.rs:1081-1088 | rust/tools/src/bridge_relay.rs:1122-1129 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) rust/fspec-core/src/commands/remove_question.rs:142 — rust/fspec-core/src/commands/remove_question.rs:142-148 | rust/fspec-core/src/commands/restore_architecture_note.rs:81-87 | rust/fspec-core/src/commands/restore_question.rs:97-103 — before extracting anything, compare `rust/fspec-core/src/commands/remove_question.rs` and `rust/fspec-core/src/commands/restore_architecture_note.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 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.
D2 · Cognitive Complexity · codelet_napi · ×14
  • codelet_napi::agent_loop::agent_loop (cognitive 237) rust/napi/src/agent_loop.rs:180 — codelet_napi::agent_loop::agent_loop has cognitive complexity 237 (threshold 15). Drivers by points: if/else 51 (154 pts), match/switch 15 (54 pts), loops 6 (23 pts), boolean chains 6 (nesting depth added 159). 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.
  • codelet_napi::session_bindings::session_restore_messages (cognitive 156) rust/napi/src/session_bindings.rs:2734 — codelet_napi::session_bindings::session_restore_messages has cognitive complexity 156 (threshold 15). Drivers by points: if/else 21 (124 pts), loops 5 (15 pts), match/switch 2 (14 pts), boolean chains 3 (nesting depth added 125). 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.
  • codelet_napi::agent_manager_handler::handle_await_idle (cognitive 75) rust/napi/src/agent_manager_handler.rs:898 — codelet_napi::agent_manager_handler::handle_await_idle has cognitive complexity 75 (threshold 15). Drivers by points: if/else 13 (43 pts), match/switch 7 (19 pts), loops 6 (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.
  • codelet_napi::session_search_handler::handle_search (cognitive 48) rust/napi/src/session_search_handler.rs:142 — codelet_napi::session_search_handler::handle_search has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_napi::graph_search_handler::dispatch_action (cognitive 35) rust/napi/src/graph_search_handler.rs:44 — codelet_napi::graph_search_handler::dispatch_action has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 18 (35 pts) (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.
  • codelet_napi::session_search_handler::handle_show (cognitive 33) rust/napi/src/session_search_handler.rs:311 — codelet_napi::session_search_handler::handle_show has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_napi::astgrep::topological_sort (cognitive 23) rust/napi/src/astgrep.rs:723 — codelet_napi::astgrep::topological_sort has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_napi::astgrep::ast_grep_replace (cognitive 22) rust/napi/src/astgrep.rs:417 — codelet_napi::astgrep::ast_grep_replace has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (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.
  • codelet_napi::astgrep::split_into_words (cognitive 20) rust/napi/src/astgrep.rs:907 — codelet_napi::astgrep::split_into_words has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_napi::astgrep::ast_grep_search (cognitive 19) rust/napi/src/astgrep.rs:163 — codelet_napi::astgrep::ast_grep_search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 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.
  • codelet_napi::session_bindings::session_set_model_profile (cognitive 17) rust/napi/src/session_bindings.rs:2114 — codelet_napi::session_bindings::session_set_model_profile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
  • codelet_napi::session_bindings::session_execute_bash (cognitive 17) rust/napi/src/session_bindings.rs:3810 — codelet_napi::session_bindings::session_execute_bash has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (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.
  • codelet_napi::astgrep::validate_transforms (cognitive 16) rust/napi/src/astgrep.rs:625 — codelet_napi::astgrep::validate_transforms has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_napi::session_bindings::session_set_global_chunk_callback (cognitive 16) rust/napi/src/session_bindings.rs:1409 — codelet_napi::session_bindings::session_set_global_chunk_callback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 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.
D3 · God Classes · TooManyMethods · ×14
  • TooManyMethods: App rust/fspec-tui/src/app/state/state_types.rs:29 — TooManyMethods — 330 methods, declared across 71 files: state/state_accessors.rs (24), app/dispatch_scroll.rs (19), state/state_views.rs (13), app/dispatch_provider_settings.rs (11), +67 more file(s). The bar is 30 methods; this is 300 over it, 11.00× 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: AgentViewStore rust/fspec-tui/src/store/agent_view.rs:54 — TooManyMethods — 94 methods, declared across 13 files: store/agent_view.rs (26), agent_view/chrome_state.rs (23), agent_view/isolation_state.rs (9), agent_view/history_accessors.rs (5), +9 more file(s). The bar is 30 methods; this is 64 over it, 3.13× 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: BackgroundSession rust/sessions/src/background_session.rs:270 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MultiplexLayout rust/fspec-tui/src/views/multiplex/types.rs:56 — TooManyMethods — 72 methods, declared across 7 files: multiplex/menu_state.rs (21), multiplex/window.rs (19), multiplex/types.rs (16), multiplex/mod.rs (12), +3 more file(s). The bar is 30 methods; this is 42 over it, 2.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: AgentView rust/fspec-tui/src/views/agent.rs:116 — TooManyMethods — 68 methods, declared across 19 files: views/agent.rs (12), agent/turn_modal_select.rs (7), agent/dispatch.rs (6), agent/menu_keys.rs (6), +15 more file(s). The bar is 30 methods; this is 38 over it, 2.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CheckpointsView rust/fspec-tui/src/views/checkpoints/mod.rs:71 — TooManyMethods — 58 methods, declared across 6 files: checkpoints/mod.rs (31), checkpoints/delete.rs (10), checkpoints/navigation.rs (7), checkpoints/restore.rs (5), +2 more file(s). The bar is 30 methods; this is 28 over it, 1.93× 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: StubSessionManagerHandle rust/core/src/session_manager_handle.rs:1025 — 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: ScrollbackList rust/fspec-tui/src/views/agent/scrollback.rs:43 — TooManyMethods — 55 methods, declared across 5 files: agent/scrollback.rs (22), agent/scrollback_select.rs (15), agent/scrollback_copy.rs (11), agent/scrollback_trim.rs (4), +1 more file(s). The bar is 30 methods; this is 25 over it, 1.83× 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: BoardStore rust/fspec-tui/src/store/board.rs:42 — TooManyMethods — 44 methods, declared across 3 files: store/board.rs (20), store/board_menu.rs (14), store/board_viewport.rs (10). The bar is 30 methods; this is 14 over it, 1.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SessionManager rust/sessions/src/session_manager.rs:148 — 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: ModelSelectorView rust/fspec-tui/src/views/model_selector/mod.rs:65 — TooManyMethods — 38 methods, declared across 5 files: model_selector/state.rs (21), model_selector/crud.rs (8), model_selector/navigation.rs (6), model_selector/dispatch.rs (2), +1 more file(s). The bar is 30 methods; this is 8 over it, 1.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProviderManager rust/providers/src/manager.rs:196 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.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.
  • TooManyMethods: MultiLineInput rust/fspec-tui/src/views/agent/multiline_input.rs:54 — TooManyMethods — 35 methods, declared across 4 files: agent/multiline_input.rs (19), agent/multiline_input_select.rs (8), agent/multiline_input_render.rs (7), agent/multiline_input_key.rs (1). The bar is 30 methods; this is 5 over it, 1.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProviderSettingsView rust/fspec-tui/src/views/provider_settings/mod.rs:70 — TooManyMethods — 33 methods, declared across 4 files: provider_settings/mod.rs (17), provider_settings/nav_tree_ops.rs (13), provider_settings/test_result.rs (2), provider_settings/mouse.rs (1). The bar is 30 methods; this is 3 over it, 1.10× 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×14
  • Duplicated block (6 lines × 3) rust/agent-loop/src/schedule_handler.rs:98 — rust/agent-loop/src/schedule_handler.rs:98-106 | rust/core/src/scheduler/crud.rs:69-74 | rust/napi/src/schedule_handler.rs:98-106 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/fspec-core/src/commands/add_bounded_context.rs:139 — rust/fspec-core/src/commands/add_bounded_context.rs:139-145 | rust/fspec-core/src/commands/add_external_system.rs:140-146 | rust/fspec-core/src/commands/show_work_unit.rs:90-95 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/fspec-core/src/commands/link_coverage.rs:628 — rust/fspec-core/src/commands/link_coverage.rs:628-633 | rust/fspec-core/src/commands/unlink_coverage.rs:333-338 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:102-107 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/fspec-core/src/generators/tags_md.rs:144 — rust/fspec-core/src/generators/tags_md.rs:144-149 | rust/fspec-core/src/generators/tags_md.rs:169-174 | rust/fspec-core/src/generators/tags_md.rs:194-199 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) rust/fspec/src/add_domain_event.rs:55 — rust/fspec/src/add_domain_event.rs:55-61 | rust/fspec/src/add_hotspot.rs:55-60 | rust/fspec/src/add_policy.rs:50-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) rust/fspec/src/create_bug.rs:51 — rust/fspec/src/create_bug.rs:51-56 | rust/fspec/src/create_story.rs:50-56 | rust/fspec/src/create_task.rs:51-56 — before extracting anything, compare `rust/fspec/src/create_bug.rs` and `rust/fspec/src/create_story.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/git/src/session_result.rs:57 — rust/git/src/session_result.rs:57-62 | rust/git/src/session_result.rs:120-125 | rust/git/src/worktree.rs:137-142 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (6 lines × 3) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:809 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:809-814 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:438-443 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:454-459 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/napi/src/astgrep.rs:178 — rust/napi/src/astgrep.rs:178-183 | rust/napi/src/astgrep.rs:300-305 | rust/napi/src/astgrep.rs:434-439 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) rust/agent-loop/src/deep_search_handler.rs:594 — rust/agent-loop/src/deep_search_handler.rs:594-603 | rust/agent-loop/src/generate_compaction_handler.rs:324-329 | rust/napi/src/deep_search_handler.rs:582-591 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/agent-loop/src/generate_compaction_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) rust/fspec/src/add_command.rs:69 — rust/fspec/src/add_command.rs:69-74 | rust/fspec/src/add_policy.rs:75-83 | rust/fspec/src/repair_work_units.rs:62-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) rust/fspec-core/src/generators/tags_md.rs:150 — rust/fspec-core/src/generators/tags_md.rs:150-155 | rust/fspec-core/src/generators/tags_md.rs:175-180 | rust/fspec-core/src/generators/tags_md.rs:200-205 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) rust/fspec-core/src/generators/foundation_md_diagrams.rs:88 — rust/fspec-core/src/generators/foundation_md_diagrams.rs:88-93 | rust/fspec-core/src/generators/foundation_md_diagrams.rs:100-105 | rust/fspec-core/src/generators/foundation_md_diagrams.rs:112-117 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) rust/fspec/src/show_acceptance_criteria.rs:38 — rust/fspec/src/show_acceptance_criteria.rs:38-43 | rust/fspec/src/show_coverage.rs:33-38 | rust/fspec/src/show_feature.rs:34-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
D17 · Explicit Debt · TodoComment · ×12
  • TodoComment rust/agent-loop/src/agent_loop.rs:236 — // TODO(MCP-001 V2): To support sampling properly:
  • TodoComment rust/napi/src/agent_loop.rs:329 — // TODO(MCP-001 V2): To support sampling properly:
  • TodoComment rust/benches/token_tracking.rs:13 — // TODO: Implement when token tracker is complete — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust/benches/token_tracking.rs:33 — // TODO: Implement when function is available — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust/fspec-core/src/virtual_hooks_exec.rs:65 — // todo: gitContext support (run only on changed files via codelet_git) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust/fspec-core/src/dispatch.rs:143 — // TODO(TOOL-019): NAPI chunk-callback delegation path will be wired in
  • TodoComment rust/fspec-core/src/commands/configure_tools.rs:52 — /// TODO(parity-bug RPC-208-D4): the TS reconfigure branch calls
  • TodoComment rust/fspec-core/tests/configure_tools.rs:14 — // is asserted at the CLI surface alongside the // TODO(parity-bug ...) marker). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust/napi/src/bridges.rs:914 — // TODO: After BRIDGE-012 implementation, this test should verify
  • TodoComment rust/providers/tests/openai_local_provider_test.rs:421 — // TODO: Add real connection test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust/providers/tests/openai_local_provider_test.rs:433 — // TODO: Add real connection test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust/tools/src/mcp.rs:671 — // TODO: Custom headers support requires building with_client + custom reqwest::Client. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×12
  • Duplicated block (17 lines × 2) rust/agent-loop/src/agent_loop.rs:1582 — rust/agent-loop/src/agent_loop.rs:1582-1598 | rust/napi/src/agent_loop.rs:1443-1459 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec-core/src/commands/add_aggregate.rs:194 — rust/fspec-core/src/commands/add_aggregate.rs:194-210 | rust/fspec-core/src/commands/add_command.rs:182-198 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:211 — rust/fspec-core/src/commands/add_dependencies.rs:211-227 | rust/fspec-core/src/commands/add_dependency.rs:170-186 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec-core/src/commands/add_persona.rs:94 — rust/fspec-core/src/commands/add_persona.rs:94-110 | rust/fspec-core/src/commands/remove_persona.rs:53-69 — before extracting anything, compare `rust/fspec-core/src/commands/add_persona.rs` and `rust/fspec-core/src/commands/remove_persona.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec-core/src/commands/link_coverage.rs:604 — rust/fspec-core/src/commands/link_coverage.rs:604-620 | rust/fspec-core/src/commands/unlink_coverage.rs:302-318 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec-core/src/commands/query_metrics.rs:357 — rust/fspec-core/src/commands/query_metrics.rs:357-373 | rust/fspec-core/src/commands/query_work_units.rs:309-325 — before extracting anything, compare `rust/fspec-core/src/commands/query_metrics.rs` and `rust/fspec-core/src/commands/query_work_units.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec/src/add_foundation_bounded_context.rs:46 — rust/fspec/src/add_foundation_bounded_context.rs:46-62 | rust/fspec/src/remove_foundation_bounded_context.rs:41-57 — before extracting anything, compare `rust/fspec/src/add_foundation_bounded_context.rs` and `rust/fspec/src/remove_foundation_bounded_context.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/fspec/src/add_scenario.rs:62 — rust/fspec/src/add_scenario.rs:62-78 | rust/fspec/src/add_step.rs:63-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (17 lines × 2) rust/graph/src/ast_pipeline/variables.rs:301 — rust/graph/src/ast_pipeline/variables.rs:301-317 | rust/graph/src/ast_pipeline/variables.rs:326-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) rust/tools/src/astgrep.rs:177 — rust/tools/src/astgrep.rs:177-193 | rust/tools/src/astgrep_refactor.rs:146-162 — before extracting anything, compare `rust/tools/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/agent-loop/src/deep_search_handler.rs:88 — rust/agent-loop/src/deep_search_handler.rs:88-104 | rust/napi/src/deep_search_handler.rs:88-104 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) rust/tools/src/facade/zai.rs:294 — rust/tools/src/facade/zai.rs:294-310 | rust/tools/src/facade/zai.rs:344-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · codelet_fspec_tui · ×11
  • codelet_fspec_tui::views::board::menu_keys::handle_menu_keys (cyclomatic 40) rust/fspec-tui/src/views/board/menu_keys.rs:41 — codelet_fspec_tui::views::board::menu_keys::handle_menu_keys 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.
  • codelet_fspec_tui::views::multiplex::menu_mouse::classify_bar_mouse (cyclomatic 33) rust/fspec-tui/src/views/multiplex/menu_mouse.rs:81 — codelet_fspec_tui::views::multiplex::menu_mouse::classify_bar_mouse 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.
  • codelet_fspec_tui::views::multiplex::menu_keys::classify_bar_key (cyclomatic 32) rust/fspec-tui/src/views/multiplex/menu_keys.rs:120 — codelet_fspec_tui::views::multiplex::menu_keys::classify_bar_key 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.
  • codelet_fspec_tui::app::slash_parser::parse_slash_command (cyclomatic 28) rust/fspec-tui/src/app/slash_parser.rs:109 — codelet_fspec_tui::app::slash_parser::parse_slash_command 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.
  • codelet_fspec_tui::views::board::menu_mouse::handle_menu_mouse (cyclomatic 27) rust/fspec-tui/src/views/board/menu_mouse.rs:65 — codelet_fspec_tui::views::board::menu_mouse::handle_menu_mouse 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.
  • codelet_fspec_tui::views::provider_settings::list::handle_list_key (cyclomatic 24) rust/fspec-tui/src/views/provider_settings/list.rs:27 — codelet_fspec_tui::views::provider_settings::list::handle_list_key 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.
  • codelet_fspec_tui::components::dialog_theme::render_dialog_at (cyclomatic 23) rust/fspec-tui/src/components/dialog_theme.rs:159 — codelet_fspec_tui::components::dialog_theme::render_dialog_at 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.
  • codelet_fspec_tui::components::menu_bar::paint::paint_menu_bar (cyclomatic 17) rust/fspec-tui/src/components/menu_bar/paint.rs:34 — codelet_fspec_tui::components::menu_bar::paint::paint_menu_bar 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.
  • codelet_fspec_tui::transport::websocket::run_supervisor (cyclomatic 17) rust/fspec-tui/src/transport/websocket.rs:1549 — codelet_fspec_tui::transport::websocket::run_supervisor 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.
  • codelet_fspec_tui::views::agent::header_build::build_left_line (cyclomatic 16) rust/fspec-tui/src/views/agent/header_build.rs:15 — codelet_fspec_tui::views::agent::header_build::build_left_line 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.
  • codelet_fspec_tui::views::board::mouse::handle_mouse (cyclomatic 16) rust/fspec-tui/src/views/board/mouse.rs:47 — codelet_fspec_tui::views::board::mouse::handle_mouse 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 · codelet_cli · ×11
  • codelet_cli::interactive::stream_loop::run_agent_stream_internal (cognitive 412) rust/cli/src/interactive/stream_loop.rs:232 — codelet_cli::interactive::stream_loop::run_agent_stream_internal has cognitive complexity 412 (threshold 15). Drivers by points: if/else 109 (363 pts), match/switch 11 (36 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 282). 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.
  • codelet_cli::interactive::recovery_image::sanitize_image_content (cognitive 81) rust/cli/src/interactive/recovery_image.rs:17 — codelet_cli::interactive::recovery_image::sanitize_image_content has cognitive complexity 81 (threshold 15). Drivers by points: if/else 11 (44 pts), loops 5 (20 pts), match/switch 3 (17 pts) (nesting depth added 62). 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.
  • codelet_cli::interactive_helpers::reconcile_session_messages (cognitive 50) rust/cli/src/interactive_helpers.rs:382 — codelet_cli::interactive_helpers::reconcile_session_messages has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 6 (18 pts), loops 4 (8 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.
  • codelet_cli::interactive::gemini_continuation::run_continuation_loop (cognitive 48) rust/cli/src/interactive/gemini_continuation.rs:202 — codelet_cli::interactive::gemini_continuation::run_continuation_loop has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (44 pts), match/switch 1 (2 pts), boolean chains 1, loops 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.
  • codelet_cli::interactive::recovery_compaction::execute_compaction_and_capture_events (cognitive 29) rust/cli/src/interactive/recovery_compaction.rs:461 — codelet_cli::interactive::recovery_compaction::execute_compaction_and_capture_events has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_cli::interactive_helpers::inject_synthetic_tool_results_for_orphans (cognitive 29) rust/cli/src/interactive_helpers.rs:517 — codelet_cli::interactive_helpers::inject_synthetic_tool_results_for_orphans has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 5 (9 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.
  • codelet_cli::compaction_dag::extract_partial_dag_nodes (cognitive 23) rust/cli/src/compaction_dag.rs:186 — codelet_cli::compaction_dag::extract_partial_dag_nodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 pts), match/switch 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.
  • codelet_cli::interactive::recovery_unrecoverable::strip_failed_tool_call_tail (cognitive 23) rust/cli/src/interactive/recovery_unrecoverable.rs:55 — codelet_cli::interactive::recovery_unrecoverable::strip_failed_tool_call_tail has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_cli::interactive::stream_handlers::handle_tool_result (cognitive 19) rust/cli/src/interactive/stream_handlers.rs:157 — codelet_cli::interactive::stream_handlers::handle_tool_result has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_cli::interactive_helpers::validate_no_orphan_tool_calls (cognitive 19) rust/cli/src/interactive_helpers.rs:326 — codelet_cli::interactive_helpers::validate_no_orphan_tool_calls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_cli::session::context_gathering::discover_agents_md (cognitive 18) rust/cli/src/session/context_gathering.rs:115 — codelet_cli::session::context_gathering::discover_agents_md has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 2 (6 pts), 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×11
  • Duplicated block (16 lines × 2) rust/fspec-core/src/commands/add_persona.rs:119 — rust/fspec-core/src/commands/add_persona.rs:119-134 | rust/fspec-core/src/commands/remove_persona.rs:78-93 — before extracting anything, compare `rust/fspec-core/src/commands/add_persona.rs` and `rust/fspec-core/src/commands/remove_persona.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:448 — rust/fspec-core/src/commands/link_coverage/step.rs:448-463 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:671-686 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) rust/fspec-core/src/commands/list_feature_tags.rs:291 — rust/fspec-core/src/commands/list_feature_tags.rs:291-306 | rust/fspec-core/src/commands/list_scenario_tags.rs:252-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) rust/fspec-core/src/commands/remove_command_from_foundation.rs:135 — rust/fspec-core/src/commands/remove_command_from_foundation.rs:135-150 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:138-153 — before extracting anything, compare `rust/fspec-core/src/commands/remove_command_from_foundation.rs` and `rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) rust/fspec-tui/src/components/dialog_button_hits.rs:181 — rust/fspec-tui/src/components/dialog_button_hits.rs:181-196 | rust/fspec-tui/src/components/dialog_button_hits.rs:210-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) rust/fspec-tui/src/components/mux_config_dialog.rs:288 — rust/fspec-tui/src/components/mux_config_dialog.rs:288-303 | rust/fspec-tui/src/components/thinking_level_dialog.rs:202-217 — before extracting anything, compare `rust/fspec-tui/src/components/mux_config_dialog.rs` and `rust/fspec-tui/src/components/thinking_level_dialog.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) rust/graph/src/ast_pipeline/ast_c_extractor.rs:204 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:204-219 | rust/graph/src/ast_pipeline/ast_c_extractor.rs:236-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.
  • Duplicated block (16 lines × 2) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:151 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:151-166 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:161-176 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) rust/providers/src/codex/codex_auth.rs:181 — rust/providers/src/codex/codex_auth.rs:181-196 | rust/providers/src/codex/codex_auth.rs:204-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) rust/tools/src/facade/fspec_facade.rs:122 — rust/tools/src/facade/fspec_facade.rs:122-137 | rust/tools/src/facade/fspec_facade.rs:269-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) rust/fspec/src/delete_features.rs:92 — rust/fspec/src/delete_features.rs:92-107 | rust/fspec/src/retag.rs:90-105 — before extracting anything, compare `rust/fspec/src/delete_features.rs` and `rust/fspec/src/retag.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×11
  • Duplicated block (5 lines × 3) rust/fspec-core/src/commands/add_aggregate.rs:157 — rust/fspec-core/src/commands/add_aggregate.rs:157-161 | rust/fspec-core/src/commands/add_command.rs:151-155 | rust/fspec-core/src/commands/add_domain_event.rs:195-200 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/fspec-core/src/commands/add_assumption.rs:78 — rust/fspec-core/src/commands/add_assumption.rs:78-82 | rust/fspec-core/src/commands/add_question.rs:142-146 | rust/fspec-core/src/commands/add_rule.rs:129-133 — before extracting anything, compare `rust/fspec-core/src/commands/add_question.rs` and `rust/fspec-core/src/commands/add_rule.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/fspec-core/src/commands/add_bounded_context.rs:89 — rust/fspec-core/src/commands/add_bounded_context.rs:89-93 | rust/fspec-core/src/commands/add_external_system.rs:90-94 | rust/fspec-core/src/commands/add_policy.rs:201-205 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/fspec-core/src/commands/link_coverage.rs:622 — rust/fspec-core/src/commands/link_coverage.rs:622-626 | rust/fspec-core/src/commands/show_coverage.rs:269-275 | rust/fspec-core/src/commands/unlink_coverage.rs:320-324 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/fspec-core/src/commands/list_attachments.rs:207 — rust/fspec-core/src/commands/list_attachments.rs:207-211 | rust/fspec-core/src/io/ensure.rs:346-350 | rust/fspec-core/src/io/time.rs:75-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:132 — rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:132-136 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:97-101 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:100-104 — before extracting anything, compare `rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs` and `rust/fspec-core/src/commands/remove_command_from_foundation.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:738 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:738-742 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:530-534 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:545-549 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/napi/src/astgrep.rs:777 — rust/napi/src/astgrep.rs:777-781 | rust/napi/src/astgrep.rs:805-809 | rust/napi/src/astgrep.rs:817-821 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) rust/agent-loop/src/schedule_handler.rs:122 — rust/agent-loop/src/schedule_handler.rs:122-126 | rust/core/src/scheduler/crud.rs:88-92 | rust/napi/src/schedule_handler.rs:122-126 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:147 — rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:147-151 | rust/fspec-tui/src/components/create_session_dialog.rs:169-173 | rust/fspec-tui/src/components/exit_confirmation_dialog.rs:154-158 — before extracting anything, compare `rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs` and `rust/fspec-tui/src/components/create_session_dialog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) rust/fspec/src/add_bounded_context.rs:66 — rust/fspec/src/add_bounded_context.rs:66-70 | rust/fspec/src/add_external_system.rs:67-71 | rust/fspec/src/answer_question.rs:45-49 — before extracting anything, compare `rust/fspec/src/add_bounded_context.rs` and `rust/fspec/src/add_external_system.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D2 · Cognitive Complexity · codelet_git · ×10
  • codelet_git::repo_ops::build_tree_from_index (cognitive 38) rust/git/src/repo_ops.rs:232 — codelet_git::repo_ops::build_tree_from_index has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 6 (10 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_git::ghost_commit::restore_ghost_commit (cognitive 35) rust/git/src/ghost_commit.rs:493 — codelet_git::ghost_commit::restore_ghost_commit has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 4 (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.
  • codelet_git::tree_utils::collect_worktree_files (cognitive 35) rust/git/src/tree_utils.rs:49 — codelet_git::tree_utils::collect_worktree_files has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (7 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.
  • codelet_git::session_result::apply_session_changes (cognitive 23) rust/git/src/session_result.rs:116 — codelet_git::session_result::apply_session_changes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_git::repo_ops::git_set_config (cognitive 21) rust/git/src/repo_ops.rs:64 — codelet_git::repo_ops::git_set_config has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, 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.
  • codelet_git::session_diff::apply_snapshot_to_main (cognitive 20) rust/git/src/session_diff.rs:125 — codelet_git::session_diff::apply_snapshot_to_main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 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.
  • codelet_git::ghost_commit::build_tree_from_snapshot (cognitive 19) rust/git/src/ghost_commit.rs:224 — codelet_git::ghost_commit::build_tree_from_snapshot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 6 (8 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.
  • codelet_git::session_diff::detect_conflicts (cognitive 18) rust/git/src/session_diff.rs:195 — codelet_git::session_diff::detect_conflicts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_git::merge_commit::resolve_identity (cognitive 17) rust/git/src/merge_commit.rs:104 — codelet_git::merge_commit::resolve_identity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_git::session_diff::compute_session_diff (cognitive 16) rust/git/src/session_diff.rs:30 — codelet_git::session_diff::compute_session_diff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codelet_providers · ×10
  • codelet_providers::copilot::classifier::detect_agent_mode (cognitive 37) rust/providers/src/copilot/classifier.rs:97 — codelet_providers::copilot::classifier::detect_agent_mode has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (36 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_providers::copilot::classifier::detect_vision_content (cognitive 31) rust/providers/src/copilot/classifier.rs:52 — codelet_providers::copilot::classifier::detect_vision_content has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (8 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • codelet_providers::custom::rig_message_convert::convert_user_message (cognitive 24) rust/providers/src/custom/rig_message_convert.rs:44 — codelet_providers::custom::rig_message_convert::convert_user_message has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (8 pts), loops 2 (4 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.
  • codelet_providers::codex::codex_oauth_server::handle_request (cognitive 20) rust/providers/src/codex/codex_oauth_server.rs:245 — codelet_providers::codex::codex_oauth_server::handle_request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • codelet_providers::custom::management::apply_custom_provider_env_vars (cognitive 20) rust/providers/src/custom/management.rs:383 — codelet_providers::custom::management::apply_custom_provider_env_vars has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (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.
  • codelet_providers::custom::stream_http::open_stream (cognitive 20) rust/providers/src/custom/stream_http.rs:27 — codelet_providers::custom::stream_http::open_stream has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (6 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • codelet_providers::copilot::oauth_polling::poll_device_token (cognitive 19) rust/providers/src/copilot/oauth_polling.rs:38 — codelet_providers::copilot::oauth_polling::poll_device_token has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 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.
  • codelet_providers::caching_client::transform_user_message_cache_control (cognitive 18) rust/providers/src/caching_client.rs:99 — codelet_providers::caching_client::transform_user_message_cache_control has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 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.
  • codelet_providers::custom::management::list_providers_info (cognitive 17) rust/providers/src/custom/management.rs:114 — codelet_providers::custom::management::list_providers_info has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 4 (6 pts), boolean chains 2, 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.
  • codelet_providers::custom::stream_convert::handle_tool_call (cognitive 16) rust/providers/src/custom/stream_convert.rs:146 — codelet_providers::custom::stream_convert::handle_tool_call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 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.
D3 · God Classes · ClassTooLong · ×10
  • ClassTooLong: Mode rust/fspec/src/main.rs:246 — ClassTooLong — 1459 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods. The bar is 400 significant lines; this is 1059 over it, 3.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: WebSocketFspecBackend rust/fspec-tui/src/transport/websocket.rs:56 — ClassTooLong — 1022 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 56-1529. The bar is 400 significant lines; this is 622 over it, 2.56× 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: StubSessionManagerHandle rust/core/src/session_manager_handle.rs:1025 — ClassTooLong — 931 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, 4 blocks, lines 1025-2627. The bar is 400 significant lines; this is 531 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FspecServiceImpl rust/rpc/src/lib.rs:1122 — 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), 1 methods, 3 blocks, lines 1122-2404. 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: SessionManager rust/sessions/src/session_manager.rs:148 — ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 44 methods, 3 blocks, lines 148-1482. The bar is 400 significant lines; this is 340 over it, 1.85× 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: EmbeddedFspecBackend rust/fspec-tui/src/transport/embedded.rs:41 — ClassTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 41-1132. The bar is 400 significant lines; this is 327 over it, 1.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: BackgroundSession rust/sessions/src/background_session.rs:270 — ClassTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 75 methods, 2 blocks, lines 270-1852. The bar is 400 significant lines; this is 275 over it, 1.69× 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: AstGrepRefactorTool rust/tools/src/astgrep_refactor.rs:117 — ClassTooLong — 629 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, 4 blocks, lines 117-1180. The bar is 400 significant lines; this is 229 over it, 1.57× 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: ProviderManager rust/providers/src/manager.rs:196 — ClassTooLong — 497 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, 3 blocks, lines 196-1269. The bar is 400 significant lines; this is 97 over it, 1.24× 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: FspecBackend rust/fspec-tui/src/transport/mod.rs:65 — ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 124 methods. The bar is 400 significant lines; this is 7 over it, 1.02× 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 × 3) · ×10
  • Duplicated block (11 lines × 3) rust/fspec-core/src/commands/add_aggregate.rs:91 — rust/fspec-core/src/commands/add_aggregate.rs:91-101 | rust/fspec-core/src/commands/add_command.rs:86-96 | rust/fspec-core/src/commands/add_domain_event.rs:91-101 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/fspec-core/src/commands/auto_advance.rs:108 — rust/fspec-core/src/commands/auto_advance.rs:108-118 | rust/fspec-core/src/commands/update_work_unit_status.rs:1303-1313 | rust/fspec-core/src/commands/workflow_automation.rs:93-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (11 lines × 3) rust/fspec-core/src/commands/generate_scenarios.rs:939 — rust/fspec-core/src/commands/generate_scenarios.rs:939-949 | rust/fspec-core/src/commands/link_coverage/step.rs:416-426 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:639-649 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/link_coverage/step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/fspec-core/src/io/gherkin_format.rs:287 — rust/fspec-core/src/io/gherkin_format.rs:287-297 | rust/fspec-core/src/io/gherkin_format.rs:310-320 | rust/fspec-core/src/io/gherkin_format.rs:484-494 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) rust/fspec-tui/src/views/changed_files/render.rs:128 — rust/fspec-tui/src/views/changed_files/render.rs:128-138 | rust/fspec-tui/src/views/checkpoints/render.rs:149-159 | rust/fspec-tui/src/views/checkpoints/render.rs:214-224 — `rust/fspec-tui/src/views/changed_files/render.rs` and `rust/fspec-tui/src/views/checkpoints/render.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 7 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (11 lines × 3) rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:426 — rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:426-436 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:442-452 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:533-543 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:142 — rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:142-160 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:107-117 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:110-120 — before extracting anything, compare `rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs` and `rust/fspec-core/src/commands/remove_command_from_foundation.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) rust/fspec-core/src/commands/query_dependency_stats.rs:132 — rust/fspec-core/src/commands/query_dependency_stats.rs:132-144 | rust/fspec-core/src/commands/query_estimation_guide.rs:86-96 | rust/fspec-core/src/commands/query_example_mapping_stats.rs:157-167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (11 lines × 3) rust/fspec-core/src/update/github.rs:48 — rust/fspec-core/src/update/github.rs:48-58 | rust/fspec-core/src/update/github.rs:142-152 | rust/fspec-core/src/update/verify.rs:57-67 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (11 lines × 3) rust/agent-loop/src/deep_search_handler.rs:557 — rust/agent-loop/src/deep_search_handler.rs:557-567 | rust/agent-loop/src/generate_compaction_handler.rs:297-307 | rust/napi/src/deep_search_handler.rs:545-555 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/agent-loop/src/generate_compaction_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×9
  • Duplicated block (26 lines × 2) rust/agent-loop/src/schedule_handler.rs:292 — rust/agent-loop/src/schedule_handler.rs:292-317 | rust/napi/src/schedule_handler.rs:292-317 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) rust/agent-loop/src/schedule_handler.rs:320 — rust/agent-loop/src/schedule_handler.rs:320-345 | rust/napi/src/schedule_handler.rs:320-345 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:95 — rust/fspec-core/src/commands/link_coverage/step.rs:95-120 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:313-338 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:289 — rust/fspec-core/src/commands/link_coverage/step.rs:289-314 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:510-535 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) rust/fspec-tui/src/components/notification_dialog.rs:328 — rust/fspec-tui/src/components/notification_dialog.rs:328-353 | rust/fspec-tui/src/components/status_dialog.rs:309-334 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (26 lines × 2) rust/fspec-tui/src/views/agent/hitl_prompt.rs:79 — rust/fspec-tui/src/views/agent/hitl_prompt.rs:79-104 | rust/fspec-tui/src/views/agent/pause_prompt.rs:102-127 — before extracting anything, compare `rust/fspec-tui/src/views/agent/hitl_prompt.rs` and `rust/fspec-tui/src/views/agent/pause_prompt.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 (26 lines × 2) rust/fspec-tui/src/views/agent/multiline_input_render.rs:133 — rust/fspec-tui/src/views/agent/multiline_input_render.rs:133-158 | rust/fspec-tui/src/views/agent/multiline_input_render.rs:190-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26 lines × 2) rust/napi/src/session_bindings.rs:2060 — rust/napi/src/session_bindings.rs:2060-2085 | rust/napi/src/session_bindings.rs:2250-2275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26 lines × 2) rust/providers/src/custom/conversion.rs:20 — rust/providers/src/custom/conversion.rs:20-45 | rust/providers/src/oauth/json_convert.rs:8-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×9
  • Duplicated block (18 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:334 — rust/agent-loop/src/agent_manager_handler.rs:334-351 | rust/napi/src/agent_manager_handler.rs:318-335 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) rust/agent-loop/src/session_search_handler.rs:559 — rust/agent-loop/src/session_search_handler.rs:559-576 | rust/napi/src/session_search_handler.rs:559-576 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) rust/fspec-core/src/commands/add_aggregate.rs:135 — rust/fspec-core/src/commands/add_aggregate.rs:135-152 | rust/fspec-core/src/commands/add_command.rs:129-146 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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 (18 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:145 — rust/fspec-core/src/commands/link_coverage/step.rs:145-162 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:363-380 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) rust/fspec-core/src/commands/show_work_unit.rs:748 — rust/fspec-core/src/commands/show_work_unit.rs:748-765 | rust/fspec-core/src/commands/update_work_unit_status/reminders.rs:48-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (18 lines × 2) rust/graph/src/ast_pipeline/complexity.rs:207 — rust/graph/src/ast_pipeline/complexity.rs:207-224 | rust/graph/src/ast_pipeline/complexity.rs:259-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) rust/providers/src/openai.rs:468 — rust/providers/src/openai.rs:468-485 | rust/providers/src/zai.rs:284-301 — before extracting anything, compare `rust/providers/src/openai.rs` and `rust/providers/src/zai.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) rust/fspec-core/src/commands/update_work_unit_status.rs:832 — rust/fspec-core/src/commands/update_work_unit_status.rs:832-849 | rust/fspec-core/src/commands/update_work_unit_status.rs:870-889 — both copies are in the same file, so extract the block into 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) rust/fspec-core/src/commands/delete_scenario.rs:68 — rust/fspec-core/src/commands/delete_scenario.rs:68-85 | rust/fspec-core/src/commands/delete_step.rs:68-85 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_step.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
D2 · Cognitive Complexity · codelet_core · ×8
  • codelet_core::persistence::blob_processing::rehydrate_envelope_blobs (cognitive 36) rust/core/src/persistence/blob_processing.rs:144 — codelet_core::persistence::blob_processing::rehydrate_envelope_blobs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (25 pts), match/switch 3 (7 pts), loops 2 (4 pts) (nesting depth added 25). 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.
  • codelet_core::persistence::blob_processing::process_envelope_for_blob_storage (cognitive 31) rust/core/src/persistence/blob_processing.rs:61 — codelet_core::persistence::blob_processing::process_envelope_for_blob_storage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 3 (7 pts), loops 2 (4 pts) (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • codelet_core::scheduler::engine::evaluate_and_run (cognitive 24) rust/core/src/scheduler/engine.rs:66 — codelet_core::scheduler::engine::evaluate_and_run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_core::lifecycle_hooks::engine::run_user_prompt (cognitive 23) rust/core/src/lifecycle_hooks/engine.rs:124 — codelet_core::lifecycle_hooks::engine::run_user_prompt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_core::lifecycle_hooks::response::interpret_pre_tool_result (cognitive 23) rust/core/src/lifecycle_hooks/response.rs:47 — codelet_core::lifecycle_hooks::response::interpret_pre_tool_result has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_core::scheduler::catch_up::run_catch_up (cognitive 23) rust/core/src/scheduler/catch_up.rs:21 — codelet_core::scheduler::catch_up::run_catch_up has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (5 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.
  • codelet_core::lifecycle_hooks::tool_engine::run_post_tool (cognitive 20) rust/core/src/lifecycle_hooks/tool_engine.rs:90 — codelet_core::lifecycle_hooks::tool_engine::run_post_tool has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), 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.
  • codelet_core::compaction::trimmer_base64::decode_base64_prefix (cognitive 19) rust/core/src/compaction/trimmer_base64.rs:74 — codelet_core::compaction::trimmer_base64::decode_base64_prefix has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D1 · Cyclomatic Complexity · codelet_napi · ×7
  • codelet_napi::agent_loop::agent_loop (cyclomatic 78) rust/napi/src/agent_loop.rs:180 — codelet_napi::agent_loop::agent_loop has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_napi::session_bindings::session_restore_messages (cyclomatic 34) rust/napi/src/session_bindings.rs:2734 — codelet_napi::session_bindings::session_restore_messages 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.
  • codelet_napi::graph_search_handler::dispatch_action (cyclomatic 33) rust/napi/src/graph_search_handler.rs:44 — codelet_napi::graph_search_handler::dispatch_action 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.
  • codelet_napi::agent_manager_handler::handle_await_idle (cyclomatic 31) rust/napi/src/agent_manager_handler.rs:898 — codelet_napi::agent_manager_handler::handle_await_idle 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.
  • codelet_napi::session_search_handler::handle_search (cyclomatic 23) rust/napi/src/session_search_handler.rs:142 — codelet_napi::session_search_handler::handle_search 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.
  • codelet_napi::session_search_handler::handle_show (cyclomatic 19) rust/napi/src/session_search_handler.rs:311 — codelet_napi::session_search_handler::handle_show 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.
  • codelet_napi::astgrep::ast_grep_replace (cyclomatic 17) rust/napi/src/astgrep.rs:417 — codelet_napi::astgrep::ast_grep_replace 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 · codelet_tools · ×7
  • codelet_tools::bridge_relay::handle_multiplexed_inbound (cyclomatic 31) rust/tools/src/bridge_relay.rs:418 — codelet_tools::bridge_relay::handle_multiplexed_inbound 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.
  • codelet_tools::bridge_relay::connect_and_relay (cyclomatic 30) rust/tools/src/bridge_relay.rs:903 — codelet_tools::bridge_relay::connect_and_relay 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.
  • codelet_tools::bash_binary_guard::detect_bash_binary_output (cyclomatic 20) rust/tools/src/bash_binary_guard.rs:52 — codelet_tools::bash_binary_guard::detect_bash_binary_output 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.
  • codelet_tools::rlcd::decision_validate::validate_questions (cyclomatic 19) rust/tools/src/rlcd/decision_validate.rs:22 — codelet_tools::rlcd::decision_validate::validate_questions 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.
  • codelet_tools::file_type::detect_by_magic_bytes (cyclomatic 18) rust/tools/src/file_type.rs:69 — codelet_tools::file_type::detect_by_magic_bytes 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.
  • codelet_tools::unified_exec::spawning::spawn_pty_process (cyclomatic 18) rust/tools/src/unified_exec/spawning.rs:341 — codelet_tools::unified_exec::spawning::spawn_pty_process 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.
  • codelet_tools::facade::wrapper::validate_and_resolve_path_with_isolation (cyclomatic 17) rust/tools/src/facade/wrapper.rs:842 — codelet_tools::facade::wrapper::validate_and_resolve_path_with_isolation 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 · codelet_agent_loop · ×7
  • codelet_agent_loop::agent_loop::agent_loop (cognitive 279) rust/agent-loop/src/agent_loop.rs:73 — codelet_agent_loop::agent_loop::agent_loop has cognitive complexity 279 (threshold 15). Drivers by points: if/else 63 (190 pts), match/switch 15 (54 pts), loops 7 (29 pts), boolean chains 6 (nesting depth added 188). 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.
  • codelet_agent_loop::agent_manager_handler::handle_await_idle (cognitive 76) rust/agent-loop/src/agent_manager_handler.rs:927 — codelet_agent_loop::agent_manager_handler::handle_await_idle has cognitive complexity 76 (threshold 15). Drivers by points: if/else 13 (43 pts), match/switch 8 (20 pts), loops 6 (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.
  • codelet_agent_loop::session_search_handler::handle_search (cognitive 48) rust/agent-loop/src/session_search_handler.rs:142 — codelet_agent_loop::session_search_handler::handle_search has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_agent_loop::generate_compaction_handler::build_and_run_compactor_agent (cognitive 41) rust/agent-loop/src/generate_compaction_handler.rs:177 — codelet_agent_loop::generate_compaction_handler::build_and_run_compactor_agent has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (40 pts), 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.
  • codelet_agent_loop::graph_search_handler::dispatch_action (cognitive 35) rust/agent-loop/src/graph_search_handler.rs:44 — codelet_agent_loop::graph_search_handler::dispatch_action has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 18 (35 pts) (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.
  • codelet_agent_loop::session_search_handler::handle_show (cognitive 33) rust/agent-loop/src/session_search_handler.rs:311 — codelet_agent_loop::session_search_handler::handle_show has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_agent_loop::generate_compaction_handler::execute_generate_compaction (cognitive 18) rust/agent-loop/src/generate_compaction_handler.rs:504 — codelet_agent_loop::generate_compaction_handler::execute_generate_compaction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×7
  • Duplicated block (21 lines × 2) rust/agent-loop/src/deep_search_provider_config.rs:91 — rust/agent-loop/src/deep_search_provider_config.rs:91-111 | rust/napi/src/deep_search_provider_config.rs:91-111 — before extracting anything, compare `rust/agent-loop/src/deep_search_provider_config.rs` and `rust/napi/src/deep_search_provider_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) rust/agent-loop/src/inject_summary_handler.rs:68 — rust/agent-loop/src/inject_summary_handler.rs:68-88 | rust/napi/src/inject_summary_handler.rs:73-94 — before extracting anything, compare `rust/agent-loop/src/inject_summary_handler.rs` and `rust/napi/src/inject_summary_handler.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) rust/agent-loop/src/session_search_handler.rs:623 — rust/agent-loop/src/session_search_handler.rs:623-643 | rust/napi/src/session_search_handler.rs:623-643 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs:26 — rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs:26-46 | rust/fspec-tui/src/views/agent/slash_command_popup_mouse.rs:29-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (21 lines × 2) rust/napi/src/astgrep.rs:938 — rust/napi/src/astgrep.rs:938-958 | rust/tools/src/astgrep_refactor.rs:760-780 — before extracting anything, compare `rust/napi/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) rust/tools/src/bash.rs:138 — rust/tools/src/bash.rs:138-158 | rust/tools/src/bash.rs:201-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) rust/tools/src/facade/wrapper.rs:865 — rust/tools/src/facade/wrapper.rs:865-885 | rust/tools/src/facade/wrapper.rs:915-935 — both copies are in the same file, so extract the 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 (9 lines × 3) · ×7
  • Duplicated block (9 lines × 3) rust/fspec-core/src/commands/delete_features.rs:63 — rust/fspec-core/src/commands/delete_features.rs:63-71 | rust/fspec-core/src/commands/delete_scenarios.rs:81-89 | rust/fspec-core/src/commands/retag.rs:84-92 — before extracting anything, compare `rust/fspec-core/src/commands/delete_features.rs` and `rust/fspec-core/src/commands/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) rust/fspec-core/src/commands/delete_tag.rs:174 — rust/fspec-core/src/commands/delete_tag.rs:174-182 | rust/fspec-core/src/commands/register_tag.rs:170-178 | rust/fspec-core/src/commands/update_tag.rs:199-207 — before extracting anything, compare `rust/fspec-core/src/commands/delete_tag.rs` and `rust/fspec-core/src/commands/update_tag.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) rust/fspec-tui/src/views/board/menu_keys.rs:90 — rust/fspec-tui/src/views/board/menu_keys.rs:90-98 | rust/fspec-tui/src/views/board/menu_keys.rs:119-127 | rust/fspec-tui/src/views/board/menu_keys.rs:151-159 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:153 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:153-161 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:513-521 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:668-676 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) rust/graph/src/ast_pipeline/ast_go_extractor.rs:105 — rust/graph/src/ast_pipeline/ast_go_extractor.rs:105-113 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:392-400 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:473-481 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) rust/graph/src/ast_pipeline/ast_java_extractor.rs:103 — rust/graph/src/ast_pipeline/ast_java_extractor.rs:103-111 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:308-316 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:375-383 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) rust/graph/src/ast_pipeline/ast_php_extractor.rs:105 — rust/graph/src/ast_pipeline/ast_php_extractor.rs:105-113 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:326-334 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:384-392 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) rust/core/src/lifecycle_hooks/engine.rs:39 — rust/core/src/lifecycle_hooks/engine.rs:39-46 | rust/core/src/lifecycle_hooks/engine.rs:87-94 | rust/core/src/lifecycle_hooks/engine.rs:131-138 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) rust/fspec-core/src/commands/add_diagram.rs:106 — rust/fspec-core/src/commands/add_diagram.rs:106-113 | rust/fspec-core/src/commands/add_hook.rs:130-137 | rust/fspec-core/src/commands/add_persona.rs:139-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) rust/fspec-core/src/commands/unlink_coverage.rs:191 — rust/fspec-core/src/commands/unlink_coverage.rs:191-199 | rust/fspec-core/src/commands/unlink_coverage.rs:215-222 | rust/fspec-core/src/commands/unlink_coverage.rs:243-250 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) rust/tools/src/web_search.rs:678 — rust/tools/src/web_search.rs:678-685 | rust/tools/src/web_search.rs:767-774 | rust/tools/src/web_search.rs:816-823 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) rust/fspec-core/src/commands/cleanup_checkpoints.rs:167 — rust/fspec-core/src/commands/cleanup_checkpoints.rs:167-174 | rust/fspec-core/src/commands/list_checkpoints.rs:125-132 | rust/rpc/src/checkpoints.rs:180-187 — before extracting anything, compare `rust/fspec-core/src/commands/cleanup_checkpoints.rs` and `rust/fspec-core/src/commands/list_checkpoints.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) rust/fspec-core/src/commands/add_architecture_note.rs:85 — rust/fspec-core/src/commands/add_architecture_note.rs:85-96 | rust/fspec-core/src/commands/add_virtual_hook.rs:131-140 | rust/fspec-core/src/commands/remove_architecture_note.rs:112-119 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture_note.rs` and `rust/fspec-core/src/commands/remove_architecture_note.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) rust/fspec-core/src/commands/add_persona.rs:113 — rust/fspec-core/src/commands/add_persona.rs:113-121 | rust/fspec-core/src/commands/delete_diagram.rs:55-62 | rust/fspec-core/src/commands/remove_persona.rs:72-80 — before extracting anything, compare `rust/fspec-core/src/commands/add_persona.rs` and `rust/fspec-core/src/commands/remove_persona.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×7
  • Duplicated block (7 lines × 4) rust/fspec-core/src/commands/add_scenario.rs:45 — rust/fspec-core/src/commands/add_scenario.rs:45-51 | rust/fspec-core/src/commands/add_step.rs:67-73 | rust/fspec-core/src/commands/update_scenario.rs:54-60 | rust/fspec-core/src/commands/update_step.rs:64-70 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/add_step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 4) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:154 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:154-160 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:341-347 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:514-520 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:669-675 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 4) rust/fspec-core/src/commands/add_scenario.rs:191 — rust/fspec-core/src/commands/add_scenario.rs:191-197 | rust/fspec-core/src/commands/add_step.rs:289-295 | rust/fspec-core/src/commands/update_scenario.rs:244-250 | rust/fspec-core/src/commands/update_step.rs:244-250 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/add_step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 4) rust/fspec-core/src/commands/generate_foundation_md.rs:81 — rust/fspec-core/src/commands/generate_foundation_md.rs:81-92 | rust/fspec-core/src/commands/generate_tags_md.rs:79-88 | rust/fspec-core/src/commands/show_foundation.rs:95-101 | rust/fspec-core/src/commands/show_foundation_event_storm.rs:62-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (7 lines × 4) rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:151 — rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:151-157 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:103-109 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:170-177 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:94-100 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` and `rust/graph/src/ast_pipeline/ast_python_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 4) rust/fspec-core/src/commands/show_acceptance_criteria.rs:230 — rust/fspec-core/src/commands/show_acceptance_criteria.rs:230-236 | rust/fspec-core/src/commands/show_coverage.rs:144-150 | rust/fspec-core/src/commands/show_feature.rs:147-153 | rust/fspec-core/src/commands/show_foundation.rs:162-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (7 lines × 4) rust/fspec-core/src/commands/add_architecture_note.rs:151 — rust/fspec-core/src/commands/add_architecture_note.rs:151-157 | rust/fspec-core/src/commands/remove_architecture_note.rs:190-196 | rust/fspec-core/src/commands/restore_architecture_note.rs:174-180 | rust/fspec-core/src/commands/restore_question.rs:168-174 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture_note.rs` and `rust/fspec-core/src/commands/remove_architecture_note.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D1 · Cyclomatic Complexity · codelet_agent_loop · ×6
  • codelet_agent_loop::agent_loop::agent_loop (cyclomatic 88) rust/agent-loop/src/agent_loop.rs:73 — codelet_agent_loop::agent_loop::agent_loop has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_agent_loop::graph_search_handler::dispatch_action (cyclomatic 33) rust/agent-loop/src/graph_search_handler.rs:44 — codelet_agent_loop::graph_search_handler::dispatch_action 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.
  • codelet_agent_loop::agent_manager_handler::handle_await_idle (cyclomatic 32) rust/agent-loop/src/agent_manager_handler.rs:927 — codelet_agent_loop::agent_manager_handler::handle_await_idle 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.
  • codelet_agent_loop::generate_compaction_handler::build_and_run_compactor_agent (cyclomatic 26) rust/agent-loop/src/generate_compaction_handler.rs:177 — codelet_agent_loop::generate_compaction_handler::build_and_run_compactor_agent 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.
  • codelet_agent_loop::session_search_handler::handle_search (cyclomatic 23) rust/agent-loop/src/session_search_handler.rs:142 — codelet_agent_loop::session_search_handler::handle_search 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.
  • codelet_agent_loop::session_search_handler::handle_show (cyclomatic 19) rust/agent-loop/src/session_search_handler.rs:311 — codelet_agent_loop::session_search_handler::handle_show 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/agent-loop/src/agent_loop.rs:77 — rust/agent-loop/src/agent_loop.rs:77-1675 | rust/agent-loop/src/bridges.rs:36-70 | rust/agent-loop/src/generate_compaction_handler.rs:390-424 | rust/agent-loop/src/generate_compaction_handler.rs:460-496 | rust/napi/src/agent_loop.rs:184-1480 | rust/napi/src/bridges.rs:78-113 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/agent-loop/src/persist.rs:29 — rust/agent-loop/src/persist.rs:29-66 | rust/agent-loop/src/persist.rs:74-137 | rust/agent-loop/src/persist.rs:145-195 | rust/napi/src/persist.rs:22-59 | rust/napi/src/persist.rs:67-130 | rust/napi/src/persist.rs:138-188 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/fspec/src/add_architecture.rs:46 — rust/fspec/src/add_architecture.rs:46-69 | rust/fspec/src/add_background.rs:45-68 | rust/fspec/src/add_tag_to_feature.rs:47-84 | rust/fspec/src/delete_scenario.rs:46-69 | rust/fspec/src/delete_step.rs:44-68 | rust/fspec/src/remove_tag_from_feature.rs:46-74 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/fspec/src/discover_event_storm.rs:32 — rust/fspec/src/discover_event_storm.rs:32-60 | rust/fspec/src/list_attachments.rs:60-103 | rust/fspec/src/list_virtual_hooks.rs:62-108 | rust/fspec/src/show_deleted.rs:59-102 | rust/fspec/src/show_event_storm.rs:31-58 | rust/fspec/src/show_work_unit.rs:65-114 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/graph/src/ast_pipeline/ast_c_extractor.rs:89 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:89-139 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:101-149 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:100-147 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:102-149 | rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:92-149 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:164-207 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust/graph/src/ast_pipeline/ast_go_extractor.rs:443 — rust/graph/src/ast_pipeline/ast_go_extractor.rs:443-509 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:372-409 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:375-412 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:381-421 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:368-402 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:456-509 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×6
  • Duplicated block (23 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:809 — rust/agent-loop/src/agent_manager_handler.rs:809-831 | rust/napi/src/agent_manager_handler.rs:793-815 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) rust/agent-loop/src/session_search_handler.rs:66 — rust/agent-loop/src/session_search_handler.rs:66-88 | rust/napi/src/session_search_handler.rs:66-88 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) rust/fspec-core/src/commands/pause_schedule.rs:78 — rust/fspec-core/src/commands/pause_schedule.rs:78-100 | rust/fspec-core/src/commands/resume_schedule.rs:79-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (23 lines × 2) rust/fspec-tui/src/views/changed_files/render.rs:168 — rust/fspec-tui/src/views/changed_files/render.rs:168-190 | rust/fspec-tui/src/views/checkpoints/render.rs:254-276 — `rust/fspec-tui/src/views/changed_files/render.rs` and `rust/fspec-tui/src/views/checkpoints/render.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 7 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (23 lines × 2) rust/agent-loop/src/persist.rs:207 — rust/agent-loop/src/persist.rs:207-229 | rust/napi/src/persist.rs:200-222 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) rust/fspec-core/src/commands/add_architecture.rs:66 — rust/fspec-core/src/commands/add_architecture.rs:66-88 | rust/fspec-core/src/commands/add_background.rs:67-89 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture.rs` and `rust/fspec-core/src/commands/add_background.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×6
  • Duplicated block (19 lines × 2) rust/agent-loop/src/session_search_handler.rs:483 — rust/agent-loop/src/session_search_handler.rs:483-501 | rust/napi/src/session_search_handler.rs:483-501 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) rust/fspec-core/src/commands/update_scenario.rs:67 — rust/fspec-core/src/commands/update_scenario.rs:67-86 | rust/fspec-core/src/commands/update_step.rs:77-95 — before extracting anything, compare `rust/fspec-core/src/commands/update_scenario.rs` and `rust/fspec-core/src/commands/update_step.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) rust/napi/src/astgrep.rs:296 — rust/napi/src/astgrep.rs:296-314 | rust/napi/src/astgrep.rs:430-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.
  • Duplicated block (19 lines × 2) rust/providers/src/custom/conversion.rs:51 — rust/providers/src/custom/conversion.rs:51-69 | rust/providers/src/oauth/json_convert.rs:37-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (19 lines × 2) rust/providers/src/oauth/http_middleware.rs:114 — rust/providers/src/oauth/http_middleware.rs:114-132 | rust/providers/src/oauth/http_middleware.rs:188-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) rust/providers/src/claude_oauth.rs:86 — rust/providers/src/claude_oauth.rs:86-104 | rust/providers/src/codex/codex_oauth.rs:121-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×6
  • Duplicated block (13–14 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:160 — rust/fspec-core/src/commands/add_dependencies.rs:160-173 | rust/fspec-core/src/commands/add_dependency.rs:124-136 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13–14 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:196 — rust/fspec-core/src/commands/add_dependencies.rs:196-209 | rust/fspec-core/src/commands/add_dependency.rs:156-168 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13–14 lines × 2) rust/fspec-core/src/commands/create_feature.rs:215 — rust/fspec-core/src/commands/create_feature.rs:215-228 | rust/fspec-core/src/commands/generate_coverage.rs:185-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13–14 lines × 2) rust/fspec-core/src/update/github.rs:41 — rust/fspec-core/src/update/github.rs:41-54 | rust/fspec-core/src/update/github.rs:136-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) rust/providers/src/custom/custom_provider.rs:308 — rust/providers/src/custom/custom_provider.rs:308-320 | rust/providers/src/custom/custom_provider.rs:334-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) rust/sessions/src/model_parsing.rs:82 — rust/sessions/src/model_parsing.rs:82-95 | rust/sessions/src/model_resolution.rs:202-214 — before extracting anything, compare `rust/sessions/src/model_parsing.rs` and `rust/sessions/src/model_resolution.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×6
  • Duplicated block (12–13 lines × 2) rust/agent-loop/src/agent_loop.rs:1622 — rust/agent-loop/src/agent_loop.rs:1622-1634 | rust/napi/src/agent_loop.rs:1461-1472 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 2) rust/fspec-tui/src/components/mux_config_dialog.rs:271 — rust/fspec-tui/src/components/mux_config_dialog.rs:271-283 | rust/fspec-tui/src/components/thinking_level_dialog.rs:178-189 — before extracting anything, compare `rust/fspec-tui/src/components/mux_config_dialog.rs` and `rust/fspec-tui/src/components/thinking_level_dialog.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 2) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:168 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:168-179 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:177-189 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 2) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:419 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:419-430 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:532-544 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 2) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:320 — rust/graph/src/ast_pipeline/ast_ts_extractor.rs:320-332 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:487-498 — both copies are in the same file, so extract the block into 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–13 lines × 2) rust/graph/src/ast_pipeline/helpers.rs:77 — rust/graph/src/ast_pipeline/helpers.rs:77-89 | rust/graph/src/ast_pipeline/helpers.rs:128-139 — both copies are in the same file, so extract the 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 (9–10 lines × 2) · ×6
  • Duplicated block (9–10 lines × 2) rust/cli/src/interactive/stream_loop.rs:387 — rust/cli/src/interactive/stream_loop.rs:387-396 | rust/cli/src/interactive/stream_loop.rs:2103-2111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) rust/fspec-core/src/commands/restore_example.rs:220 — rust/fspec-core/src/commands/restore_example.rs:220-229 | rust/fspec-core/src/commands/restore_rule.rs:218-226 — before extracting anything, compare `rust/fspec-core/src/commands/restore_example.rs` and `rust/fspec-core/src/commands/restore_rule.rs` as WHOLE FILES: this scan already matched 5 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.
  • Duplicated block (9–10 lines × 2) rust/fspec-core/src/generators/tags_md.rs:301 — rust/fspec-core/src/generators/tags_md.rs:301-310 | rust/fspec-core/src/generators/tags_md.rs:423-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) rust/fspec-tui/src/views/agent/input_area.rs:174 — rust/fspec-tui/src/views/agent/input_area.rs:174-183 | rust/fspec-tui/src/views/agent/input_area.rs:215-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) rust/git/src/status.rs:143 — rust/git/src/status.rs:143-151 | rust/git/src/tree_utils.rs:244-253 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9–10 lines × 2) rust/graph/src/ast_pipeline/ast_python_extractor.rs:101 — rust/graph/src/ast_pipeline/ast_python_extractor.rs:101-109 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:168-177 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_python_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×6
  • Duplicated block (6 lines × 4) rust/fspec-core/src/commands/add_attachment.rs:266 — rust/fspec-core/src/commands/add_attachment.rs:266-273 | rust/fspec-core/src/commands/add_diagram.rs:106-111 | rust/fspec-core/src/commands/add_hook.rs:130-135 | rust/fspec-core/src/commands/add_persona.rs:139-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (6 lines × 4) rust/fspec-core/src/commands/add_capability.rs:80 — rust/fspec-core/src/commands/add_capability.rs:80-85 | rust/fspec-core/src/commands/add_persona.rs:118-124 | rust/fspec-core/src/commands/remove_capability.rs:75-80 | rust/fspec-core/src/commands/remove_persona.rs:77-83 — before extracting anything, compare `rust/fspec-core/src/commands/add_persona.rs` and `rust/fspec-core/src/commands/remove_persona.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 4) rust/fspec/src/add_capability.rs:48 — rust/fspec/src/add_capability.rs:48-53 | rust/fspec/src/add_persona.rs:50-55 | rust/fspec/src/remove_capability.rs:43-48 | rust/fspec/src/remove_persona.rs:46-51 — before extracting anything, compare `rust/fspec/src/add_capability.rs` and `rust/fspec/src/add_persona.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 4) rust/graph/src/ast_pipeline/ast_c_extractor.rs:193 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:193-198 | rust/graph/src/ast_pipeline/ast_c_extractor.rs:225-230 | rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:274-280 | rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:168-174 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_c_extractor.rs` and `rust/graph/src/ast_pipeline/ast_cpp_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 4) rust/graph/src/ast_pipeline/ast_java_extractor.rs:486 — rust/graph/src/ast_pipeline/ast_java_extractor.rs:486-491 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:457-462 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:471-476 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:424-429 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_java_extractor.rs` and `rust/graph/src/ast_pipeline/ast_php_extractor.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 4) rust/fspec-tui/src/views/agent/menu_render.rs:62 — rust/fspec-tui/src/views/agent/menu_render.rs:62-67 | rust/fspec-tui/src/views/board/render.rs:32-37 | rust/fspec-tui/src/views/multiplex/menu_render.rs:31-36 | rust/tools/src/profile/registry.rs:156-161 — 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.
D1 · Cyclomatic Complexity · App · ×5
  • App::dispatch (cyclomatic 93) rust/fspec-tui/src/app/dispatch.rs:11 — App::dispatch has cyclomatic complexity 93 (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_slash_command (cyclomatic 25) rust/fspec-tui/src/app/dispatch_slash_commands.rs:28 — App::handle_slash_command has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • App::spawn_subscriber_tasks (cyclomatic 20) rust/fspec-tui/src/app/bootstrap.rs:138 — App::spawn_subscriber_tasks 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.
  • App::dispatch_menu (cyclomatic 18) rust/fspec-tui/src/app/dispatch_menu.rs:84 — App::dispatch_menu 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.
  • App::handle_event (cyclomatic 18) rust/fspec-tui/src/app/events.rs:50 — App::handle_event 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.
D2 · Cognitive Complexity · codelet_fspec · ×5
  • codelet_fspec::main (cognitive 57) rust/fspec/src/main.rs:2401 — codelet_fspec::main has cognitive complexity 57 (threshold 15). Drivers by points: match/switch 30 (56 pts), if/else 1 (nesting depth added 26). 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.
  • codelet_fspec::delete_scenarios::run (cognitive 20) rust/fspec/src/delete_scenarios.rs:42 — codelet_fspec::delete_scenarios::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_fspec::discover_foundation::render (cognitive 20) rust/fspec/src/discover_foundation.rs:108 — codelet_fspec::discover_foundation::render has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
  • codelet_fspec::get_scenarios::run (cognitive 19) rust/fspec/src/get_scenarios.rs:41 — codelet_fspec::get_scenarios::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (3 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.
  • codelet_fspec::check::render (cognitive 18) rust/fspec/src/check.rs:64 — codelet_fspec::check::render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 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.
D2 · Cognitive Complexity · App · ×5
  • App::run (cognitive 34) rust/fspec-tui/src/app/run_loop.rs:23 — App::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (28 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • App::handle_event (cognitive 27) rust/fspec-tui/src/app/events.rs:50 — App::handle_event has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 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::spawn_subscriber_tasks (cognitive 21) rust/fspec-tui/src/app/bootstrap.rs:138 — App::spawn_subscriber_tasks has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 6 (12 pts), loops 6, if/else 1 (3 pts) (nesting depth added 8). 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::dispatch (cognitive 20) rust/fspec-tui/src/app/dispatch.rs:11 — App::dispatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 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.
  • App::dispatch_menu (cognitive 16) rust/fspec-tui/src/app/dispatch_menu.rs:84 — App::dispatch_menu has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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 · codelet_sessions · ×5
  • codelet_sessions::footer_poller::spawn_footer_poller (cognitive 30) rust/sessions/src/footer_poller.rs:90 — codelet_sessions::footer_poller::spawn_footer_poller has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_sessions::session_creation_helper::create_background_session_inner (cognitive 24) rust/sessions/src/session_creation_helper.rs:113 — codelet_sessions::session_creation_helper::create_background_session_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 4 (8 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.
  • codelet_sessions::handle_impl::session_worktree_repo_roots (cognitive 23) rust/sessions/src/handle_impl.rs:64 — codelet_sessions::handle_impl::session_worktree_repo_roots has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 1 (3 pts) (nesting depth added 16). 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.
  • codelet_sessions::model_resolution::apply_model_selection (cognitive 17) rust/sessions/src/model_resolution.rs:179 — codelet_sessions::model_resolution::apply_model_selection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (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.
  • codelet_sessions::startup_model_resolution::resolve_startup_model (cognitive 17) rust/sessions/src/startup_model_resolution.rs:52 — codelet_sessions::startup_model_resolution::resolve_startup_model has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 1 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust/fspec-core/src/commands/add_attachment.rs:97 — rust/fspec-core/src/commands/add_attachment.rs:97-305 | rust/fspec-core/src/commands/add_diagram.rs:49-155 | rust/fspec-core/src/commands/add_hook.rs:78-169 | rust/fspec-core/src/commands/add_persona.rs:90-192 | rust/fspec-core/src/commands/add_virtual_hook.rs:67-168 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust/fspec-core/src/commands/audit_coverage.rs:73 — rust/fspec-core/src/commands/audit_coverage.rs:73-150 | rust/fspec-core/src/commands/checkpoint.rs:77-147 | rust/fspec-core/src/commands/cleanup_checkpoints.rs:81-163 | rust/fspec-core/src/commands/list_checkpoints.rs:68-120 | rust/fspec-core/src/commands/restore_checkpoint.rs:125-205 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust/fspec-core/src/commands/remove_architecture_note.rs:79 — rust/fspec-core/src/commands/remove_architecture_note.rs:79-97 | rust/fspec-core/src/commands/remove_example.rs:82-100 | rust/fspec-core/src/commands/remove_question.rs:75-93 | rust/fspec-core/src/commands/remove_rule.rs:61-80 | rust/fspec-core/src/commands/restore_example.rs:84-102 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust/fspec/src/delete_features.rs:45 — rust/fspec/src/delete_features.rs:45-107 | rust/fspec/src/delete_scenarios.rs:42-142 | rust/fspec/src/list_scenario_tags.rs:66-110 | rust/fspec/src/retag.rs:33-105 | rust/fspec/src/validate_tags.rs:43-76 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:768 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:768-855 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:866-914 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:351-435 | rust/graph/src/ast_pipeline/edge_helpers.rs:78-182 | rust/graph/src/ast_pipeline/edge_helpers.rs:188-222 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×5
  • Duplicated block (27 lines × 2) rust/agent-loop/src/schedule_handler.rs:263 — rust/agent-loop/src/schedule_handler.rs:263-289 | rust/napi/src/schedule_handler.rs:263-289 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (27 lines × 2) rust/agent-loop/src/session_search_handler.rs:95 — rust/agent-loop/src/session_search_handler.rs:95-121 | rust/napi/src/session_search_handler.rs:95-121 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (27 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:418 — rust/fspec-core/src/commands/link_coverage/step.rs:418-444 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:641-667 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (27 lines × 2) rust/fspec-tui/src/components/work_unit_search_rows.rs:74 — rust/fspec-tui/src/components/work_unit_search_rows.rs:74-100 | rust/fspec-tui/src/views/agent/file_search_popup_rows.rs:44-70 — 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 (27 lines × 2) rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:426 — rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:426-452 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:442-468 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×5
  • Duplicated block (6 lines × 6) rust/agent-loop/src/agent_loop.rs:361 — rust/agent-loop/src/agent_loop.rs:361-366 | rust/agent-loop/src/bridges.rs:37-42 | rust/agent-loop/src/generate_compaction_handler.rs:391-396 | rust/agent-loop/src/generate_compaction_handler.rs:461-466 | rust/napi/src/agent_loop.rs:443-448 | rust/napi/src/bridges.rs:81-86 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 6) rust/fspec/src/add_architecture.rs:56 — rust/fspec/src/add_architecture.rs:56-61 | rust/fspec/src/add_background.rs:55-60 | rust/fspec/src/add_tag_to_feature.rs:62-71 | rust/fspec/src/delete_scenario.rs:56-61 | rust/fspec/src/delete_step.rs:55-60 | rust/fspec/src/remove_tag_from_feature.rs:56-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 6 call sites, so a change lands once.
  • Duplicated block (6 lines × 6) rust/fspec-core/src/commands/generate_foundation_md.rs:153 — rust/fspec-core/src/commands/generate_foundation_md.rs:153-158 | rust/fspec-core/src/commands/generate_tags_md.rs:117-122 | rust/fspec-core/src/commands/show_acceptance_criteria.rs:231-236 | rust/fspec-core/src/commands/show_coverage.rs:145-150 | rust/fspec-core/src/commands/show_feature.rs:148-153 | rust/fspec-core/src/commands/show_foundation.rs:163-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 6 call sites, so a change lands once.
  • Duplicated block (6 lines × 6) rust/graph/src/ast_pipeline/ast_c_extractor.rs:222 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:222-227 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:189-194 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:101-106 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:153-158 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:168-173 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:92-97 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_c_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 6) rust/fspec-core/src/commands/add_bounded_context.rs:193 — rust/fspec-core/src/commands/add_bounded_context.rs:193-198 | rust/fspec-core/src/commands/add_domain_event.rs:145-150 | rust/fspec-core/src/commands/add_external_system.rs:194-199 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:163-168 | rust/fspec-core/src/commands/add_hotspot.rs:135-140 | rust/fspec-core/src/commands/add_policy.rs:167-172 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 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.
D5 · Coupling · Off the main sequence · ×5
  • Off the main sequence: codelet-attachment-viewer — codelet-attachment-viewer: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: codelet-fspec-json-error — codelet-fspec-json-error: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: codelet-rpc-types — codelet-rpc-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
  • Off the main sequence: codelet-git — codelet-git: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: codelet-tools — codelet-tools: abstractness 0.05, instability 0.20, distance 0.75 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: SessionManager (LCOM4 26) rust/sessions/src/session_manager.rs:148 — SessionManager's methods fall into 26 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 26 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: StubSessionManagerHandle (LCOM4 20) rust/core/src/session_manager_handle.rs:1025 — StubSessionManagerHandle's methods fall into 20 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 20 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: BackgroundSession (LCOM4 13) rust/sessions/src/background_session.rs:270 — BackgroundSession's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SharedFspecService (LCOM4 4) rust/rpc/src/lib.rs:724 — SharedFspecService'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: ChromeBrowser (LCOM4 4) rust/tools/src/chrome_browser.rs:94 — ChromeBrowser's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D1 · Cyclomatic Complexity · codelet_cli · ×4
  • codelet_cli::interactive::stream_loop::run_agent_stream_internal (cyclomatic 129) rust/cli/src/interactive/stream_loop.rs:232 — codelet_cli::interactive::stream_loop::run_agent_stream_internal has cyclomatic complexity 129 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_cli::interactive::gemini_continuation::run_continuation_loop (cyclomatic 25) rust/cli/src/interactive/gemini_continuation.rs:202 — codelet_cli::interactive::gemini_continuation::run_continuation_loop 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.
  • codelet_cli::interactive::recovery_image::sanitize_image_content (cyclomatic 19) rust/cli/src/interactive/recovery_image.rs:17 — codelet_cli::interactive::recovery_image::sanitize_image_content 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.
  • codelet_cli::interactive_helpers::reconcile_session_messages (cyclomatic 17) rust/cli/src/interactive_helpers.rs:382 — codelet_cli::interactive_helpers::reconcile_session_messages 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 · AstGrepRefactorTool · ×4
  • AstGrepRefactorTool::execute (cognitive 78) rust/tools/src/astgrep_refactor.rs:144 — AstGrepRefactorTool::execute has cognitive complexity 78 (threshold 15). Drivers by points: if/else 29 (51 pts), match/switch 12 (18 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AstGrepRefactorTool::topological_sort (cognitive 23) rust/tools/src/astgrep_refactor.rs:675 — AstGrepRefactorTool::topological_sort has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AstGrepRefactorTool::detect_cyclic_dependencies (cognitive 21) rust/tools/src/astgrep_refactor.rs:621 — AstGrepRefactorTool::detect_cyclic_dependencies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (has_cycle). 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.
  • AstGrepRefactorTool::split_into_words (cognitive 20) rust/tools/src/astgrep_refactor.rs:725 — AstGrepRefactorTool::split_into_words has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFields · ×4
  • TooManyFields: StubSessionManagerHandle rust/core/src/session_manager_handle.rs:1025 — TooManyFields — 62 stored fields beside 56 methods. The bar is 30 stored fields; this is 32 over it, 2.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: BackgroundSession rust/sessions/src/background_session.rs:270 — TooManyFields — 58 stored fields beside 75 methods. The bar is 30 stored fields; this is 28 over it, 1.93× 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: AgentView rust/fspec-tui/src/views/agent.rs:116 — TooManyFields — 35 stored fields beside 68 methods. The bar is 30 stored fields; this is 5 over it, 1.17× 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: AgentViewStore rust/fspec-tui/src/store/agent_view.rs:54 — TooManyFields — 32 stored fields beside 94 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.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×4
  • Duplicated block (29 lines × 2) rust/agent-loop/src/agent_loop.rs:872 — rust/agent-loop/src/agent_loop.rs:872-900 | rust/napi/src/agent_loop.rs:842-870 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (29 lines × 2) rust/agent-loop/src/agent_loop.rs:1527 — rust/agent-loop/src/agent_loop.rs:1527-1555 | rust/napi/src/agent_loop.rs:1400-1428 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (29 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:1002 — rust/agent-loop/src/agent_manager_handler.rs:1002-1030 | rust/napi/src/agent_manager_handler.rs:966-994 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (29 lines × 2) rust/agent-loop/src/session_search_handler.rs:651 — rust/agent-loop/src/session_search_handler.rs:651-679 | rust/napi/src/session_search_handler.rs:651-679 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×4
  • Duplicated block (25 lines × 2) rust/agent-loop/src/agent_loop.rs:95 — rust/agent-loop/src/agent_loop.rs:95-119 | rust/napi/src/agent_loop.rs:196-220 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:516 — rust/agent-loop/src/agent_manager_handler.rs:516-540 | rust/napi/src/agent_manager_handler.rs:500-524 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) rust/agent-loop/src/schedule_handler.rs:165 — rust/agent-loop/src/schedule_handler.rs:165-189 | rust/napi/src/schedule_handler.rs:165-189 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) rust/agent-loop/src/schedule_handler.rs:348 — rust/agent-loop/src/schedule_handler.rs:348-372 | rust/napi/src/schedule_handler.rs:348-372 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) rust/agent-loop/src/session_search_handler.rs:438 — rust/agent-loop/src/session_search_handler.rs:438-459 | rust/napi/src/session_search_handler.rs:438-459 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:195 — rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:195-216 | rust/fspec-tui/src/components/create_session_dialog.rs:216-237 — before extracting anything, compare `rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs` and `rust/fspec-tui/src/components/create_session_dialog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) rust/fspec-tui/src/views/changed_files/render.rs:126 — rust/fspec-tui/src/views/changed_files/render.rs:126-147 | rust/fspec-tui/src/views/checkpoints/render.rs:212-233 — `rust/fspec-tui/src/views/changed_files/render.rs` and `rust/fspec-tui/src/views/checkpoints/render.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 7 separate duplicated blocks between them, totalling at least 102 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (22 lines × 2) rust/fspec/src/add_capability.rs:76 — rust/fspec/src/add_capability.rs:76-98 | rust/fspec/src/add_persona.rs:85-106 — before extracting anything, compare `rust/fspec/src/add_capability.rs` and `rust/fspec/src/add_persona.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×4
  • Duplicated block (12 lines × 3) rust/fspec-core/src/commands/remove_question.rs:120 — rust/fspec-core/src/commands/remove_question.rs:120-131 | rust/fspec-core/src/commands/restore_question.rs:75-86 | rust/fspec-core/src/commands/restore_rule.rs:112-123 — before extracting anything, compare `rust/fspec-core/src/commands/remove_question.rs` and `rust/fspec-core/src/commands/restore_question.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) rust/fspec-tui/src/components/work_unit_search_rows.rs:67 — rust/fspec-tui/src/components/work_unit_search_rows.rs:67-78 | rust/fspec-tui/src/views/agent/file_search_popup_rows.rs:37-48 | rust/fspec-tui/src/views/agent/slash_command_popup_rows.rs:35-46 — 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 (12 lines × 3) rust/tools/src/facade/wrapper.rs:488 — rust/tools/src/facade/wrapper.rs:488-499 | rust/tools/src/facade/wrapper.rs:543-554 | rust/tools/src/facade/wrapper.rs:603-614 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) rust/fspec-core/src/commands/add_virtual_hook.rs:81 — rust/fspec-core/src/commands/add_virtual_hook.rs:81-92 | rust/fspec-core/src/commands/clear_dependencies.rs:95-107 | rust/fspec-core/src/commands/remove_virtual_hook.rs:85-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×4
  • Duplicated block (11–12 lines × 2) rust/core/src/lifecycle_hooks/engine.rs:173 — rust/core/src/lifecycle_hooks/engine.rs:173-184 | rust/core/src/lifecycle_hooks/helpers.rs:42-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11–12 lines × 2) rust/fspec-core/src/commands/delete_scenario.rs:292 — rust/fspec-core/src/commands/delete_scenario.rs:292-303 | rust/fspec-core/src/commands/delete_scenarios.rs:374-384 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11–12 lines × 2) rust/providers/src/copilot/refreshing_client.rs:146 — rust/providers/src/copilot/refreshing_client.rs:146-157 | rust/providers/src/copilot/refreshing_client.rs:200-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) rust/tools/src/unified_exec/spawning.rs:214 — rust/tools/src/unified_exec/spawning.rs:214-225 | rust/tools/src/unified_exec/spawning.rs:257-267 — both copies are in the same file, so extract the 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 · AgentView · ×3
  • AgentView::handle_event (cyclomatic 50) rust/fspec-tui/src/views/agent/dispatch.rs:53 — AgentView::handle_event has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AgentView::render_session_pane (cyclomatic 20) rust/fspec-tui/src/views/agent/pane_render.rs:90 — AgentView::render_session_pane 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.
  • AgentView::handle_menu_mouse (cyclomatic 18) rust/fspec-tui/src/views/agent/menu_mouse.rs:42 — AgentView::handle_menu_mouse 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 · codelet_git · ×3
  • codelet_git::tree_utils::collect_worktree_files (cyclomatic 20) rust/git/src/tree_utils.rs:49 — codelet_git::tree_utils::collect_worktree_files 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.
  • codelet_git::repo_ops::build_tree_from_index (cyclomatic 19) rust/git/src/repo_ops.rs:232 — codelet_git::repo_ops::build_tree_from_index 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.
  • codelet_git::ghost_commit::restore_ghost_commit (cyclomatic 17) rust/git/src/ghost_commit.rs:493 — codelet_git::ghost_commit::restore_ghost_commit 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 · SessionManager · ×3
  • SessionManager::restore_session_messages (cognitive 109) rust/sessions/src/handle_impl.rs:539 — SessionManager::restore_session_messages has cognitive complexity 109 (threshold 15). Drivers by points: if/else 22 (86 pts), loops 5 (11 pts), match/switch 2 (9 pts), boolean chains 3 (nesting depth added 77). 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.
  • SessionManager::blocklist_list (cognitive 20) rust/sessions/src/handle_impl.rs:1990 — SessionManager::blocklist_list has cognitive complexity 20 (threshold 15). Drivers by points: loops 2 (8 pts), if/else 4 (6 pts), match/switch 2 (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.
  • SessionManager::list_providers (cognitive 18) rust/sessions/src/handle_impl.rs:1259 — SessionManager::list_providers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 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.
D2 · Cognitive Complexity · AgentView · ×3
  • AgentView::handle_event (cognitive 76) rust/fspec-tui/src/views/agent/dispatch.rs:53 — AgentView::handle_event has cognitive complexity 76 (threshold 15). Drivers by points: if/else 35 (63 pts), boolean chains 7, match/switch 4 (6 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.
  • AgentView::handle_menu_mouse (cognitive 50) rust/fspec-tui/src/views/agent/menu_mouse.rs:42 — AgentView::handle_menu_mouse has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 3 (12 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AgentView::render_session_pane (cognitive 31) rust/fspec-tui/src/views/agent/pane_render.rs:90 — AgentView::render_session_pane has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (30 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 · codelet_common · ×3
  • codelet_common::tool_usage::render_parameter_reference (cognitive 30) rust/common/src/tool_usage.rs:95 — codelet_common::tool_usage::render_parameter_reference has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_common::image_dimensions::extract_jpeg_dimensions (cognitive 20) rust/common/src/image_dimensions.rs:76 — codelet_common::image_dimensions::extract_jpeg_dimensions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • codelet_common::tool_usage::variant_label (cognitive 16) rust/common/src/tool_usage.rs:255 — codelet_common::tool_usage::variant_label has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (7 members, 50+ identical tokens) rust/core/src/git_state.rs:79 — rust/core/src/git_state.rs:79-102 | rust/fspec-core/src/commands/checkpoint.rs:208-234 | rust/fspec-core/src/commands/cleanup_checkpoints.rs:191-217 | rust/fspec-core/src/commands/list_checkpoints.rs:174-204 | rust/fspec-core/src/commands/update_work_unit_status.rs:1186-1202 | rust/fspec/src/common.rs:384-396 | rust/rpc/src/checkpoints.rs:222-248 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) rust/fspec-core/src/commands/restore_rule.rs:341 — rust/fspec-core/src/commands/restore_rule.rs:341-356 | rust/fspec/src/remove_architecture_note.rs:69-84 | rust/fspec/src/remove_example.rs:81-97 | rust/fspec/src/remove_question.rs:77-92 | rust/fspec/src/remove_rule.rs:81-98 | rust/fspec/src/restore_example.rs:94-110 | rust/fspec/src/restore_rule.rs:90-105 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:92 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:92-139 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:150-198 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:141-188 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:97-140 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:115-159 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:88-135 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:116-161 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×3
  • Duplicated block (44 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:378 — rust/agent-loop/src/agent_manager_handler.rs:378-421 | rust/napi/src/agent_manager_handler.rs:362-405 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (44 lines × 2) rust/agent-loop/src/deep_search_handler.rs:221 — rust/agent-loop/src/deep_search_handler.rs:221-264 | rust/napi/src/deep_search_handler.rs:219-262 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (44 lines × 2) rust/providers/src/custom/internal_dispatch.rs:183 — rust/providers/src/custom/internal_dispatch.rs:183-226 | rust/tools/src/facade/wrapper.rs:118-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×3
  • Duplicated block (41 lines × 2) rust/agent-loop/src/agent_loop.rs:1287 — rust/agent-loop/src/agent_loop.rs:1287-1327 | rust/napi/src/agent_loop.rs:1175-1215 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (41 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:682 — rust/agent-loop/src/agent_manager_handler.rs:682-722 | rust/napi/src/agent_manager_handler.rs:666-706 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (41 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:765 — rust/agent-loop/src/agent_manager_handler.rs:765-805 | rust/napi/src/agent_manager_handler.rs:749-789 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×3
  • Duplicated block (30 lines × 2) rust/agent-loop/src/agent_loop.rs:963 — rust/agent-loop/src/agent_loop.rs:963-992 | rust/napi/src/agent_loop.rs:933-962 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (30 lines × 2) rust/agent-loop/src/thinking_level_detection.rs:97 — rust/agent-loop/src/thinking_level_detection.rs:97-126 | rust/napi/src/thinking_level_detection.rs:100-129 — before extracting anything, compare `rust/agent-loop/src/thinking_level_detection.rs` and `rust/napi/src/thinking_level_detection.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (30 lines × 2) rust/fspec-core/src/commands/add_capability.rs:56 — rust/fspec-core/src/commands/add_capability.rs:56-85 | rust/fspec-core/src/commands/remove_capability.rs:51-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×3
  • Duplicated block (28 lines × 2) rust/agent-loop/src/inject_summary_handler.rs:149 — rust/agent-loop/src/inject_summary_handler.rs:149-176 | rust/napi/src/inject_summary_handler.rs:173-200 — before extracting anything, compare `rust/agent-loop/src/inject_summary_handler.rs` and `rust/napi/src/inject_summary_handler.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (28 lines × 2) rust/fspec-tui/src/views/provider_settings/profiles_config.rs:31 — rust/fspec-tui/src/views/provider_settings/profiles_config.rs:31-58 | rust/fspec-tui/src/views/provider_settings/profiles_config.rs:232-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) rust/rpc-server/src/client.rs:127 — rust/rpc-server/src/client.rs:127-154 | rust/rpc-server/src/client.rs:215-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×3
  • Duplicated block (18–20 lines × 2) rust/cli/src/interactive/gemini_continuation.rs:482 — rust/cli/src/interactive/gemini_continuation.rs:482-499 | rust/cli/src/interactive/recovery_compaction.rs:186-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18–20 lines × 2) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:386 — rust/graph/src/ast_pipeline/ast_ts_extractor.rs:386-403 | rust/graph/src/ast_pipeline/edge_helpers.rs:121-140 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` and `rust/graph/src/ast_pipeline/edge_helpers.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (18–20 lines × 2) rust/tools/src/pdf.rs:108 — rust/tools/src/pdf.rs:108-127 | rust/tools/src/pdf.rs:330-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) rust/fspec-core/src/commands/add_architecture.rs:146 — rust/fspec-core/src/commands/add_architecture.rs:146-165 | rust/fspec-core/src/commands/add_background.rs:147-166 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture.rs` and `rust/fspec-core/src/commands/add_background.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:297 — rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:297-316 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:317-336 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs` and `rust/graph/src/ast_pipeline/ast_scala_extractor.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) rust/graph/src/ast_pipeline/complexity.rs:186 — rust/graph/src/ast_pipeline/complexity.rs:186-205 | rust/graph/src/ast_pipeline/helpers.rs:346-365 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (19 lines × 3) · ×3
  • Duplicated block (19 lines × 3) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:208 — rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:208-226 | rust/fspec-tui/src/components/create_session_dialog.rs:229-247 | rust/fspec-tui/src/components/exit_confirmation_dialog.rs:223-241 — before extracting anything, compare `rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs` and `rust/fspec-tui/src/components/create_session_dialog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 3) rust/fspec-tui/src/views/agent/confirm_dialog.rs:229 — rust/fspec-tui/src/views/agent/confirm_dialog.rs:229-247 | rust/fspec-tui/src/views/agent/merge_confirm_dialog.rs:246-264 | rust/fspec-tui/src/views/agent/session_worktrees_dialog.rs:216-234 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (19 lines × 3) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:776 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:776-794 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:359-377 | rust/graph/src/ast_pipeline/edge_helpers.rs:86-104 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×3
  • Duplicated block (18–19 lines × 2) rust/graph/src/lib.rs:139 — rust/graph/src/lib.rs:139-156 | rust/graph/src/lib.rs:173-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18–19 lines × 2) rust/providers/src/adapter.rs:104 — rust/providers/src/adapter.rs:104-121 | rust/providers/src/claude.rs:632-650 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18–19 lines × 2) rust/sessions/src/session_manager.rs:1001 — rust/sessions/src/session_manager.rs:1001-1019 | rust/sessions/src/session_manager.rs:1192-1209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×3
  • Duplicated block (18 lines × 3) rust/graph/src/ast_pipeline/ast_c_extractor.rs:160 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:160-177 | rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:186-203 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:215-232 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_c_extractor.rs` and `rust/graph/src/ast_pipeline/ast_cpp_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (18 lines × 3) rust/providers/src/claude_refreshing_client.rs:122 — rust/providers/src/claude_refreshing_client.rs:122-139 | rust/providers/src/codex/refreshing_client.rs:123-140 | rust/providers/src/oauth/token_refresh.rs:58-75 — 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 (18 lines × 3) rust/graph/src/ast_pipeline/ast_c_extractor.rs:262 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:262-279 | rust/graph/src/ast_pipeline/ast_c_extractor.rs:286-304 | rust/graph/src/ast_pipeline/ast_c_extractor.rs:336-354 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×3
  • Duplicated block (14–16 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:350 — rust/fspec-core/src/commands/add_dependencies.rs:350-365 | rust/fspec-core/src/commands/add_dependency.rs:296-309 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14–16 lines × 2) rust/fspec-core/src/commands/generate_scenarios.rs:1286 — rust/fspec-core/src/commands/generate_scenarios.rs:1286-1299 | rust/fspec-core/src/commands/update_work_unit_estimate.rs:361-376 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14–16 lines × 2) rust/providers/src/codex/codex_device_auth.rs:136 — rust/providers/src/codex/codex_device_auth.rs:136-151 | rust/providers/src/oauth/device_flow.rs:131-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×3
  • Duplicated block (13–14 lines × 3) rust/fspec-core/src/commands/generate_scenarios.rs:954 — rust/fspec-core/src/commands/generate_scenarios.rs:954-967 | rust/fspec-core/src/commands/link_coverage/step.rs:430-442 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:653-665 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/link_coverage/step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13–14 lines × 3) rust/fspec-core/src/commands/generate_scenarios.rs:976 — rust/fspec-core/src/commands/generate_scenarios.rs:976-988 | rust/fspec-core/src/commands/link_coverage/step.rs:454-467 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:677-690 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/link_coverage/step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13–14 lines × 3) rust/sessions/src/session_manager.rs:800 — rust/sessions/src/session_manager.rs:800-813 | rust/sessions/src/session_manager.rs:1001-1014 | rust/sessions/src/session_manager.rs:1192-1204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×3
  • Duplicated block (12–14 lines × 2) rust/fspec-tui/src/views/multiplex/layout.rs:143 — rust/fspec-tui/src/views/multiplex/layout.rs:143-156 | rust/fspec-tui/src/views/multiplex/splits.rs:265-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12–14 lines × 2) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:377 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:377-388 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:463-476 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–14 lines × 2) rust/providers/src/codex/codex_oauth_server.rs:322 — rust/providers/src/codex/codex_oauth_server.rs:322-335 | rust/providers/src/oauth/callback_server.rs:223-234 — before extracting anything, compare `rust/providers/src/codex/codex_oauth_server.rs` and `rust/providers/src/oauth/callback_server.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) rust/fspec-core/src/commands/add_command_to_foundation.rs:144 — rust/fspec-core/src/commands/add_command_to_foundation.rs:144-156 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:152-164 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:131-143 — before extracting anything, compare `rust/fspec-core/src/commands/add_command_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 3) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:388 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:388-400 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:476-488 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:447-459 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 3) rust/tools/src/astgrep.rs:483 — rust/tools/src/astgrep.rs:483-495 | rust/tools/src/astgrep_refactor.rs:1136-1148 | rust/tools/src/grep.rs:459-476 — before extracting anything, compare `rust/tools/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×3
  • Duplicated block (12 lines × 4) rust/agent-loop/src/persist.rs:30 — rust/agent-loop/src/persist.rs:30-41 | rust/agent-loop/src/persist.rs:146-157 | rust/napi/src/persist.rs:23-34 | rust/napi/src/persist.rs:139-150 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 4) rust/graph/src/ast_pipeline/ast_go_extractor.rs:50 — rust/graph/src/ast_pipeline/ast_go_extractor.rs:50-61 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:52-63 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:69-80 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:119-130 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_go_extractor.rs` and `rust/graph/src/ast_pipeline/ast_python_extractor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 4) rust/fspec/src/add_aggregate_to_foundation.rs:57 — rust/fspec/src/add_aggregate_to_foundation.rs:57-68 | rust/fspec/src/add_foundation_bounded_context.rs:51-62 | rust/fspec/src/remove_aggregate_from_foundation.rs:53-64 | rust/fspec/src/remove_foundation_bounded_context.rs:46-57 — before extracting anything, compare `rust/fspec/src/add_foundation_bounded_context.rs` and `rust/fspec/src/remove_foundation_bounded_context.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) rust/fspec-core/src/commands/delete_tag.rs:101 — rust/fspec-core/src/commands/delete_tag.rs:101-110 | rust/fspec-core/src/commands/update_tag.rs:106-116 — before extracting anything, compare `rust/fspec-core/src/commands/delete_tag.rs` and `rust/fspec-core/src/commands/update_tag.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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–11 lines × 2) rust/fspec-core/src/commands/register_tag.rs:126 — rust/fspec-core/src/commands/register_tag.rs:126-135 | rust/fspec-core/src/commands/update_tag.rs:142-152 — before extracting anything, compare `rust/fspec-core/src/commands/register_tag.rs` and `rust/fspec-core/src/commands/update_tag.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 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–11 lines × 2) rust/napi/src/persistence/napi_bindings.rs:704 — rust/napi/src/persistence/napi_bindings.rs:704-714 | rust/napi/src/persistence/napi_bindings.rs:766-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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) rust/agent-loop/src/bridges.rs:37 — rust/agent-loop/src/bridges.rs:37-46 | rust/agent-loop/src/generate_compaction_handler.rs:391-400 | rust/agent-loop/src/generate_compaction_handler.rs:461-470 | rust/napi/src/bridges.rs:81-90 — before extracting anything, compare `rust/agent-loop/src/bridges.rs` and `rust/napi/src/bridges.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) rust/agent-loop/src/schedule_handler.rs:295 — rust/agent-loop/src/schedule_handler.rs:295-304 | rust/agent-loop/src/schedule_handler.rs:323-332 | rust/napi/src/schedule_handler.rs:295-304 | rust/napi/src/schedule_handler.rs:323-332 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) rust/providers/src/claude.rs:554 — rust/providers/src/claude.rs:554-563 | rust/providers/src/gemini.rs:212-221 | rust/providers/src/openai.rs:466-475 | rust/providers/src/zai.rs:282-291 — before extracting anything, compare `rust/providers/src/claude.rs` and `rust/providers/src/gemini.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) rust/fspec-core/src/commands/add_dependencies.rs:371 — rust/fspec-core/src/commands/add_dependencies.rs:371-380 | rust/fspec-core/src/commands/add_dependency.rs:312-321 | rust/fspec-core/src/commands/prioritize_work_unit.rs:71-80 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 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 × 3) rust/fspec-core/src/commands/review.rs:780 — rust/fspec-core/src/commands/review.rs:780-789 | rust/fspec-core/src/commands/show_feature.rs:350-359 | rust/fspec-core/src/commands/show_work_unit.rs:542-551 — before extracting anything, compare `rust/fspec-core/src/commands/review.rs` and `rust/fspec-core/src/commands/show_work_unit.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) rust/fspec/src/create_bug.rs:57 — rust/fspec/src/create_bug.rs:57-66 | rust/fspec/src/create_story.rs:57-66 | rust/fspec/src/create_task.rs:57-66 — before extracting anything, compare `rust/fspec/src/create_bug.rs` and `rust/fspec/src/create_story.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) rust/fspec-core/src/commands/add_dependencies.rs:325 — rust/fspec-core/src/commands/add_dependencies.rs:325-332 | rust/fspec-core/src/commands/add_dependency.rs:277-284 | rust/fspec-core/src/commands/import_example_map.rs:149-156 | rust/fspec-core/src/commands/repair_work_units.rs:243-250 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 4) rust/fspec/src/delete_features.rs:55 — rust/fspec/src/delete_features.rs:55-62 | rust/fspec/src/delete_scenarios.rs:58-65 | rust/fspec/src/retag.rs:47-54 | rust/fspec/src/validate_tags.rs:53-60 — before extracting anything, compare `rust/fspec/src/delete_features.rs` and `rust/fspec/src/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 4) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:738 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:738-745 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:530-537 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:439-446 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:455-462 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
D1 · Cyclomatic Complexity · BackgroundOutput · ×2
  • BackgroundOutput::emit (cyclomatic 32) rust/agent-loop/src/background_output.rs:309 — BackgroundOutput::emit 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.
  • BackgroundOutput::emit (cyclomatic 30) rust/napi/src/agent_loop.rs:1548 — BackgroundOutput::emit 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 · Navigator · ×2
  • Navigator::handle_mux_event (cyclomatic 27) rust/fspec-tui/src/views/navigator_mux_events.rs:25 — Navigator::handle_mux_event 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.
  • Navigator::handle_provider_settings_event (cyclomatic 19) rust/fspec-tui/src/views/navigator_events.rs:26 — Navigator::handle_provider_settings_event 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 · codelet_sessions · ×2
  • codelet_sessions::session_creation_helper::create_background_session_inner (cyclomatic 18) rust/sessions/src/session_creation_helper.rs:113 — codelet_sessions::session_creation_helper::create_background_session_inner has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • codelet_sessions::footer_poller::spawn_footer_poller (cyclomatic 17) rust/sessions/src/footer_poller.rs:90 — codelet_sessions::footer_poller::spawn_footer_poller 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 · CheckpointsView · ×2
  • CheckpointsView::handle_mouse (cognitive 51) rust/fspec-tui/src/views/checkpoints/keys.rs:81 — CheckpointsView::handle_mouse has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (48 pts), match/switch 2, boolean chains 1 (nesting depth added 31). 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.
  • CheckpointsView::set_files (cognitive 17) rust/fspec-tui/src/views/checkpoints/mod.rs:323 — CheckpointsView::set_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackgroundOutput · ×2
  • BackgroundOutput::emit (cognitive 44) rust/agent-loop/src/background_output.rs:309 — BackgroundOutput::emit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • BackgroundOutput::emit (cognitive 39) rust/napi/src/agent_loop.rs:1548 — BackgroundOutput::emit has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 25). 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 · Navigator · ×2
  • Navigator::handle_mux_event (cognitive 41) rust/fspec-tui/src/views/navigator_mux_events.rs:25 — Navigator::handle_mux_event has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 4 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Navigator::handle_provider_settings_event (cognitive 23) rust/fspec-tui/src/views/navigator_events.rs:26 — Navigator::handle_provider_settings_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 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.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:301 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:301-321 | rust/fspec-core/src/commands/add_command_to_foundation.rs:188-208 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:197-217 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:181-201 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:230-250 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:174-194 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:177-197 | rust/fspec-core/src/commands/remove_foundation_bounded_context.rs:198-218 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) rust/fspec/src/list_checkpoints.rs:53 — rust/fspec/src/list_checkpoints.rs:53-87 | rust/fspec/src/list_epics.rs:54-90 | rust/fspec/src/list_feature_tags.rs:99-165 | rust/fspec/src/list_foundation_sections.rs:53-91 | rust/fspec/src/list_prefixes.rs:54-90 | rust/fspec/src/list_work_units.rs:59-113 | rust/fspec/src/query_estimate_accuracy.rs:58-96 | rust/fspec/src/show_epic.rs:63-103 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Duplicated block (78 lines × 2) · ×2
  • Duplicated block (78 lines × 2) rust/agent-loop/src/agent_loop.rs:183 — rust/agent-loop/src/agent_loop.rs:183-260 | rust/napi/src/agent_loop.rs:276-353 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (78 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:1033 — rust/agent-loop/src/agent_manager_handler.rs:1033-1110 | rust/napi/src/agent_manager_handler.rs:997-1074 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (63 lines × 2) · ×2
  • Duplicated block (63 lines × 2) rust/agent-loop/src/persist.rs:75 — rust/agent-loop/src/persist.rs:75-137 | rust/napi/src/persist.rs:68-130 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (63 lines × 2) rust/cli/src/interactive/auto_continue.rs:241 — rust/cli/src/interactive/auto_continue.rs:241-303 | rust/fspec-tui/src/app/continue_parser.rs:90-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×2
  • Duplicated block (62 lines × 2) rust/agent-loop/src/schedule_handler.rs:199 — rust/agent-loop/src/schedule_handler.rs:199-260 | rust/napi/src/schedule_handler.rs:199-260 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (62 lines × 2) rust/fspec-core/src/commands/add_bounded_context.rs:126 — rust/fspec-core/src/commands/add_bounded_context.rs:126-187 | rust/fspec-core/src/commands/add_external_system.rs:127-188 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×2
  • Duplicated block (45 lines × 2) rust/agent-loop/src/agent_loop.rs:1126 — rust/agent-loop/src/agent_loop.rs:1126-1170 | rust/napi/src/agent_loop.rs:1095-1139 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (45 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:949 — rust/agent-loop/src/agent_manager_handler.rs:949-993 | rust/napi/src/agent_manager_handler.rs:914-958 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) rust/agent-loop/src/persist.rs:31 — rust/agent-loop/src/persist.rs:31-66 | rust/napi/src/persist.rs:24-59 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (36 lines × 2) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:352 — rust/graph/src/ast_pipeline/ast_ts_extractor.rs:352-387 | rust/graph/src/ast_pipeline/edge_helpers.rs:79-114 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` and `rust/graph/src/ast_pipeline/edge_helpers.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:889 — rust/agent-loop/src/agent_manager_handler.rs:889-919 | rust/napi/src/agent_manager_handler.rs:860-890 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (31 lines × 2) rust/agent-loop/src/schedule_handler.rs:134 — rust/agent-loop/src/schedule_handler.rs:134-164 | rust/napi/src/schedule_handler.rs:134-164 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×2
  • Duplicated block (28–29 lines × 2) rust/agent-loop/src/background_output.rs:521 — rust/agent-loop/src/background_output.rs:521-549 | rust/napi/src/agent_loop.rs:1742-1769 — before extracting anything, compare `rust/agent-loop/src/background_output.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 267 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (28–29 lines × 2) rust/agent-loop/src/bridges.rs:42 — rust/agent-loop/src/bridges.rs:42-70 | rust/napi/src/bridges.rs:86-113 — before extracting anything, compare `rust/agent-loop/src/bridges.rs` and `rust/napi/src/bridges.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×2
  • Duplicated block (25–26 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:117 — rust/agent-loop/src/agent_manager_handler.rs:117-141 | rust/napi/src/agent_manager_handler.rs:105-130 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25–26 lines × 2) rust/fspec/src/search_implementation.rs:50 — rust/fspec/src/search_implementation.rs:50-74 | rust/fspec/src/search_scenarios.rs:47-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (23–24 lines × 3) · ×2
  • Duplicated block (23–24 lines × 3) rust/fspec-core/src/commands/remove_example.rs:164 — rust/fspec-core/src/commands/remove_example.rs:164-187 | rust/fspec-core/src/commands/restore_example.rs:163-186 | rust/fspec-core/src/commands/restore_rule.rs:267-289 — before extracting anything, compare `rust/fspec-core/src/commands/remove_example.rs` and `rust/fspec-core/src/commands/restore_example.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 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 (23–24 lines × 3) rust/fspec/src/delete_features.rs:55 — rust/fspec/src/delete_features.rs:55-77 | rust/fspec/src/delete_scenarios.rs:58-81 | rust/fspec/src/retag.rs:47-69 — before extracting anything, compare `rust/fspec/src/delete_features.rs` and `rust/fspec/src/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×2
  • Duplicated block (22–23 lines × 2) rust/agent-loop/src/deep_search_handler.rs:197 — rust/agent-loop/src/deep_search_handler.rs:197-219 | rust/napi/src/deep_search_handler.rs:196-217 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (22–23 lines × 2) rust/git/src/session_result.rs:58 — rust/git/src/session_result.rs:58-80 | rust/git/src/session_result.rs:121-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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) rust/cli/src/interactive/stream_loop.rs:1394 — rust/cli/src/interactive/stream_loop.rs:1394-1414 | rust/cli/src/interactive/stream_loop.rs:2011-2032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21–22 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:254 — rust/fspec-core/src/commands/add_dependencies.rs:254-275 | rust/fspec-core/src/commands/add_dependency.rs:213-233 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) rust/napi/src/astgrep.rs:783 — rust/napi/src/astgrep.rs:783-801 | rust/tools/src/astgrep_refactor.rs:853-872 — before extracting anything, compare `rust/napi/src/astgrep.rs` and `rust/tools/src/astgrep_refactor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19–20 lines × 2) rust/sessions/src/session_manager.rs:760 — rust/sessions/src/session_manager.rs:760-779 | rust/sessions/src/session_manager.rs:1134-1152 — both copies are in the same file, so extract the 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 (19 lines × 4) · ×2
  • Duplicated block (19 lines × 4) rust/agent-loop/src/agent_manager_handler.rs:1022 — rust/agent-loop/src/agent_manager_handler.rs:1022-1040 | rust/agent-loop/src/agent_manager_handler.rs:1118-1136 | rust/napi/src/agent_manager_handler.rs:986-1004 | rust/napi/src/agent_manager_handler.rs:1082-1100 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 4) rust/core/src/lifecycle_hooks/engine.rs:50 — rust/core/src/lifecycle_hooks/engine.rs:50-68 | rust/core/src/lifecycle_hooks/engine.rs:97-115 | rust/core/src/lifecycle_hooks/engine.rs:144-162 | rust/core/src/lifecycle_hooks/engine.rs:227-245 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×2
  • Duplicated block (17–19 lines × 2) rust/core/src/lifecycle_hooks/tool_engine.rs:38 — rust/core/src/lifecycle_hooks/tool_engine.rs:38-56 | rust/core/src/lifecycle_hooks/tool_engine.rs:112-128 — both copies are in the same file, so extract the block into 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–19 lines × 2) rust/fspec/src/add_tag_to_scenario.rs:58 — rust/fspec/src/add_tag_to_scenario.rs:58-76 | rust/fspec/src/remove_tag_from_scenario.rs:54-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) rust/cli/src/interactive/stream_loop.rs:829 — rust/cli/src/interactive/stream_loop.rs:829-844 | rust/cli/src/interactive/stream_loop.rs:857-874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16–18 lines × 2) rust/fspec-core/src/commands/review.rs:709 — rust/fspec-core/src/commands/review.rs:709-724 | rust/fspec-core/src/commands/show_work_unit.rs:441-458 — before extracting anything, compare `rust/fspec-core/src/commands/review.rs` and `rust/fspec-core/src/commands/show_work_unit.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×2
  • Duplicated block (15–17 lines × 2) rust/fspec/src/update_scenario.rs:58 — rust/fspec/src/update_scenario.rs:58-74 | rust/fspec/src/update_step.rs:69-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15–17 lines × 2) rust/napi/src/astgrep.rs:212 — rust/napi/src/astgrep.rs:212-226 | rust/tools/src/astgrep.rs:295-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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) rust/providers/src/claude.rs:733 — rust/providers/src/claude.rs:733-747 | rust/providers/src/gemini.rs:366-380 | rust/providers/src/zai.rs:394-408 — before extracting anything, compare `rust/providers/src/claude.rs` and `rust/providers/src/gemini.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 3) rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:288 — rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:288-302 | rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:182-197 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:173-188 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_cpp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_ruby_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×2
  • Duplicated block (10–14 lines × 2) rust/fspec-core/src/commands/generate_scenarios.rs:405 — rust/fspec-core/src/commands/generate_scenarios.rs:405-418 | rust/fspec-core/src/commands/generate_scenarios.rs:424-433 — both copies are in the same file, so extract the block into 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–14 lines × 2) rust/fspec-core/src/types/work_unit.rs:269 — rust/fspec-core/src/types/work_unit.rs:269-278 | rust/fspec-core/src/types/work_unit.rs:532-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×2
  • Duplicated block (12–13 lines × 4) rust/agent-loop/src/agent_manager_handler.rs:699 — rust/agent-loop/src/agent_manager_handler.rs:699-710 | rust/agent-loop/src/agent_manager_handler.rs:780-792 | rust/napi/src/agent_manager_handler.rs:683-694 | rust/napi/src/agent_manager_handler.rs:764-776 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 4) rust/fspec-tui/src/views/board/menu_keys.rs:72 — rust/fspec-tui/src/views/board/menu_keys.rs:72-84 | rust/fspec-tui/src/views/board/menu_keys.rs:106-117 | rust/fspec-tui/src/views/board/menu_keys.rs:131-142 | rust/fspec-tui/src/views/board/menu_keys.rs:161-172 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×2
  • Duplicated block (13 lines × 4) rust/fspec-core/src/commands/compare_implementations.rs:129 — rust/fspec-core/src/commands/compare_implementations.rs:129-141 | rust/fspec-core/src/commands/search_implementation.rs:174-186 | rust/fspec-core/src/commands/show_test_patterns.rs:148-160 | rust/fspec-core/src/io/coverage_glob.rs:53-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
  • Duplicated block (13 lines × 4) rust/providers/src/claude.rs:740 — rust/providers/src/claude.rs:740-752 | rust/providers/src/gemini.rs:373-385 | rust/providers/src/openai.rs:572-584 | rust/providers/src/zai.rs:401-413 — before extracting anything, compare `rust/providers/src/claude.rs` and `rust/providers/src/gemini.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) rust/graph/src/ast_index.rs:281 — rust/graph/src/ast_index.rs:281-291 | rust/graph/src/ast_pipeline/mod.rs:255-267 — 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–13 lines × 2) rust/graph/src/bundle.rs:175 — rust/graph/src/bundle.rs:175-187 | rust/graph/src/bundle.rs:226-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×2
  • Duplicated block (12 lines × 7) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:117 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:117-128 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:175-186 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:166-177 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:117-128 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:136-147 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:112-123 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:138-149 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 7) rust/rpc-server/src/server.rs:317 — rust/rpc-server/src/server.rs:317-330 | rust/rpc-server/src/server.rs:344-357 | rust/rpc-server/src/server.rs:370-381 | rust/rpc-server/src/server.rs:398-411 | rust/rpc-server/src/server.rs:432-445 | rust/rpc-server/src/server.rs:465-478 | rust/rpc-server/src/server.rs:500-513 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×2
  • Duplicated block (12 lines × 6) rust/fspec/src/discover_event_storm.rs:38 — rust/fspec/src/discover_event_storm.rs:38-50 | rust/fspec/src/list_attachments.rs:76-93 | rust/fspec/src/list_virtual_hooks.rs:79-98 | rust/fspec/src/show_deleted.rs:74-92 | rust/fspec/src/show_event_storm.rs:37-48 | rust/fspec/src/show_work_unit.rs:86-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 6 call sites, so a change lands once.
  • Duplicated block (12 lines × 6) rust/graph/src/ast_pipeline/ast_c_extractor.rs:116 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:116-127 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:126-137 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:124-135 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:126-137 | rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:126-137 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:184-195 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_c_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) rust/agent-loop/src/agent_manager_handler.rs:398 — rust/agent-loop/src/agent_manager_handler.rs:398-408 | rust/agent-loop/src/agent_manager_handler.rs:440-450 | rust/napi/src/agent_manager_handler.rs:382-392 | rust/napi/src/agent_manager_handler.rs:424-434 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 4) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:776 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:776-786 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:874-884 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:359-369 | rust/graph/src/ast_pipeline/edge_helpers.rs:86-96 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` and `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×2
  • Duplicated block (9 lines × 6) rust/agent-loop/src/persist.rs:48 — rust/agent-loop/src/persist.rs:48-56 | rust/agent-loop/src/persist.rs:114-122 | rust/agent-loop/src/persist.rs:167-175 | rust/napi/src/persist.rs:41-49 | rust/napi/src/persist.rs:107-115 | rust/napi/src/persist.rs:160-168 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 6) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:238 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:238-246 | rust/fspec-core/src/commands/add_command_to_foundation.rs:159-167 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:167-175 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:208-216 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:153-161 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:156-164 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) rust/fspec-core/src/commands/add_command_to_foundation.rs:93 — rust/fspec-core/src/commands/add_command_to_foundation.rs:93-101 | rust/fspec-core/src/commands/add_domain_event.rs:159-167 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:96-104 | rust/fspec-core/src/commands/add_hotspot.rs:149-157 — before extracting anything, compare `rust/fspec-core/src/commands/add_command_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 4) rust/fspec/src/remove_example.rs:48 — rust/fspec/src/remove_example.rs:48-56 | rust/fspec/src/remove_question.rs:41-49 | rust/fspec/src/restore_example.rs:59-67 | rust/fspec/src/restore_rule.rs:59-67 — before extracting anything, compare `rust/fspec/src/remove_example.rs` and `rust/fspec/src/restore_example.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×2
  • Duplicated block (5 lines × 6) rust/fspec/src/remove_architecture_note.rs:80 — rust/fspec/src/remove_architecture_note.rs:80-84 | rust/fspec/src/remove_example.rs:93-97 | rust/fspec/src/remove_question.rs:88-92 | rust/fspec/src/remove_rule.rs:94-98 | rust/fspec/src/restore_example.rs:106-110 | rust/fspec/src/restore_rule.rs:101-105 — before extracting anything, compare `rust/fspec/src/remove_architecture_note.rs` and `rust/fspec/src/remove_example.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 6) rust/core/src/git_state.rs:98 — rust/core/src/git_state.rs:98-102 | rust/fspec-core/src/commands/checkpoint.rs:229-234 | rust/fspec-core/src/commands/cleanup_checkpoints.rs:212-217 | rust/fspec-core/src/commands/list_checkpoints.rs:199-204 | rust/fspec-core/src/commands/update_work_unit_status.rs:1198-1202 | rust/rpc/src/checkpoints.rs:243-248 — before extracting anything, compare `rust/core/src/git_state.rs` and `rust/fspec-core/src/commands/checkpoint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) rust/fspec-core/src/commands/add_attachment.rs:266 — rust/fspec-core/src/commands/add_attachment.rs:266-272 | rust/fspec-core/src/commands/add_diagram.rs:106-110 | rust/fspec-core/src/commands/add_persona.rs:139-143 | rust/fspec-core/src/commands/add_virtual_hook.rs:142-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (5 lines × 4) rust/fspec-tui/src/views/agent/multiline_input_select.rs:180 — rust/fspec-tui/src/views/agent/multiline_input_select.rs:180-184 | rust/fspec-tui/src/views/agent/scrollback_copy.rs:143-147 | rust/fspec-tui/src/views/agent/turn_modal_select.rs:194-198 | rust/fspec-tui/src/views/board/details_select.rs:194-198 — 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 (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) rust/fspec-core/src/commands/export_dependencies.rs:82 — rust/fspec-core/src/commands/export_dependencies.rs:82-89 | rust/fspec-core/src/commands/export_example_map.rs:118-125 | rust/fspec-core/src/commands/generate_summary_report.rs:220-227 | rust/fspec-core/src/commands/import_example_map.rs:165-172 | rust/providers/src/oauth/custom_oauth.rs:234-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
  • Duplicated block (8 lines × 5) rust/fspec-core/src/commands/audit_coverage.rs:76 — rust/fspec-core/src/commands/audit_coverage.rs:76-83 | rust/fspec-core/src/commands/checkpoint.rs:80-87 | rust/fspec-core/src/commands/cleanup_checkpoints.rs:84-91 | rust/fspec-core/src/commands/list_checkpoints.rs:71-83 | rust/fspec-core/src/commands/restore_checkpoint.rs:128-135 — before extracting anything, compare `rust/fspec-core/src/commands/checkpoint.rs` and `rust/fspec-core/src/commands/cleanup_checkpoints.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (11 matched lines × 2 locations) bridge/relay-endpoint.ts:163 — bridge/relay-endpoint.ts:163 · bridge/relay-server.ts:288 — the two spans are one implementation copied and then locally edited — 92 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 (11 matched lines × 2 locations) bridge/relay-server-cli.ts:22 — bridge/relay-server-cli.ts:22 · bridge/telegram-endpoint.ts:1190 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R4 · Test Coverage · No test reaches this file · ×2
  • No test reaches this file bridge/telegram-buffering.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.
  • No test reaches this file bridge/relay-server-cli.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.
D1 · Cyclomatic Complexity · codelet_fspec · ×1
  • codelet_fspec::main (cyclomatic 200) rust/fspec/src/main.rs:2401 — codelet_fspec::main has cyclomatic complexity 200 (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 · AstGrepRefactorTool · ×1
  • AstGrepRefactorTool::execute (cyclomatic 45) rust/tools/src/astgrep_refactor.rs:144 — AstGrepRefactorTool::execute 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.
D1 · Cyclomatic Complexity · SessionManager · ×1
  • SessionManager::restore_session_messages (cyclomatic 35) rust/sessions/src/handle_impl.rs:539 — SessionManager::restore_session_messages 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 · CliOutput · ×1
  • CliOutput::emit (cyclomatic 32) rust/cli/src/interactive/output.rs:403 — CliOutput::emit has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telegram-endpoint.handleStreamChunk (cyclomatic 27) · ×1
  • telegram-endpoint.handleStreamChunk (cyclomatic 27) bridge/telegram-endpoint.ts:529 — telegram-endpoint.handleStreamChunk 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 · AstGrepTool · ×1
  • AstGrepTool::execute (cyclomatic 26) rust/tools/src/astgrep.rs:175 — AstGrepTool::execute has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AstGrepTool::get_extensions (cyclomatic 27) 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 · relay-server.createRelayServer (cyclomatic 26) · ×1
  • relay-server.createRelayServer (cyclomatic 26) bridge/relay-server.ts:42 — relay-server.createRelayServer has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (handleAuth, removeFromChannel, broadcastToChannel, …). 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 · ModelSelectorView · ×1
  • ModelSelectorView::handle_key (cyclomatic 24) rust/fspec-tui/src/views/model_selector/dispatch.rs:10 — ModelSelectorView::handle_key has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BoardView · ×1
  • BoardView::handle_event (cyclomatic 23) rust/fspec-tui/src/views/board.rs:155 — BoardView::handle_event 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.
D1 · Cyclomatic Complexity · CheckpointsView · ×1
  • CheckpointsView::handle_mouse (cyclomatic 23) rust/fspec-tui/src/views/checkpoints/keys.rs:81 — CheckpointsView::handle_mouse 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 · GrepTool · ×1
  • GrepTool::execute (cyclomatic 23) rust/tools/src/grep.rs:174 — GrepTool::execute 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 · telegram-endpoint.setupTelegramBot (cyclomatic 23) · ×1
  • telegram-endpoint.setupTelegramBot (cyclomatic 23) bridge/telegram-endpoint.ts:892 — telegram-endpoint.setupTelegramBot has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to one function literal inside it that branches (line 905). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WebSearchTool · ×1
  • WebSearchTool::call (cyclomatic 21) rust/tools/src/web_search.rs:475 — WebSearchTool::call 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 · telegram-endpoint.formatForTelegram (cyclomatic 21) · ×1
  • telegram-endpoint.formatForTelegram (cyclomatic 21) bridge/telegram-endpoint.ts:395 — telegram-endpoint.formatForTelegram 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 · WorkUnit · ×1
  • WorkUnit::serialize (cyclomatic 20) rust/fspec-core/src/types/work_unit.rs:483 — WorkUnit::serialize 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 · ResumeSessionView · ×1
  • ResumeSessionView::handle_key (cyclomatic 20) rust/fspec-tui/src/views/agent/resume_session_view.rs:162 — ResumeSessionView::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.
D1 · Cyclomatic Complexity · telegram-content-chunker.getBestSplitPoint (cyclomatic 20) · ×1
  • telegram-content-chunker.getBestSplitPoint (cyclomatic 20) bridge/telegram-content-chunker.ts:329 — telegram-content-chunker.getBestSplitPoint has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkUnitSearchDialog · ×1
  • WorkUnitSearchDialog::handle_event (cyclomatic 19) rust/fspec-tui/src/components/work_unit_search_dialog.rs:155 — WorkUnitSearchDialog::handle_event 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 · codelet_rpc_server · ×1
  • codelet_rpc_server::pump::run_envelope_pump (cyclomatic 19) rust/rpc-server/src/pump.rs:231 — codelet_rpc_server::pump::run_envelope_pump 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 · LsTool · ×1
  • LsTool::call (cyclomatic 19) rust/tools/src/ls.rs:147 — LsTool::call 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 · WorkUnitsData · ×1
  • WorkUnitsData::serialize (cyclomatic 18) rust/fspec-core/src/types/work_unit.rs:81 — WorkUnitsData::serialize 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 · SearchHistoryView · ×1
  • SearchHistoryView::handle_key (cyclomatic 18) rust/fspec-tui/src/views/agent/search_history_view.rs:154 — SearchHistoryView::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.
D1 · Cyclomatic Complexity · ReadTool · ×1
  • ReadTool::call (cyclomatic 18) rust/tools/src/read.rs:273 — ReadTool::call 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 · telegram-formatting.formatForTelegram (cyclomatic 18) · ×1
  • telegram-formatting.formatForTelegram (cyclomatic 18) bridge/telegram-formatting.ts:143 — telegram-formatting.formatForTelegram 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 · MuxConfigDialog · ×1
  • MuxConfigDialog::handle_event (cyclomatic 17) rust/fspec-tui/src/components/mux_config_dialog.rs:234 — MuxConfigDialog::handle_event 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 · relay-endpoint.createRelayEndpoint (cyclomatic 17) · ×1
  • relay-endpoint.createRelayEndpoint (cyclomatic 17) bridge/relay-endpoint.ts:91 — relay-endpoint.createRelayEndpoint has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 9 function items inside it that branch (sendToRelay, startLocalServer, a function literal at line 170, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · telegram-content-chunker.findTableBoundary (cyclomatic 17) · ×1
  • telegram-content-chunker.findTableBoundary (cyclomatic 17) bridge/telegram-content-chunker.ts:272 — telegram-content-chunker.findTableBoundary 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 · BoardStore · ×1
  • BoardStore::replace_work_units (cyclomatic 16) rust/fspec-tui/src/store/board.rs:86 — BoardStore::replace_work_units 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 · MultiLineInput · ×1
  • MultiLineInput::handle_key_gated (cyclomatic 16) rust/fspec-tui/src/views/agent/multiline_input_key.rs:15 — MultiLineInput::handle_key_gated 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 · ChangedFilesView · ×1
  • ChangedFilesView::handle_mouse (cyclomatic 16) rust/fspec-tui/src/views/changed_files/mouse.rs:27 — ChangedFilesView::handle_mouse 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 · codelet_rpc_server · ×1
  • codelet_rpc_server::pump::run_envelope_pump (cognitive 51) rust/rpc-server/src/pump.rs:231 — codelet_rpc_server::pump::run_envelope_pump has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (41 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstGrepTool · ×1
  • AstGrepTool::execute (cognitive 42) rust/tools/src/astgrep.rs:175 — AstGrepTool::execute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 6 (8 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebSearchTool · ×1
  • WebSearchTool::call (cognitive 38) rust/tools/src/web_search.rs:475 — WebSearchTool::call has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 5 (9 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 · telegram-endpoint.handleStreamChunk (cognitive 38) · ×1
  • telegram-endpoint.handleStreamChunk (cognitive 38) bridge/telegram-endpoint.ts:529 — telegram-endpoint.handleStreamChunk has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 8, ternaries 1 (4 pts), error handling 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphDatabase · ×1
  • GraphDatabase::export_all_entities (cognitive 36) rust/graph/src/bundle.rs:154 — GraphDatabase::export_all_entities has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 7 (18 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChangedFilesView · ×1
  • ChangedFilesView::handle_mouse (cognitive 35) rust/fspec-tui/src/views/changed_files/mouse.rs:27 — ChangedFilesView::handle_mouse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GrepTool · ×1
  • GrepTool::execute (cognitive 35) rust/tools/src/grep.rs:174 — GrepTool::execute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (6 pts), boolean chains 2, match/switch 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telegram-endpoint.setupTelegramBot (cognitive 35) · ×1
  • telegram-endpoint.setupTelegramBot (cognitive 35) bridge/telegram-endpoint.ts:892 — telegram-endpoint.setupTelegramBot has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 10). None of this is in the body itself: all 35 points belong to one function literal inside it that branches (line 905). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CliOutput · ×1
  • CliOutput::emit (cognitive 34) rust/cli/src/interactive/output.rs:403 — CliOutput::emit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 2 (6 pts), loops 1 (4 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SearchToolFacadeWrapper · ×1
  • SearchToolFacadeWrapper::call (cognitive 33) rust/tools/src/facade/wrapper.rs:1425 — SearchToolFacadeWrapper::call has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 8 (18 pts), if/else 8 (15 pts) (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.
D2 · Cognitive Complexity · ResumeSessionView · ×1
  • ResumeSessionView::handle_mouse (cognitive 31) rust/fspec-tui/src/views/agent/resume_session_view_mouse.rs:29 — ResumeSessionView::handle_mouse has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GeminiHistoryHook · ×1
  • GeminiHistoryHook::on_completion_call (cognitive 30) rust/core/src/gemini_history_hook.rs:127 — GeminiHistoryHook::on_completion_call has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (8 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BoardStore · ×1
  • BoardStore::replace_work_units (cognitive 29) rust/fspec-tui/src/store/board.rs:86 — BoardStore::replace_work_units has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (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 · telegram-content-chunker.getBestSplitPoint (cognitive 28) · ×1
  • telegram-content-chunker.getBestSplitPoint (cognitive 28) bridge/telegram-content-chunker.ts:329 — telegram-content-chunker.getBestSplitPoint has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 9). Of this number, 27 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 · FileSearchPopup · ×1
  • FileSearchPopup::handle_mouse (cognitive 26) rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs:54 — FileSearchPopup::handle_mouse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 16). 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 · SearchHistoryView · ×1
  • SearchHistoryView::handle_mouse (cognitive 26) rust/fspec-tui/src/views/agent/search_history_view_mouse.rs:22 — SearchHistoryView::handle_mouse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 16). 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 · SlashCommandPopup · ×1
  • SlashCommandPopup::handle_mouse (cognitive 26) rust/fspec-tui/src/views/agent/slash_command_popup_mouse.rs:59 — SlashCommandPopup::handle_mouse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 16). 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 · relay-server.createRelayServer (cognitive 26) · ×1
  • relay-server.createRelayServer (cognitive 26) bridge/relay-server.ts:42 — relay-server.createRelayServer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (handleAuth, removeFromChannel, broadcastToChannel, …). 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 · LsTool · ×1
  • LsTool::call (cognitive 25) rust/tools/src/ls.rs:147 — LsTool::call has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 3, match/switch 2 (3 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.
D2 · Cognitive Complexity · WorkUnitSearchDialog · ×1
  • WorkUnitSearchDialog::handle_mouse (cognitive 24) rust/fspec-tui/src/components/work_unit_search_dialog_mouse.rs:71 — WorkUnitSearchDialog::handle_mouse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadTool · ×1
  • ReadTool::call (cognitive 24) rust/tools/src/read.rs:273 — ReadTool::call has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (9 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.
D2 · Cognitive Complexity · telegram-content-chunker.findTableBoundary (cognitive 24) · ×1
  • telegram-content-chunker.findTableBoundary (cognitive 24) bridge/telegram-content-chunker.ts:272 — telegram-content-chunker.findTableBoundary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamLoopDetector · ×1
  • StreamLoopDetector::check (cognitive 22) rust/agent-loop/src/stream_loop_detector.rs:188 — StreamLoopDetector::check has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (5 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 · WorkUnit · ×1
  • WorkUnit::serialize (cognitive 22) rust/fspec-core/src/types/work_unit.rs:483 — WorkUnit::serialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4, 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 · WorkUnitsData · ×1
  • WorkUnitsData::serialize (cognitive 21) rust/fspec-core/src/types/work_unit.rs:81 — WorkUnitsData::serialize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4, match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelSelectorView · ×1
  • ModelSelectorView::handle_mouse (cognitive 21) rust/fspec-tui/src/views/model_selector/dispatch.rs:192 — ModelSelectorView::handle_mouse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProviderSettingsView · ×1
  • ProviderSettingsView::handle_mouse (cognitive 21) rust/fspec-tui/src/views/provider_settings/mouse.rs:26 — ProviderSettingsView::handle_mouse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OAuthCallbackServer · ×1
  • OAuthCallbackServer::handle_request (cognitive 20) rust/providers/src/oauth/callback_server.rs:164 — OAuthCallbackServer::handle_request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RlcdSupervisor · ×1
  • RlcdSupervisor::ensure_ready (cognitive 19) rust/tools/src/rlcd/service.rs:257 — RlcdSupervisor::ensure_ready has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 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 · telegram-endpoint.formatForTelegram (cognitive 19) · ×1
  • telegram-endpoint.formatForTelegram (cognitive 19) bridge/telegram-endpoint.ts:395 — telegram-endpoint.formatForTelegram has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 2 (4 pts), ternaries 2 (4 pts), match/switch 1 (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 · MultiLineInput · ×1
  • MultiLineInput::handle_key_gated (cognitive 18) rust/fspec-tui/src/views/agent/multiline_input_key.rs:15 — MultiLineInput::handle_key_gated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (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 · ScrollbackList · ×1
  • ScrollbackList::trim_to_cap (cognitive 18) rust/fspec-tui/src/views/agent/scrollback_trim.rs:85 — ScrollbackList::trim_to_cap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · FileToolFacadeWrapper · ×1
  • FileToolFacadeWrapper::call (cognitive 18) rust/tools/src/facade/wrapper.rs:440 — FileToolFacadeWrapper::call has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 8 (14 pts), if/else 2 (4 pts) (nesting depth added 8). 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 · relay-endpoint.createRelayEndpoint (cognitive 18) · ×1
  • relay-endpoint.createRelayEndpoint (cognitive 18) bridge/relay-endpoint.ts:91 — relay-endpoint.createRelayEndpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 170, sendToRelay, startLocalServer, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · EnvironmentInfo · ×1
  • EnvironmentInfo::to_reminder_content (cognitive 17) rust/cli/src/session/context_gathering.rs:55 — EnvironmentInfo::to_reminder_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugCaptureManager · ×1
  • DebugCaptureManager::capture (cognitive 17) rust/common/src/debug_capture/capture.rs:16 — DebugCaptureManager::capture has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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 · StubSessionManagerHandle · ×1
  • StubSessionManagerHandle::add_supervisor (cognitive 17) rust/core/src/session_manager_handle.rs:2003 — StubSessionManagerHandle::add_supervisor 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.
D2 · Cognitive Complexity · ChainOfCommand · ×1
  • ChainOfCommand::add_supervisor (cognitive 17) rust/sessions/src/chain_of_command.rs:43 — ChainOfCommand::add_supervisor 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.
D2 · Cognitive Complexity · ConnectMcpTool · ×1
  • ConnectMcpTool::call (cognitive 17) rust/tools/src/mcp.rs:1223 — ConnectMcpTool::call has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 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.
D2 · Cognitive Complexity · Meta · ×1
  • Meta::serialize (cognitive 16) rust/fspec-core/src/types/work_unit.rs:250 — Meta::serialize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RoleDialog · ×1
  • RoleDialog::handle_event (cognitive 16) rust/fspec-tui/src/components/role_dialog.rs:144 — RoleDialog::handle_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 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 · SessionWorktreesDialog · ×1
  • SessionWorktreesDialog::handle_event (cognitive 16) rust/fspec-tui/src/views/agent/session_worktrees_dialog_dispatch.rs:44 — SessionWorktreesDialog::handle_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (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.
D22 · Internal API Consistency · Duplicate token counting functionality exposed at both the type level (TokenEstimator) and the module level (token_estimator). The module-level function appears to be a static wrapper or duplicate of the type's method, creating confusion on which entry point to use. · ×1
  • Duplicate token counting functionality exposed at both the type level (TokenEstimator) and the module level (token_estimator). The module-level function appears to be a static wrapper or duplicate of the type's method, creating confusion on which entry point to use. — Remove the module-level `token_estimator.count_tokens` function and rely solely on the `TokenEstimator` type, or vice versa, to provide a single source of truth for token estimation. (signatures: TokenEstimator.count_tokens(text: str): usize | token_estimator.count_tokens(text: str): usize)
D22 · Internal API Consistency · Two methods with nearly identical names and signatures (`set_debug_directory` vs `set_debug_directory_raw`) suggest an internal implementation detail (e.g., raw vs validated path) leaked into the public API. This forces users to guess the semantic difference between 'directory' and 'raw directory'. · ×1
  • Two methods with nearly identical names and signatures (`set_debug_directory` vs `set_debug_directory_raw`) suggest an internal implementation detail (e.g., raw vs validated path) leaked into the public API. This forces users to guess the semantic difference between 'directory' and 'raw directory'. — Consolidate into a single `set_debug_directory` method. If validation is required, perform it internally; if raw paths are needed for specific edge cases, rename to something more descriptive like `set_debug_directory_unchecked` or handle path resolution consistently. (signatures: DebugCaptureManager.set_debug_directory(base_dir: PathBuf): Result | DebugCaptureManager.set_debug_directory_raw(dir: PathBuf): Result)
D22 · Internal API Consistency · Two methods for signaling completion · ×1
  • Two methods for signaling completion: one generic and one specific. This creates an inconsistent API where the caller must decide whether to pass a stop reason or not, rather than having a single `emit_done` that accepts an optional reason. — Unify into a single method `emit_done(stop_reason: Option<String>)` or `emit_done(stop_reason: String)` with a default empty string, removing the need for two separate entry points. (signatures: StreamOutput.emit_done() | StreamOutput.emit_done_with_stop_reason(stop_reason: String))
D22 · Internal API Consistency · Inconsistent provider management. `switch_provider` changes the provider on an existing session instance, while `from_provider_manager` appears to be a constructor/factory method that creates a new session or re-initializes it. The distinction between 'switching' and 'creating from manager' is unclear and potentially redundant if the manager is the source of truth. · ×1
  • Inconsistent provider management. `switch_provider` changes the provider on an existing session instance, while `from_provider_manager` appears to be a constructor/factory method that creates a new session or re-initializes it. The distinction between 'switching' and 'creating from manager' is unclear and potentially redundant if the manager is the source of truth. — Clarify the lifecycle. If `from_provider_manager` is a constructor, ensure it's distinct from mutation methods. If `switch_provider` is the primary way to change providers, ensure `from_provider_manager` isn't a confusing alternative path to the same state. (signatures: Session.switch_provider(provider_name: str): Result | Session.from_provider_manager(provider_manager: ProviderManager): Self)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 29 shared lines) · ×1
  • Near-duplicate member family (5 members, 29 shared lines) rust/fspec-tui/src/views/changed_files/render.rs:125 — rust/fspec-tui/src/views/changed_files/render.rs:125-159 | rust/fspec-tui/src/views/changed_files/render.rs:167-200 | rust/fspec-tui/src/views/checkpoints/render.rs:146-180 | rust/fspec-tui/src/views/checkpoints/render.rs:211-245 | rust/fspec-tui/src/views/checkpoints/render.rs:253-286 — These 5 members are variants of one another: a block of 29 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 46 shared lines) · ×1
  • Near-duplicate member family (4 members, 46 shared lines) rust/agent-loop/src/agent_manager_handler.rs:656 — rust/agent-loop/src/agent_manager_handler.rs:656-722 | rust/agent-loop/src/agent_manager_handler.rs:725-805 | rust/napi/src/agent_manager_handler.rs:640-706 | rust/napi/src/agent_manager_handler.rs:709-789 — These 4 members are variants of one another: a block of 46 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 30 shared lines) · ×1
  • Near-duplicate member family (4 members, 30 shared lines) rust/graph/src/ast_pipeline/ast_go_extractor.rs:40 — rust/graph/src/ast_pipeline/ast_go_extractor.rs:40-89 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:39-88 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:58-105 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:106-155 — These 4 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 26 shared lines) · ×1
  • Near-duplicate member family (4 members, 26 shared lines) rust/fspec-core/src/commands/add_command_to_foundation.rs:59 — rust/fspec-core/src/commands/add_command_to_foundation.rs:59-171 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:62-179 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:50-165 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:53-168 — These 4 members are variants of one another: a block of 26 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 9 shared lines) · ×1
  • Near-duplicate member family (4 members, 9 shared lines) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:71 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:71-250 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:77-220 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:50-165 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:53-168 — These 4 members are variants of one another: a block of 9 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 49 shared lines) · ×1
  • Near-duplicate member family (3 members, 49 shared lines) rust/fspec-core/src/commands/add_command_to_foundation.rs:59 — rust/fspec-core/src/commands/add_command_to_foundation.rs:59-171 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:62-179 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:73-158 — These 3 members are variants of one another: a block of 49 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 31 shared lines) · ×1
  • Near-duplicate member family (3 members, 31 shared lines) rust/fspec-core/src/commands/remove_question.rs:107 — rust/fspec-core/src/commands/remove_question.rs:107-234 | rust/fspec-core/src/commands/restore_architecture_note.rs:61-193 | rust/fspec-core/src/commands/restore_question.rs:58-187 — These 3 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 24 shared lines) · ×1
  • Near-duplicate member family (3 members, 24 shared lines) rust/graph/src/ast_pipeline/ast_java_extractor.rs:418 — rust/graph/src/ast_pipeline/ast_java_extractor.rs:418-528 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:430-478 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:468-510 — These 3 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 17 shared lines) · ×1
  • Near-duplicate member family (3 members, 17 shared lines) rust/fspec-core/src/commands/add_domain_event.rs:70 — rust/fspec-core/src/commands/add_domain_event.rs:70-235 | rust/fspec-core/src/commands/add_hotspot.rs:73-208 | rust/fspec-core/src/commands/add_policy.rs:79-236 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (230 shared lines) · ×1
  • Near-duplicate member pair (230 shared lines) rust/agent-loop/src/background_output.rs:309 — rust/agent-loop/src/background_output.rs:309-599 | rust/napi/src/agent_loop.rs:1548-1820 — These two members are variants of one another: 230 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 (127 shared lines) · ×1
  • Near-duplicate member pair (127 shared lines) rust/agent-loop/src/deep_search_handler.rs:131 — rust/agent-loop/src/deep_search_handler.rs:131-264 | rust/napi/src/deep_search_handler.rs:131-262 — These two members are variants of one another: 127 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 (106 shared lines) · ×1
  • Near-duplicate member pair (106 shared lines) rust/napi/src/session_bindings.rs:2734 — rust/napi/src/session_bindings.rs:2734-2931 | rust/sessions/src/handle_impl.rs:543-750 — These two members are variants of one another: 106 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 (95 shared lines) · ×1
  • Near-duplicate member pair (95 shared lines) rust/fspec-core/src/commands/add_aggregate.rs:74 — rust/fspec-core/src/commands/add_aggregate.rs:74-220 | rust/fspec-core/src/commands/add_command.rs:69-208 — These two members are variants of one another: 95 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 (84 shared lines) · ×1
  • Near-duplicate member pair (84 shared lines) rust/napi/src/session_bindings.rs:1959 — rust/napi/src/session_bindings.rs:1959-2090 | rust/napi/src/session_bindings.rs:2124-2280 — These two members are variants of one another: 84 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 (67 shared lines) · ×1
  • Near-duplicate member pair (67 shared lines) rust/fspec-core/src/commands/remove_example.rs:102 — rust/fspec-core/src/commands/remove_example.rs:102-230 | rust/fspec-core/src/commands/restore_example.rs:104-233 — These two members are variants of one another: 67 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 (65 shared lines) · ×1
  • Near-duplicate member pair (65 shared lines) rust/fspec-core/src/commands/link_coverage.rs:590 — rust/fspec-core/src/commands/link_coverage.rs:590-684 | rust/fspec-core/src/commands/unlink_coverage.rs:289-378 — These two members are variants of one another: 65 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 (60 shared lines) · ×1
  • Near-duplicate member pair (60 shared lines) rust/fspec-core/src/commands/delete_scenario.rs:45 — rust/fspec-core/src/commands/delete_scenario.rs:45-196 | rust/fspec-core/src/commands/delete_step.rs:45-157 — These two members are variants of one another: 60 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (47 shared lines) · ×1
  • Near-duplicate member pair (47 shared lines) rust/sessions/src/session_manager.rs:721 — rust/sessions/src/session_manager.rs:721-904 | rust/sessions/src/session_manager.rs:916-1090 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) rust/fspec-core/src/commands/delete_scenario.rs:245 — rust/fspec-core/src/commands/delete_scenario.rs:245-303 | rust/fspec-core/src/commands/delete_scenarios.rs:335-384 — These two members are variants of one another: 39 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 (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) rust/fspec-core/src/commands/add_question.rs:80 — rust/fspec-core/src/commands/add_question.rs:80-177 | rust/fspec-core/src/commands/add_rule.rs:67-159 — These two members are variants of one another: 37 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 (32 shared lines) · ×1
  • Near-duplicate member pair (32 shared lines) rust/fspec/src/add_bounded_context.rs:60 — rust/fspec/src/add_bounded_context.rs:60-114 | rust/fspec/src/add_external_system.rs:61-115 — These two members are variants of one another: 32 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 (24 shared lines) · ×1
  • Near-duplicate member pair (24 shared lines) rust/fspec/src/add_domain_event.rs:54 — rust/fspec/src/add_domain_event.rs:54-93 | rust/fspec/src/add_hotspot.rs:54-95 — These two members are variants of one another: 24 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 (22 shared lines) · ×1
  • Near-duplicate member pair (22 shared lines) rust/graph/src/ast_pipeline/composer_dep_extractor.rs:13 — rust/graph/src/ast_pipeline/composer_dep_extractor.rs:13-57 | rust/graph/src/ast_pipeline/npm_dep_extractor.rs:17-58 — These two members are variants of one another: 22 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (108 corresponding lines) · ×1
  • Edited copy of a member (108 corresponding lines) rust/fspec-core/src/commands/add_bounded_context.rs:125 — rust/fspec-core/src/commands/add_bounded_context.rs:125-232 | rust/fspec-core/src/commands/add_external_system.rs:126-233 — 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 (231 corresponding lines) · ×1
  • Edited copy of a member (231 corresponding lines) rust/agent-loop/src/deep_search_handler.rs:457 — rust/agent-loop/src/deep_search_handler.rs:457-687 | rust/napi/src/deep_search_handler.rs:445-675 — These two members are one piece of code written twice and then edited apart: 231 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) rust/agent-loop/src/session_search_handler.rs:520 — rust/agent-loop/src/session_search_handler.rs:520-576 | rust/napi/src/session_search_handler.rs:520-576 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) rust/fspec-tui/src/components/work_unit_search_rows.rs:54 — rust/fspec-tui/src/components/work_unit_search_rows.rs:54-108 | rust/fspec-tui/src/views/agent/file_search_popup_rows.rs:24-83 — 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 (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) rust/fspec-tui/src/views/provider_settings/profiles_config.rs:29 — rust/fspec-tui/src/views/provider_settings/profiles_config.rs:29-66 | rust/fspec-tui/src/views/provider_settings/profiles_config.rs:230-262 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) rust/fspec-core/src/commands/link_coverage/step.rs:392 — rust/fspec-core/src/commands/link_coverage/step.rs:392-412 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:616-635 — 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 (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) rust/git/src/ghost_commit.rs:357 — rust/git/src/ghost_commit.rs:357-385 | rust/git/src/repo_ops.rs:235-365 — 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 (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) rust/tools/src/pdf.rs:107 — rust/tools/src/pdf.rs:107-149 | rust/tools/src/pdf.rs:329-418 — 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 (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) rust/fspec-core/src/commands/review.rs:708 — rust/fspec-core/src/commands/review.rs:708-730 | rust/fspec-core/src/commands/show_work_unit.rs:440-478 — 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 · Members sharing a duplicated core (17 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (17 members, 50+ identical tokens) rust/fspec/src/add_architecture_note.rs:39 — rust/fspec/src/add_architecture_note.rs:39-67 | rust/fspec/src/add_attachment.rs:44-74 | rust/fspec/src/add_example.rs:38-67 | rust/fspec/src/compact_work_unit.rs:54-76 | rust/fspec/src/create_epic.rs:47-84 | rust/fspec/src/delete_epic.rs:58-91 | rust/fspec/src/delete_tag.rs:47-78 | rust/fspec/src/delete_work_unit.rs:49-75 | rust/fspec/src/register_tag.rs:52-86 | rust/fspec/src/remove_architecture_note.rs:43-66 | rust/fspec/src/remove_attachment.rs:45-75 | rust/fspec/src/remove_example.rs:47-73 | rust/fspec/src/restore_example.rs:58-84 | rust/fspec/src/restore_rule.rs:58-82 | rust/fspec/src/set_user_story.rs:50-81 | rust/fspec/src/update_tag.rs:47-83 | rust/fspec/src/update_work_unit_status.rs:48-82 — These 17 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 17 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 17 times.
D4 · Code Duplication · Members sharing a duplicated core (15 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (15 members, 50+ identical tokens) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:92 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:92-139 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:147-202 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:263-294 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:305-332 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:101-149 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:388-426 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:443-509 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:100-147 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:157-213 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:305-359 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:372-409 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:198-250 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:102-149 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:323-367 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:381-421 — These 15 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 15 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 15 times.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) rust/fspec-tui/src/app/dispatch_merge_worktree.rs:45 — rust/fspec-tui/src/app/dispatch_merge_worktree.rs:45-72 | rust/fspec-tui/src/app/dispatch_merge_worktree.rs:116-139 | rust/fspec-tui/src/app/dispatch_merge_worktree.rs:145-161 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:60-81 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:83-101 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:103-122 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:93-111 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:113-131 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:133-151 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:153-171 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:173-191 — These 11 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 11 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 11 times.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) rust/tools/src/facade/wrapper.rs:101 — rust/tools/src/facade/wrapper.rs:101-165 | rust/tools/src/facade/wrapper.rs:253-295 | rust/tools/src/facade/wrapper.rs:440-616 | rust/tools/src/facade/wrapper.rs:1138-1216 | rust/tools/src/facade/wrapper.rs:1286-1338 | rust/tools/src/facade/wrapper.rs:1425-1556 | rust/tools/src/facade/wrapper.rs:1642-1713 | rust/tools/src/facade/wrapper.rs:1840-1886 | rust/tools/src/facade/wrapper.rs:2058-2111 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Duplicated block (257 lines × 2) · ×1
  • Duplicated block (257 lines × 2) rust/agent-loop/src/graph_search_handler.rs:45 — rust/agent-loop/src/graph_search_handler.rs:45-301 | rust/napi/src/graph_search_handler.rs:45-301 — before extracting anything, compare `rust/agent-loop/src/graph_search_handler.rs` and `rust/napi/src/graph_search_handler.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (224 lines × 2) · ×1
  • Duplicated block (224 lines × 2) rust/agent-loop/src/stream_chunk_json.rs:17 — rust/agent-loop/src/stream_chunk_json.rs:17-240 | rust/napi/src/types.rs:160-383 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (192 lines × 2) · ×1
  • Duplicated block (192 lines × 2) rust/agent-loop/src/deep_search_handler.rs:496 — rust/agent-loop/src/deep_search_handler.rs:496-687 | rust/napi/src/deep_search_handler.rs:484-675 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (176–186 lines × 2) · ×1
  • Duplicated block (176–186 lines × 2) rust/agent-loop/src/agent_loop.rs:348 — rust/agent-loop/src/agent_loop.rs:348-533 | rust/napi/src/agent_loop.rs:437-612 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (153–160 lines × 2) · ×1
  • Duplicated block (153–160 lines × 2) rust/agent-loop/src/background_output.rs:337 — rust/agent-loop/src/background_output.rs:337-489 | rust/napi/src/agent_loop.rs:1567-1726 — before extracting anything, compare `rust/agent-loop/src/background_output.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 267 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (150 lines × 2) · ×1
  • Duplicated block (150 lines × 2) rust/agent-loop/src/session_search_handler.rs:156 — rust/agent-loop/src/session_search_handler.rs:156-305 | rust/napi/src/session_search_handler.rs:156-305 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (125 lines × 2) · ×1
  • Duplicated block (125 lines × 2) rust/agent-loop/src/agent_loop.rs:998 — rust/agent-loop/src/agent_loop.rs:998-1122 | rust/napi/src/agent_loop.rs:968-1092 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (107 lines × 2) · ×1
  • Duplicated block (107 lines × 2) rust/agent-loop/src/session_search_handler.rs:321 — rust/agent-loop/src/session_search_handler.rs:321-427 | rust/napi/src/session_search_handler.rs:321-427 — before extracting anything, compare `rust/agent-loop/src/session_search_handler.rs` and `rust/napi/src/session_search_handler.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 517 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (92 lines × 2) · ×1
  • Duplicated block (92 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:151 — rust/agent-loop/src/agent_manager_handler.rs:151-242 | rust/napi/src/agent_manager_handler.rs:136-227 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (72–76 lines × 2) · ×1
  • Duplicated block (72–76 lines × 2) rust/agent-loop/src/agent_loop.rs:680 — rust/agent-loop/src/agent_loop.rs:680-751 | rust/napi/src/agent_loop.rs:681-756 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (72–75 lines × 2) · ×1
  • Duplicated block (72–75 lines × 2) rust/tools/src/mcp.rs:411 — rust/tools/src/mcp.rs:411-485 | rust/tools/src/mcp.rs:707-778 — both copies are in the same file, so extract the 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 (71 lines × 2) · ×1
  • Duplicated block (71 lines × 2) rust/agent-loop/src/agent_loop.rs:273 — rust/agent-loop/src/agent_loop.rs:273-343 | rust/napi/src/agent_loop.rs:360-430 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:184 — rust/fspec-core/src/commands/link_coverage/step.rs:184-252 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:402-470 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (68 lines × 2) · ×1
  • Duplicated block (68 lines × 2) rust/agent-loop/src/agent_loop.rs:1436 — rust/agent-loop/src/agent_loop.rs:1436-1503 | rust/napi/src/agent_loop.rs:1312-1379 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (56–68 lines × 2) · ×1
  • Duplicated block (56–68 lines × 2) rust/agent-loop/src/inject_summary_handler.rs:249 — rust/agent-loop/src/inject_summary_handler.rs:249-304 | rust/napi/src/inject_summary_handler.rs:283-350 — before extracting anything, compare `rust/agent-loop/src/inject_summary_handler.rs` and `rust/napi/src/inject_summary_handler.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (61 lines × 2) · ×1
  • Duplicated block (61 lines × 2) rust/agent-loop/src/deep_search_handler.rs:133 — rust/agent-loop/src/deep_search_handler.rs:133-193 | rust/napi/src/deep_search_handler.rs:133-193 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (59 lines × 2) · ×1
  • Duplicated block (59 lines × 2) rust/agent-loop/src/agent_loop.rs:800 — rust/agent-loop/src/agent_loop.rs:800-858 | rust/napi/src/agent_loop.rs:772-830 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (52–57 lines × 2) · ×1
  • Duplicated block (52–57 lines × 2) rust/fspec-core/src/commands/add_scenario.rs:62 — rust/fspec-core/src/commands/add_scenario.rs:62-118 | rust/fspec-core/src/commands/add_step.rs:84-135 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/add_step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) rust/agent-loop/src/deep_search_handler.rs:374 — rust/agent-loop/src/deep_search_handler.rs:374-426 | rust/napi/src/deep_search_handler.rs:362-414 — before extracting anything, compare `rust/agent-loop/src/deep_search_handler.rs` and `rust/napi/src/deep_search_handler.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 445 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (41–51 lines × 2) · ×1
  • Duplicated block (41–51 lines × 2) rust/agent-loop/src/agent_loop.rs:1378 — rust/agent-loop/src/agent_loop.rs:1378-1428 | rust/napi/src/agent_loop.rs:1263-1303 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (48–49 lines × 2) · ×1
  • Duplicated block (48–49 lines × 2) rust/agent-loop/src/background_output.rs:552 — rust/agent-loop/src/background_output.rs:552-599 | rust/napi/src/agent_loop.rs:1772-1820 — before extracting anything, compare `rust/agent-loop/src/background_output.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 267 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) rust/agent-loop/src/persist.rs:147 — rust/agent-loop/src/persist.rs:147-195 | rust/napi/src/persist.rs:140-188 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:562 — rust/agent-loop/src/agent_manager_handler.rs:562-609 | rust/napi/src/agent_manager_handler.rs:546-593 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) rust/fspec-core/src/commands/link_coverage/step.rs:317 — rust/fspec-core/src/commands/link_coverage/step.rs:317-363 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:539-585 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage/step.rs` and `rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 390 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (43–44 lines × 2) · ×1
  • Duplicated block (43–44 lines × 2) rust/agent-loop/src/agent_loop.rs:137 — rust/agent-loop/src/agent_loop.rs:137-180 | rust/napi/src/agent_loop.rs:231-273 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (32–44 lines × 2) · ×1
  • Duplicated block (32–44 lines × 2) rust/fspec-core/src/commands/list_feature_tags.rs:226 — rust/fspec-core/src/commands/list_feature_tags.rs:226-269 | rust/fspec-core/src/commands/tag_stats.rs:354-385 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (29–43 lines × 2) · ×1
  • Duplicated block (29–43 lines × 2) rust/agent-loop/src/agent_loop.rs:570 — rust/agent-loop/src/agent_loop.rs:570-612 | rust/napi/src/agent_loop.rs:615-643 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (39–43 lines × 2) · ×1
  • Duplicated block (39–43 lines × 2) rust/agent-loop/src/agent_loop.rs:1332 — rust/agent-loop/src/agent_loop.rs:1332-1370 | rust/napi/src/agent_loop.rs:1220-1262 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) rust/agent-loop/src/persist.rs:261 — rust/agent-loop/src/persist.rs:261-303 | rust/napi/src/persist.rs:254-296 — before extracting anything, compare `rust/agent-loop/src/persist.rs` and `rust/napi/src/persist.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (42–43 lines × 2) · ×1
  • Duplicated block (42–43 lines × 2) rust/fspec-core/src/commands/show_acceptance_criteria.rs:429 — rust/fspec-core/src/commands/show_acceptance_criteria.rs:429-470 | rust/fspec-core/src/io/gherkin_format.rs:152-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (38–40 lines × 2) · ×1
  • Duplicated block (38–40 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:263 — rust/agent-loop/src/agent_manager_handler.rs:263-302 | rust/napi/src/agent_manager_handler.rs:248-285 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:425 — rust/agent-loop/src/agent_manager_handler.rs:425-464 | rust/napi/src/agent_manager_handler.rs:409-448 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (37–40 lines × 2) · ×1
  • Duplicated block (37–40 lines × 2) rust/napi/src/session_bindings.rs:2761 — rust/napi/src/session_bindings.rs:2761-2800 | rust/sessions/src/handle_impl.rs:582-618 — before extracting anything, compare `rust/napi/src/session_bindings.rs` and `rust/sessions/src/handle_impl.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) rust/napi/src/session_bindings.rs:1974 — rust/napi/src/session_bindings.rs:1974-2012 | rust/napi/src/session_bindings.rs:2138-2175 — both copies are in the same file, so extract the 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 (37–39 lines × 2) · ×1
  • Duplicated block (37–39 lines × 2) rust/tools/src/bridge.rs:259 — rust/tools/src/bridge.rs:259-295 | rust/tools/src/facade/bridge_facade.rs:67-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (29–38 lines × 2) · ×1
  • Duplicated block (29–38 lines × 2) rust/agent-loop/src/thinking_config.rs:89 — rust/agent-loop/src/thinking_config.rs:89-117 | rust/napi/src/thinking_config.rs:125-162 — before extracting anything, compare `rust/agent-loop/src/thinking_config.rs` and `rust/napi/src/thinking_config.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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) rust/core/src/persistence/messages.rs:255 — rust/core/src/persistence/messages.rs:255-292 | rust/core/src/persistence/messages.rs:343-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:389 — rust/fspec-core/src/commands/add_dependencies.rs:389-425 | rust/fspec-core/src/commands/add_dependency.rs:327-363 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (35 lines × 3) · ×1
  • Duplicated block (35 lines × 3) rust/fspec-core/src/commands/delete_tag.rs:331 — rust/fspec-core/src/commands/delete_tag.rs:331-365 | rust/fspec-core/src/commands/register_tag.rs:288-322 | rust/fspec-core/src/commands/update_tag.rs:256-290 — before extracting anything, compare `rust/fspec-core/src/commands/delete_tag.rs` and `rust/fspec-core/src/commands/update_tag.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (34 lines × 4) · ×1
  • Duplicated block (34 lines × 4) rust/agent-loop/src/agent_manager_handler.rs:660 — rust/agent-loop/src/agent_manager_handler.rs:660-693 | rust/agent-loop/src/agent_manager_handler.rs:743-776 | rust/napi/src/agent_manager_handler.rs:644-677 | rust/napi/src/agent_manager_handler.rs:727-760 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs:64 — rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs:64-97 | rust/fspec-tui/src/views/agent/slash_command_popup_mouse.rs:69-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (31–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) rust/agent-loop/src/inject_summary_handler.rs:206 — rust/agent-loop/src/inject_summary_handler.rs:206-236 | rust/napi/src/inject_summary_handler.rs:237-269 — before extracting anything, compare `rust/agent-loop/src/inject_summary_handler.rs` and `rust/napi/src/inject_summary_handler.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) rust/tools/src/facade/codex.rs:771 — rust/tools/src/facade/codex.rs:771-803 | rust/tools/src/request_user_input.rs:269-301 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) rust/agent-loop/src/agent_manager_handler.rs:472 — rust/agent-loop/src/agent_manager_handler.rs:472-503 | rust/napi/src/agent_manager_handler.rs:456-487 — before extracting anything, compare `rust/agent-loop/src/agent_manager_handler.rs` and `rust/napi/src/agent_manager_handler.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 799 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (30–31 lines × 3) · ×1
  • Duplicated block (30–31 lines × 3) rust/fspec/src/create_bug.rs:70 — rust/fspec/src/create_bug.rs:70-99 | rust/fspec/src/create_story.rs:70-100 | rust/fspec/src/create_task.rs:70-99 — before extracting anything, compare `rust/fspec/src/create_bug.rs` and `rust/fspec/src/create_story.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (25–30 lines × 3) · ×1
  • Duplicated block (25–30 lines × 3) rust/fspec-core/src/commands/generate_scenarios.rs:877 — rust/fspec-core/src/commands/generate_scenarios.rs:877-906 | rust/fspec-core/src/commands/link_coverage/step.rs:351-375 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:573-597 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/link_coverage/step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (30 lines × 3) · ×1
  • Duplicated block (30 lines × 3) rust/graph/src/ast_pipeline/ast_python_extractor.rs:54 — rust/graph/src/ast_pipeline/ast_python_extractor.rs:54-83 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:71-100 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:121-150 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_python_extractor.rs` and `rust/graph/src/ast_pipeline/ast_rust_extractor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22–29 lines × 3) · ×1
  • Duplicated block (22–29 lines × 3) rust/fspec/src/list_attachments.rs:76 — rust/fspec/src/list_attachments.rs:76-103 | rust/fspec/src/show_event_storm.rs:37-58 | rust/fspec/src/show_work_unit.rs:86-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (22–28 lines × 2) · ×1
  • Duplicated block (22–28 lines × 2) rust/fspec-core/src/commands/delete_scenario.rs:261 — rust/fspec-core/src/commands/delete_scenario.rs:261-288 | rust/fspec-core/src/commands/delete_scenarios.rs:349-370 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) rust/napi/src/session_bindings.rs:2834 — rust/napi/src/session_bindings.rs:2834-2860 | rust/sessions/src/handle_impl.rs:647-672 — before extracting anything, compare `rust/napi/src/session_bindings.rs` and `rust/sessions/src/handle_impl.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–26 lines × 4) · ×1
  • Duplicated block (21–26 lines × 4) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:59 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:59-79 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:60-85 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:101-126 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:62-87 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) rust/agent-loop/src/agent_loop.rs:923 — rust/agent-loop/src/agent_loop.rs:923-946 | rust/napi/src/agent_loop.rs:893-916 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17–24 lines × 2) · ×1
  • Duplicated block (17–24 lines × 2) rust/fspec-core/src/commands/link_coverage.rs:622 — rust/fspec-core/src/commands/link_coverage.rs:622-638 | rust/fspec-core/src/commands/unlink_coverage.rs:320-343 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) rust/fspec/src/clear_virtual_hooks.rs:59 — rust/fspec/src/clear_virtual_hooks.rs:59-82 | rust/fspec/src/copy_virtual_hooks.rs:75-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) rust/git/src/ghost_commit.rs:358 — rust/git/src/ghost_commit.rs:358-381 | rust/git/src/repo_ops.rs:259-281 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (20–24 lines × 2) · ×1
  • Duplicated block (20–24 lines × 2) rust/providers/src/manager.rs:311 — rust/providers/src/manager.rs:311-330 | rust/providers/src/manager.rs:358-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–23 lines × 3) · ×1
  • Duplicated block (20–23 lines × 3) rust/fspec-core/src/commands/add_command_to_foundation.rs:74 — rust/fspec-core/src/commands/add_command_to_foundation.rs:74-96 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:77-99 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:87-106 — before extracting anything, compare `rust/fspec-core/src/commands/add_command_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) rust/cli/src/interactive/stream_loop.rs:1411 — rust/cli/src/interactive/stream_loop.rs:1411-1433 | rust/cli/src/interactive/stream_loop.rs:1672-1692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) rust/fspec-core/src/commands/link_coverage.rs:664 — rust/fspec-core/src/commands/link_coverage.rs:664-683 | rust/fspec-core/src/commands/unlink_coverage.rs:353-375 — before extracting anything, compare `rust/fspec-core/src/commands/link_coverage.rs` and `rust/fspec-core/src/commands/unlink_coverage.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (3–22 lines × 7) · ×1
  • Duplicated block (3–22 lines × 7) rust/core/src/git_state.rs:80 — rust/core/src/git_state.rs:80-95 | rust/fspec-core/src/commands/checkpoint.rs:209-226 | rust/fspec-core/src/commands/cleanup_checkpoints.rs:192-209 | rust/fspec-core/src/commands/list_checkpoints.rs:175-196 | rust/fspec-core/src/commands/update_work_unit_status.rs:1194-1196 | rust/fspec/src/common.rs:388-390 | rust/rpc/src/checkpoints.rs:223-240 — before extracting anything, compare `rust/core/src/git_state.rs` and `rust/fspec-core/src/commands/checkpoint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–22 lines × 4) · ×1
  • Duplicated block (21–22 lines × 4) rust/agent-loop/src/agent_loop.rs:1255 — rust/agent-loop/src/agent_loop.rs:1255-1275 | rust/agent-loop/src/agent_loop.rs:1322-1343 | rust/napi/src/agent_loop.rs:1085-1106 | rust/napi/src/agent_loop.rs:1210-1231 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22 lines × 4) · ×1
  • Duplicated block (22 lines × 4) rust/fspec/src/add_command_to_foundation.rs:60 — rust/fspec/src/add_command_to_foundation.rs:60-81 | rust/fspec/src/add_domain_event_to_foundation.rs:60-81 | rust/fspec/src/remove_command_from_foundation.rs:55-76 | rust/fspec/src/remove_domain_event_from_foundation.rs:55-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (19–22 lines × 3) · ×1
  • Duplicated block (19–22 lines × 3) rust/providers/src/claude_oauth_server.rs:202 — rust/providers/src/claude_oauth_server.rs:202-220 | rust/providers/src/codex/codex_oauth_server.rs:221-242 | rust/providers/src/oauth/callback_server.rs:143-161 — before extracting anything, compare `rust/providers/src/codex/codex_oauth_server.rs` and `rust/providers/src/oauth/callback_server.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) rust/sessions/src/session_manager.rs:747 — rust/sessions/src/session_manager.rs:747-766 | rust/sessions/src/session_manager.rs:937-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–21 lines × 4) · ×1
  • Duplicated block (17–21 lines × 4) rust/fspec-core/src/commands/add_scenario.rs:211 — rust/fspec-core/src/commands/add_scenario.rs:211-231 | rust/fspec-core/src/commands/add_step.rs:309-329 | rust/fspec-core/src/commands/update_scenario.rs:198-218 | rust/fspec-core/src/commands/update_step.rs:203-219 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/add_step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) rust/agent-loop/src/inject_summary_handler.rs:180 — rust/agent-loop/src/inject_summary_handler.rs:180-199 | rust/napi/src/inject_summary_handler.rs:204-224 — before extracting anything, compare `rust/agent-loop/src/inject_summary_handler.rs` and `rust/napi/src/inject_summary_handler.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) rust/git/src/ghost_commit.rs:271 — rust/git/src/ghost_commit.rs:271-291 | rust/git/src/repo_ops.rs:288-304 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) rust/sessions/src/default_thinking_level_persistence.rs:67 — rust/sessions/src/default_thinking_level_persistence.rs:67-87 | rust/sessions/src/mux_config_persistence.rs:62-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (20 lines × 8) · ×1
  • Duplicated block (20 lines × 8) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:302 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:302-321 | rust/fspec-core/src/commands/add_command_to_foundation.rs:189-208 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:198-217 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:182-201 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:231-250 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:175-194 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:178-197 | rust/fspec-core/src/commands/remove_foundation_bounded_context.rs:199-218 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) rust/fspec-tui/src/views/changed_files/render.rs:140 — rust/fspec-tui/src/views/changed_files/render.rs:140-159 | rust/fspec-tui/src/views/changed_files/render.rs:181-200 | rust/fspec-tui/src/views/checkpoints/render.rs:161-180 | rust/fspec-tui/src/views/checkpoints/render.rs:226-245 | rust/fspec-tui/src/views/checkpoints/render.rs:267-286 — `rust/fspec-tui/src/views/changed_files/render.rs` and `rust/fspec-tui/src/views/checkpoints/render.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 7 separate duplicated blocks between them, totalling at least 102 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 (14–20 lines × 2) · ×1
  • Duplicated block (14–20 lines × 2) rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:75 — rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:75-94 | rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs:81-94 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate_to_foundation.rs` and `rust/fspec-core/src/commands/remove_aggregate_from_foundation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) rust/napi/src/session_bindings.rs:2874 — rust/napi/src/session_bindings.rs:2874-2893 | rust/sessions/src/handle_impl.rs:686-702 — before extracting anything, compare `rust/napi/src/session_bindings.rs` and `rust/sessions/src/handle_impl.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–19 lines × 5) · ×1
  • Duplicated block (18–19 lines × 5) rust/fspec-core/src/commands/remove_architecture_note.rs:80 — rust/fspec-core/src/commands/remove_architecture_note.rs:80-97 | rust/fspec-core/src/commands/remove_example.rs:83-100 | rust/fspec-core/src/commands/remove_question.rs:76-93 | rust/fspec-core/src/commands/remove_rule.rs:62-80 | rust/fspec-core/src/commands/restore_example.rs:85-102 — before extracting anything, compare `rust/fspec-core/src/commands/remove_example.rs` and `rust/fspec-core/src/commands/remove_question.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–19 lines × 5) · ×1
  • Duplicated block (14–19 lines × 5) rust/fspec/src/add_architecture.rs:56 — rust/fspec/src/add_architecture.rs:56-69 | rust/fspec/src/add_background.rs:55-68 | rust/fspec/src/delete_scenario.rs:56-69 | rust/fspec/src/delete_step.rs:55-68 | rust/fspec/src/remove_tag_from_feature.rs:56-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18–19 lines × 4) · ×1
  • Duplicated block (18–19 lines × 4) rust/fspec-core/src/commands/add_scenario.rs:236 — rust/fspec-core/src/commands/add_scenario.rs:236-254 | rust/fspec-core/src/commands/add_step.rs:334-352 | rust/fspec-core/src/commands/update_scenario.rs:223-241 | rust/fspec-core/src/commands/update_step.rs:224-241 — before extracting anything, compare `rust/fspec-core/src/commands/add_scenario.rs` and `rust/fspec-core/src/commands/add_step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–19 lines × 3) · ×1
  • Duplicated block (16–19 lines × 3) rust/fspec-core/src/commands/list_feature_tags.rs:229 — rust/fspec-core/src/commands/list_feature_tags.rs:229-247 | rust/fspec-core/src/commands/list_features.rs:172-190 | rust/fspec-core/src/commands/tag_stats.rs:357-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.
D4 · Code Duplication · Duplicated block (17–19 lines × 3) · ×1
  • Duplicated block (17–19 lines × 3) rust/fspec/src/search_implementation.rs:43 — rust/fspec/src/search_implementation.rs:43-59 | rust/fspec/src/search_scenarios.rs:40-56 | rust/fspec/src/show_test_patterns.rs:42-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17–18 lines × 5) · ×1
  • Duplicated block (17–18 lines × 5) rust/fspec-core/src/commands/add_bounded_context.rs:187 — rust/fspec-core/src/commands/add_bounded_context.rs:187-203 | rust/fspec-core/src/commands/add_domain_event.rs:139-155 | rust/fspec-core/src/commands/add_external_system.rs:188-204 | rust/fspec-core/src/commands/add_hotspot.rs:129-145 | rust/fspec-core/src/commands/add_policy.rs:161-178 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) rust/graph/src/ast_pipeline/ast_go_extractor.rs:67 — rust/graph/src/ast_pipeline/ast_go_extractor.rs:67-84 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:66-83 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:83-100 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:133-150 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_go_extractor.rs` and `rust/graph/src/ast_pipeline/ast_python_extractor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–18 lines × 3) · ×1
  • Duplicated block (16–18 lines × 3) rust/fspec-core/src/types/work_unit.rs:142 — rust/fspec-core/src/types/work_unit.rs:142-159 | rust/fspec-core/src/types/work_unit.rs:284-299 | rust/fspec-core/src/types/work_unit.rs:552-568 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–18 lines × 2) · ×1
  • Duplicated block (11–18 lines × 2) rust/fspec-tui/src/components/dialog_button_hits.rs:100 — rust/fspec-tui/src/components/dialog_button_hits.rs:100-110 | rust/fspec-tui/src/components/dialog_theme.rs:231-248 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) rust/napi/src/session_bindings.rs:2808 — rust/napi/src/session_bindings.rs:2808-2825 | rust/sessions/src/handle_impl.rs:623-637 — before extracting anything, compare `rust/napi/src/session_bindings.rs` and `rust/sessions/src/handle_impl.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 5) · ×1
  • Duplicated block (16–17 lines × 5) rust/fspec-core/src/commands/add_command_to_foundation.rs:63 — rust/fspec-core/src/commands/add_command_to_foundation.rs:63-79 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:66-82 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:77-92 | rust/fspec-core/src/commands/remove_command_from_foundation.rs:54-70 | rust/fspec-core/src/commands/remove_domain_event_from_foundation.rs:57-73 — before extracting anything, compare `rust/fspec-core/src/commands/add_command_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:278 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:278-294 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:409-426 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:339-356 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:361-378 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) rust/cli/src/interactive/stream_loop.rs:1418 — rust/cli/src/interactive/stream_loop.rs:1418-1434 | rust/cli/src/interactive/stream_loop.rs:1679-1693 | rust/cli/src/interactive/stream_loop.rs:2034-2049 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) rust/graph/src/ast_pipeline/complexity.rs:211 — rust/graph/src/ast_pipeline/complexity.rs:211-227 | rust/graph/src/ast_pipeline/complexity.rs:263-279 | rust/graph/src/ast_pipeline/helpers.rs:371-387 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) rust/fspec-core/src/commands/delete_scenario.rs:133 — rust/fspec-core/src/commands/delete_scenario.rs:133-149 | rust/fspec-core/src/commands/delete_step.rs:115-127 — before extracting anything, compare `rust/fspec-core/src/commands/delete_scenario.rs` and `rust/fspec-core/src/commands/delete_step.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:95 — rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:95-111 | rust/graph/src/ast_pipeline/ast_ruby_extractor.rs:286-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 8) · ×1
  • Duplicated block (16 lines × 8) rust/fspec/src/list_checkpoints.rs:68 — rust/fspec/src/list_checkpoints.rs:68-87 | rust/fspec/src/list_epics.rs:71-90 | rust/fspec/src/list_feature_tags.rs:150-165 | rust/fspec/src/list_foundation_sections.rs:72-91 | rust/fspec/src/list_prefixes.rs:71-90 | rust/fspec/src/list_work_units.rs:91-113 | rust/fspec/src/query_estimate_accuracy.rs:75-96 | rust/fspec/src/show_epic.rs:84-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:278 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:278-293 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:409-425 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:345-361 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:339-355 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:361-377 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–16 lines × 4) · ×1
  • Duplicated block (14–16 lines × 4) rust/fspec-core/src/commands/add_bounded_context.rs:216 — rust/fspec-core/src/commands/add_bounded_context.rs:216-229 | rust/fspec-core/src/commands/add_external_system.rs:217-230 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:124-137 | rust/fspec-core/src/commands/add_policy.rs:211-226 — before extracting anything, compare `rust/fspec-core/src/commands/add_bounded_context.rs` and `rust/fspec-core/src/commands/add_external_system.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) rust/fspec-core/src/commands/generate_scenarios.rs:862 — rust/fspec-core/src/commands/generate_scenarios.rs:862-877 | rust/fspec-core/src/commands/link_coverage/step.rs:337-350 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:559-572 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/link_coverage/step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–16 lines × 3) · ×1
  • Duplicated block (13–16 lines × 3) rust/git/src/ghost_commit.rs:499 — rust/git/src/ghost_commit.rs:499-514 | rust/git/src/ghost_commit.rs:645-657 | rust/git/src/ghost_commit.rs:859-874 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) rust/sessions/src/model_parsing.rs:61 — rust/sessions/src/model_parsing.rs:61-75 | rust/sessions/src/model_resolution.rs:184-199 — before extracting anything, compare `rust/sessions/src/model_parsing.rs` and `rust/sessions/src/model_resolution.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–15 lines × 6) · ×1
  • Duplicated block (13–15 lines × 6) rust/graph/src/ast_pipeline/ast_go_extractor.rs:483 — rust/graph/src/ast_pipeline/ast_go_extractor.rs:483-496 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:384-396 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:388-400 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:393-407 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:376-389 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:464-478 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_go_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 7 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.
D4 · Code Duplication · Duplicated block (3–15 lines × 4) · ×1
  • Duplicated block (3–15 lines × 4) rust/fspec-core/src/commands/list_attachments.rs:189 — rust/fspec-core/src/commands/list_attachments.rs:189-203 | rust/fspec-core/src/io/ensure.rs:328-342 | rust/fspec-core/src/io/time.rs:57-71 | rust/tools/src/ls.rs:102-104 — 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 (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) rust/graph/src/ast_pipeline/ast_dart_extractor.rs:223 — rust/graph/src/ast_pipeline/ast_dart_extractor.rs:223-235 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:243-255 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:262-276 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–15 lines × 2) · ×1
  • Duplicated block (9–15 lines × 2) rust/cli/src/interactive/stream_loop.rs:1644 — rust/cli/src/interactive/stream_loop.rs:1644-1658 | rust/cli/src/interactive/stream_loop.rs:1997-2005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) rust/fspec-core/src/commands/add_dependencies.rs:175 — rust/fspec-core/src/commands/add_dependencies.rs:175-189 | rust/fspec-core/src/commands/add_dependency.rs:138-149 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–15 lines × 2) · ×1
  • Duplicated block (10–15 lines × 2) rust/fspec-core/src/io/gherkin_format.rs:288 — rust/fspec-core/src/io/gherkin_format.rs:288-302 | rust/fspec-core/src/io/gherkin_format.rs:485-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–14 lines × 9) · ×1
  • Duplicated block (8–14 lines × 9) rust/graph/src/ast_pipeline/ast_c_extractor.rs:153 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:153-162 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:273-280 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:402-411 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:317-326 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:338-347 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:335-348 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:332-341 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:354-363 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:208-217 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_c_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) rust/agent-loop/src/agent_loop.rs:1125 — rust/agent-loop/src/agent_loop.rs:1125-1138 | rust/agent-loop/src/agent_loop.rs:1331-1344 | rust/napi/src/agent_loop.rs:1094-1107 | rust/napi/src/agent_loop.rs:1219-1232 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–14 lines × 4) · ×1
  • Duplicated block (10–14 lines × 4) rust/fspec-core/src/commands/check.rs:163 — rust/fspec-core/src/commands/check.rs:163-172 | rust/fspec-core/src/commands/delete_features.rs:79-88 | rust/fspec-core/src/commands/delete_scenarios.rs:100-109 | rust/fspec-core/src/commands/format.rs:72-85 — before extracting anything, compare `rust/fspec-core/src/commands/delete_features.rs` and `rust/fspec-core/src/commands/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–14 lines × 4) · ×1
  • Duplicated block (13–14 lines × 4) rust/fspec/src/delete_features.rs:64 — rust/fspec/src/delete_features.rs:64-77 | rust/fspec/src/delete_scenarios.rs:67-79 | rust/fspec/src/list_scenario_tags.rs:88-100 | rust/fspec/src/retag.rs:56-69 — before extracting anything, compare `rust/fspec/src/delete_features.rs` and `rust/fspec/src/delete_scenarios.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) rust/napi/src/session_bindings.rs:2041 — rust/napi/src/session_bindings.rs:2041-2054 | rust/napi/src/session_bindings.rs:2227-2240 | rust/napi/src/session_bindings.rs:2336-2349 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) rust/napi/src/session_bindings.rs:2895 — rust/napi/src/session_bindings.rs:2895-2908 | rust/sessions/src/handle_impl.rs:711-721 — before extracting anything, compare `rust/napi/src/session_bindings.rs` and `rust/sessions/src/handle_impl.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 9) · ×1
  • Duplicated block (13 lines × 9) rust/fspec/src/add_architecture_note.rs:50 — rust/fspec/src/add_architecture_note.rs:50-67 | rust/fspec/src/add_attachment.rs:62-74 | rust/fspec/src/create_epic.rs:64-84 | rust/fspec/src/delete_tag.rs:62-78 | rust/fspec/src/register_tag.rs:67-86 | rust/fspec/src/remove_architecture_note.rs:54-66 | rust/fspec/src/remove_attachment.rs:63-75 | rust/fspec/src/set_user_story.rs:66-81 | rust/fspec/src/update_tag.rs:67-83 — before extracting anything, compare `rust/fspec/src/add_attachment.rs` and `rust/fspec/src/remove_attachment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 8) · ×1
  • Duplicated block (13 lines × 8) rust/tools/src/facade/wrapper.rs:103 — rust/tools/src/facade/wrapper.rs:103-115 | rust/tools/src/facade/wrapper.rs:255-267 | rust/tools/src/facade/wrapper.rs:442-454 | rust/tools/src/facade/wrapper.rs:1288-1300 | rust/tools/src/facade/wrapper.rs:1427-1439 | rust/tools/src/facade/wrapper.rs:1644-1656 | rust/tools/src/facade/wrapper.rs:1842-1854 | rust/tools/src/facade/wrapper.rs:2060-2072 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10–12 lines × 5) · ×1
  • Duplicated block (10–12 lines × 5) rust/agent-loop/src/agent_loop.rs:1112 — rust/agent-loop/src/agent_loop.rs:1112-1123 | rust/agent-loop/src/agent_loop.rs:1253-1262 | rust/agent-loop/src/agent_loop.rs:1319-1329 | rust/napi/src/agent_loop.rs:1082-1092 | rust/napi/src/agent_loop.rs:1207-1217 — before extracting anything, compare `rust/agent-loop/src/agent_loop.rs` and `rust/napi/src/agent_loop.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 1158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) rust/core/src/compaction/trimmer_metadata.rs:43 — rust/core/src/compaction/trimmer_metadata.rs:43-52 | rust/napi/src/session_bindings.rs:2785-2796 | rust/sessions/src/handle_impl.rs:602-613 — before extracting anything, compare `rust/napi/src/session_bindings.rs` and `rust/sessions/src/handle_impl.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–12 lines × 3) · ×1
  • Duplicated block (9–12 lines × 3) rust/fspec-core/src/commands/add_architecture_note.rs:142 — rust/fspec-core/src/commands/add_architecture_note.rs:142-153 | rust/fspec-core/src/commands/remove_architecture_note.rs:184-192 | rust/fspec-core/src/commands/restore_architecture_note.rs:168-176 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture_note.rs` and `rust/fspec-core/src/commands/remove_architecture_note.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) rust/graph/src/ast_pipeline/ast_ts_extractor.rs:392 — rust/graph/src/ast_pipeline/ast_ts_extractor.rs:392-403 | rust/graph/src/ast_pipeline/edge_helpers.rs:127-138 | rust/graph/src/ast_pipeline/edge_helpers.rs:200-210 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_ts_extractor.rs` and `rust/graph/src/ast_pipeline/edge_helpers.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) rust/tools/src/astgrep.rs:350 — rust/tools/src/astgrep.rs:350-361 | rust/tools/src/ls.rs:288-297 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (10–11 lines × 9) · ×1
  • Duplicated block (10–11 lines × 9) rust/graph/src/ast_pipeline/ast_c_extractor.rs:159 — rust/graph/src/ast_pipeline/ast_c_extractor.rs:159-169 | rust/graph/src/ast_pipeline/ast_cpp_extractor.rs:185-195 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:277-286 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:408-418 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:323-333 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:344-354 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:338-348 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:360-370 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:214-224 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_c_extractor.rs` and `rust/graph/src/ast_pipeline/ast_cpp_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) rust/fspec-core/src/commands/generate_scenarios.rs:925 — rust/fspec-core/src/commands/generate_scenarios.rs:925-935 | rust/fspec-core/src/commands/link_coverage/step.rs:404-412 | rust/fspec-core/src/commands/update_work_unit_status/step_docstrings.rs:627-635 — before extracting anything, compare `rust/fspec-core/src/commands/generate_scenarios.rs` and `rust/fspec-core/src/commands/link_coverage/step.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) rust/fspec-core/src/commands/review.rs:715 — rust/fspec-core/src/commands/review.rs:715-724 | rust/fspec-core/src/commands/show_work_unit.rs:448-458 | rust/fspec-core/src/commands/update_work_unit_status.rs:953-962 — before extracting anything, compare `rust/fspec-core/src/commands/review.rs` and `rust/fspec-core/src/commands/show_work_unit.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–10 lines × 3) · ×1
  • Duplicated block (6–10 lines × 3) rust/fspec-core/src/commands/add_command_to_foundation.rs:120 — rust/fspec-core/src/commands/add_command_to_foundation.rs:120-129 | rust/fspec-core/src/commands/add_domain_event_to_foundation.rs:123-132 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:109-114 — before extracting anything, compare `rust/fspec-core/src/commands/add_command_to_foundation.rs` and `rust/fspec-core/src/commands/add_domain_event_to_foundation.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 9) · ×1
  • Duplicated block (9 lines × 9) rust/fspec-tui/src/app/dispatch_merge_worktree.rs:46 — rust/fspec-tui/src/app/dispatch_merge_worktree.rs:46-54 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:61-69 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:84-92 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:104-112 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:94-102 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:114-122 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:134-142 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:154-162 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:174-182 — there are 9 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:387 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:387-395 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:405-413 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:475-483 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:497-505 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:446-454 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:468-476 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:480-488 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:502-510 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–9 lines × 6) · ×1
  • Duplicated block (7–9 lines × 6) rust/fspec-core/src/commands/add_aggregate.rs:193 — rust/fspec-core/src/commands/add_aggregate.rs:193-199 | rust/fspec-core/src/commands/add_bounded_context.rs:219-226 | rust/fspec-core/src/commands/add_command.rs:181-187 | rust/fspec-core/src/commands/add_external_system.rs:220-227 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:127-134 | rust/fspec-core/src/commands/add_policy.rs:214-222 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) rust/fspec-tui/src/views/changed_files/render.rs:127 — rust/fspec-tui/src/views/changed_files/render.rs:127-135 | rust/fspec-tui/src/views/changed_files/render.rs:169-177 | rust/fspec-tui/src/views/checkpoints/render.rs:148-156 | rust/fspec-tui/src/views/checkpoints/render.rs:213-221 | rust/fspec-tui/src/views/checkpoints/render.rs:255-263 — `rust/fspec-tui/src/views/changed_files/render.rs` and `rust/fspec-tui/src/views/checkpoints/render.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 7 separate duplicated blocks between them, totalling at least 102 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 (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) rust/fspec-core/src/commands/add_dependencies.rs:371 — rust/fspec-core/src/commands/add_dependencies.rs:371-379 | rust/fspec-core/src/commands/add_dependency.rs:312-320 | rust/fspec-core/src/commands/prioritize_work_unit.rs:71-79 | rust/fspec-core/src/commands/repair_work_units.rs:106-112 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:95 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:95-103 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:265-272 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:307-314 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) rust/sessions/src/profile_sections.rs:271 — rust/sessions/src/profile_sections.rs:271-279 | rust/tools/src/rlcd/config.rs:139-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (8 lines × 9) · ×1
  • Duplicated block (8 lines × 9) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:387 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:387-394 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:405-412 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:475-482 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:497-504 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:446-453 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:468-475 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:480-487 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:502-509 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:459-466 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_java_extractor.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) rust/fspec-core/src/commands/update_work_unit_status.rs:1347 — rust/fspec-core/src/commands/update_work_unit_status.rs:1347-1353 | rust/fspec-core/src/virtual_hooks_exec.rs:40-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7 lines × 11) · ×1
  • Duplicated block (7 lines × 11) rust/fspec-tui/src/app/dispatch_merge_worktree.rs:49 — rust/fspec-tui/src/app/dispatch_merge_worktree.rs:49-55 | rust/fspec-tui/src/app/dispatch_merge_worktree.rs:118-124 | rust/fspec-tui/src/app/dispatch_merge_worktree.rs:147-153 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:64-70 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:87-93 | rust/fspec-tui/src/app/dispatch_slash_loop.rs:107-113 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:97-103 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:117-123 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:137-143 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:157-163 | rust/fspec-tui/src/app/dispatch_slash_schedule.rs:177-183 — there are 11 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 11 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7 lines × 10) · ×1
  • Duplicated block (7 lines × 10) rust/fspec-core/src/commands/add_aggregate.rs:192 — rust/fspec-core/src/commands/add_aggregate.rs:192-198 | rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:207-213 | rust/fspec-core/src/commands/add_architecture_note.rs:125-131 | rust/fspec-core/src/commands/add_bounded_context.rs:218-224 | rust/fspec-core/src/commands/add_command.rs:180-186 | rust/fspec-core/src/commands/add_example.rs:126-132 | rust/fspec-core/src/commands/add_external_system.rs:219-225 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:126-132 | rust/fspec-core/src/commands/add_policy.rs:213-219 | rust/fspec-core/src/commands/answer_question.rs:222-228 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) rust/agent-loop/src/schedule_handler.rs:91 — rust/agent-loop/src/schedule_handler.rs:91-97 | rust/core/src/scheduler/crud.rs:65-68 | rust/napi/src/schedule_handler.rs:91-97 — before extracting anything, compare `rust/agent-loop/src/schedule_handler.rs` and `rust/napi/src/schedule_handler.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 15) · ×1
  • Duplicated block (6 lines × 15) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:96 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:96-102 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:151-157 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:266-271 | rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:308-313 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:106-112 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:393-399 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:474-480 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:104-110 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:161-167 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:309-315 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:376-382 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:202-208 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:106-112 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:327-333 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:385-391 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_go_extractor.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 14) · ×1
  • Duplicated block (5 lines × 14) rust/fspec-core/src/commands/add_aggregate.rs:192 — rust/fspec-core/src/commands/add_aggregate.rs:192-196 | rust/fspec-core/src/commands/add_aggregate_to_foundation.rs:207-211 | rust/fspec-core/src/commands/add_architecture_note.rs:125-129 | rust/fspec-core/src/commands/add_bounded_context.rs:218-222 | rust/fspec-core/src/commands/add_command.rs:180-184 | rust/fspec-core/src/commands/add_dependencies.rs:328-332 | rust/fspec-core/src/commands/add_dependency.rs:280-284 | rust/fspec-core/src/commands/add_example.rs:126-130 | rust/fspec-core/src/commands/add_external_system.rs:219-223 | rust/fspec-core/src/commands/add_foundation_bounded_context.rs:126-130 | rust/fspec-core/src/commands/add_policy.rs:213-217 | rust/fspec-core/src/commands/answer_question.rs:222-226 | rust/fspec-core/src/commands/answer_question.rs:238-242 | rust/fspec-core/src/commands/discover_foundation.rs:536-540 — before extracting anything, compare `rust/fspec-core/src/commands/add_aggregate.rs` and `rust/fspec-core/src/commands/add_command.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) rust/fspec/src/add_aggregate_to_foundation.rs:52 — rust/fspec/src/add_aggregate_to_foundation.rs:52-56 | rust/fspec/src/add_diagram.rs:51-55 | rust/fspec/src/add_foundation_bounded_context.rs:46-50 | rust/fspec/src/delete_diagram.rs:40-44 | rust/fspec/src/generate_foundation_md.rs:36-40 | rust/fspec/src/remove_aggregate_from_foundation.rs:48-52 | rust/fspec/src/remove_foundation_bounded_context.rs:41-45 — before extracting anything, compare `rust/fspec/src/add_foundation_bounded_context.rs` and `rust/fspec/src/remove_foundation_bounded_context.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (4–5 lines × 7) · ×1
  • Duplicated block (4–5 lines × 7) rust/fspec-core/src/commands/restore_rule.rs:343 — rust/fspec-core/src/commands/restore_rule.rs:343-346 | rust/fspec/src/remove_architecture_note.rs:74-78 | rust/fspec/src/remove_example.rs:86-90 | rust/fspec/src/remove_question.rs:82-86 | rust/fspec/src/remove_rule.rs:87-91 | rust/fspec/src/restore_example.rs:99-103 | rust/fspec/src/restore_rule.rs:95-99 — before extracting anything, compare `rust/fspec/src/remove_architecture_note.rs` and `rust/fspec/src/remove_example.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) rust/core/src/git_state.rs:98 — rust/core/src/git_state.rs:98-102 | rust/fspec-core/src/commands/checkpoint.rs:229-234 | rust/fspec-core/src/commands/cleanup_checkpoints.rs:212-217 | rust/fspec-core/src/commands/list_checkpoints.rs:199-204 | rust/rpc/src/checkpoints.rs:243-248 — before extracting anything, compare `rust/core/src/git_state.rs` and `rust/fspec-core/src/commands/checkpoint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (2–5 lines × 3) · ×1
  • Duplicated block (2–5 lines × 3) rust/git/src/ghost_commit.rs:67 — rust/git/src/ghost_commit.rs:67-68 | rust/git/src/ghost_commit.rs:741-745 | rust/git/src/ghost_commit.rs:796-800 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) rust/fspec-tui/src/components/attachment_picker_dialog.rs:116 — rust/fspec-tui/src/components/attachment_picker_dialog.rs:116-121 | rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:172-177 | rust/fspec-tui/src/components/create_session_dialog.rs:194-199 | rust/fspec-tui/src/components/exit_confirmation_dialog.rs:179-184 | rust/fspec-tui/src/components/menu_bar_help.rs:134-139 | rust/fspec-tui/src/components/mux_config_dialog.rs:121-126 | rust/fspec-tui/src/components/role_dialog.rs:111-116 | rust/fspec-tui/src/components/status_dialog.rs:178-183 | rust/fspec-tui/src/components/work_unit_search_dialog.rs:138-143 — before extracting anything, compare `rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs` and `rust/fspec-tui/src/components/create_session_dialog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:165 — rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs:165-170 | rust/fspec-tui/src/components/create_session_dialog.rs:187-192 | rust/fspec-tui/src/components/exit_confirmation_dialog.rs:172-177 | rust/fspec-tui/src/components/menu_bar_help.rs:127-132 | rust/fspec-tui/src/components/mux_config_dialog.rs:114-119 | rust/fspec-tui/src/components/role_dialog.rs:104-109 | rust/fspec-tui/src/components/thinking_level_dialog.rs:116-121 — before extracting anything, compare `rust/fspec-tui/src/components/board_exit_confirmation_dialog.rs` and `rust/fspec-tui/src/components/create_session_dialog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 10) · ×1
  • Duplicated block (12 lines × 10) rust/cli/src/compactor_sub_agent.rs:79 — rust/cli/src/compactor_sub_agent.rs:79-90 | rust/tools/src/agent_manager/handler.rs:60-71 | rust/tools/src/agent_manager/handler.rs:80-91 | rust/tools/src/deep_search/mod.rs:234-245 | rust/tools/src/fspec_handler.rs:80-91 | rust/tools/src/generate_compaction/mod.rs:81-92 | rust/tools/src/inject_summary.rs:49-60 | rust/tools/src/request_user_input.rs:182-193 | rust/tools/src/schedule/handler.rs:35-46 | rust/tools/src/session_search/handler.rs:41-52 — before extracting anything, compare `rust/tools/src/inject_summary.rs` and `rust/tools/src/request_user_input.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 17) · ×1
  • Duplicated block (13 lines × 17) rust/fspec/src/add_architecture_note.rs:50 — rust/fspec/src/add_architecture_note.rs:50-67 | rust/fspec/src/add_attachment.rs:62-74 | rust/fspec/src/add_example.rs:52-67 | rust/fspec/src/compact_work_unit.rs:64-76 | rust/fspec/src/create_epic.rs:64-84 | rust/fspec/src/delete_epic.rs:75-91 | rust/fspec/src/delete_tag.rs:62-78 | rust/fspec/src/delete_work_unit.rs:63-75 | rust/fspec/src/register_tag.rs:67-86 | rust/fspec/src/remove_architecture_note.rs:54-66 | rust/fspec/src/remove_attachment.rs:63-75 | rust/fspec/src/remove_example.rs:59-73 | rust/fspec/src/restore_example.rs:70-84 | rust/fspec/src/restore_rule.rs:70-82 | rust/fspec/src/set_user_story.rs:66-81 | rust/fspec/src/update_tag.rs:67-83 | rust/fspec/src/update_work_unit_status.rs:67-82 — before extracting anything, compare `rust/fspec/src/add_attachment.rs` and `rust/fspec/src/remove_attachment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 9) · ×1
  • Duplicated block (12 lines × 9) rust/fspec-core/src/commands/answer_question.rs:71 — rust/fspec-core/src/commands/answer_question.rs:71-82 | rust/fspec-core/src/commands/remove_dependency.rs:101-112 | rust/fspec-core/src/commands/remove_example.rs:107-120 | rust/fspec-core/src/commands/remove_question.rs:112-125 | rust/fspec-core/src/commands/remove_rule.rs:98-111 | rust/fspec-core/src/commands/restore_architecture_note.rs:66-80 | rust/fspec-core/src/commands/restore_example.rs:109-122 | rust/fspec-core/src/commands/restore_question.rs:63-80 | rust/fspec-core/src/commands/restore_rule.rs:104-117 — before extracting anything, compare `rust/fspec-core/src/commands/answer_question.rs` and `rust/fspec-core/src/commands/remove_dependency.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16 lines × 10) · ×1
  • Duplicated block (16 lines × 10) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:187 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:187-202 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:365-381 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:208-224 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:197-213 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:234-250 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:203-219 | rust/graph/src/ast_pipeline/ast_python_extractor.rs:172-188 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:193-209 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:249-265 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:195-211 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 14) · ×1
  • Duplicated block (10 lines × 14) rust/fspec-core/src/commands/add_dependencies.rs:92 — rust/fspec-core/src/commands/add_dependencies.rs:92-103 | rust/fspec-core/src/commands/add_dependency.rs:76-85 | rust/fspec-core/src/commands/add_example.rs:63-74 | rust/fspec-core/src/commands/answer_question.rs:71-80 | rust/fspec-core/src/commands/clear_virtual_hooks.rs:76-90 | rust/fspec-core/src/commands/remove_attachment.rs:70-80 | rust/fspec-core/src/commands/remove_dependency.rs:101-112 | rust/fspec-core/src/commands/remove_example.rs:107-117 | rust/fspec-core/src/commands/remove_question.rs:112-122 | rust/fspec-core/src/commands/remove_rule.rs:98-108 | rust/fspec-core/src/commands/restore_architecture_note.rs:66-77 | rust/fspec-core/src/commands/restore_example.rs:109-119 | rust/fspec-core/src/commands/restore_question.rs:63-77 | rust/fspec-core/src/commands/restore_rule.rs:104-114 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) rust/fspec-core/src/commands/add_architecture_note.rs:73 — rust/fspec-core/src/commands/add_architecture_note.rs:73-87 | rust/fspec-core/src/commands/add_assumption.rs:43-53 | rust/fspec-core/src/commands/add_question.rs:83-94 | rust/fspec-core/src/commands/add_rule.rs:70-83 | rust/fspec-core/src/commands/remove_architecture_note.rs:103-114 | rust/fspec-core/src/commands/set_user_story.rs:85-98 — before extracting anything, compare `rust/fspec-core/src/commands/add_architecture_note.rs` and `rust/fspec-core/src/commands/remove_architecture_note.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 15) · ×1
  • Duplicated block (8 lines × 15) rust/fspec-core/src/commands/add_dependencies.rs:89 — rust/fspec-core/src/commands/add_dependencies.rs:89-98 | rust/fspec-core/src/commands/add_dependency.rs:73-80 | rust/fspec-core/src/commands/add_example.rs:60-69 | rust/fspec-core/src/commands/answer_question.rs:68-75 | rust/fspec-core/src/commands/clear_virtual_hooks.rs:73-85 | rust/fspec-core/src/commands/prioritize_work_unit.rs:92-101 | rust/fspec-core/src/commands/remove_attachment.rs:67-75 | rust/fspec-core/src/commands/remove_dependency.rs:98-107 | rust/fspec-core/src/commands/remove_example.rs:104-112 | rust/fspec-core/src/commands/remove_question.rs:109-117 | rust/fspec-core/src/commands/remove_rule.rs:95-103 | rust/fspec-core/src/commands/restore_architecture_note.rs:63-72 | rust/fspec-core/src/commands/restore_example.rs:106-114 | rust/fspec-core/src/commands/restore_question.rs:60-72 | rust/fspec-core/src/commands/restore_rule.rs:101-109 — before extracting anything, compare `rust/fspec-core/src/commands/add_dependencies.rs` and `rust/fspec-core/src/commands/add_dependency.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • Duplicated block (11 lines × 7) rust/fspec-core/src/commands/list_epics.rs:64 — rust/fspec-core/src/commands/list_epics.rs:64-74 | rust/fspec-core/src/commands/list_feature_tags.rs:117-127 | rust/fspec-core/src/commands/list_hooks.rs:118-128 | rust/fspec-core/src/commands/list_prefixes.rs:64-74 | rust/fspec-core/src/commands/list_schedules.rs:112-122 | rust/fspec-core/src/commands/list_work_units.rs:66-76 | rust/fspec-core/src/commands/show_work_unit.rs:126-136 — before extracting anything, compare `rust/fspec-core/src/commands/list_epics.rs` and `rust/fspec-core/src/commands/list_prefixes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:178 — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:178-186 | rust/graph/src/ast_pipeline/ast_dart_extractor.rs:356-364 | rust/graph/src/ast_pipeline/ast_go_extractor.rs:199-207 | rust/graph/src/ast_pipeline/ast_java_extractor.rs:188-196 | rust/graph/src/ast_pipeline/ast_kotlin_extractor.rs:225-233 | rust/graph/src/ast_pipeline/ast_php_extractor.rs:194-202 | rust/graph/src/ast_pipeline/ast_rust_extractor.rs:184-192 | rust/graph/src/ast_pipeline/ast_scala_extractor.rs:240-248 | rust/graph/src/ast_pipeline/ast_swift_extractor.rs:164-172 | rust/graph/src/ast_pipeline/ast_ts_extractor.rs:186-194 — before extracting anything, compare `rust/graph/src/ast_pipeline/ast_csharp_extractor.rs` and `rust/graph/src/ast_pipeline/ast_dart_extractor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 12) · ×1
  • Duplicated block (5 lines × 12) rust/fspec/src/add_aggregate_to_foundation.rs:52 — rust/fspec/src/add_aggregate_to_foundation.rs:52-56 | rust/fspec/src/add_capability.rs:48-52 | rust/fspec/src/add_diagram.rs:51-55 | rust/fspec/src/add_foundation_bounded_context.rs:46-50 | rust/fspec/src/add_persona.rs:50-54 | rust/fspec/src/delete_diagram.rs:40-44 | rust/fspec/src/generate_foundation_md.rs:36-40 | rust/fspec/src/remove_aggregate_from_foundation.rs:48-52 | rust/fspec/src/remove_capability.rs:43-47 | rust/fspec/src/remove_foundation_bounded_context.rs:41-45 | rust/fspec/src/remove_persona.rs:46-50 | rust/fspec/src/remove_question.rs:52-59 — before extracting anything, compare `rust/fspec/src/add_capability.rs` and `rust/fspec/src/add_persona.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) rust/fspec-core/src/commands/generate_tags_md.rs:117 — rust/fspec-core/src/commands/generate_tags_md.rs:117-122 | rust/fspec-core/src/commands/show_acceptance_criteria.rs:231-236 | rust/fspec-core/src/commands/show_coverage.rs:145-150 | rust/fspec-core/src/commands/show_feature.rs:148-153 | rust/fspec-core/src/commands/show_foundation.rs:163-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
R10 · Code Duplication · Duplicated block with local edits (75 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (75 matched lines × 2 locations) bridge/telegram-endpoint.ts:287 — bridge/telegram-endpoint.ts:287 · bridge/telegram-formatting.ts:34 — the two spans are one implementation copied and then locally edited — 481 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (42 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (42 matched lines × 2 locations) bridge/telegram-buffering.ts:51 — bridge/telegram-buffering.ts:51 · bridge/telegram-endpoint.ts:456 — the two spans are one implementation copied and then locally edited — 244 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 (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) bridge/telegram-endpoint.ts:248 — bridge/telegram-endpoint.ts:248 · bridge/telegram-formatting.ts:192 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (12 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (12 matched lines × 2 locations) bridge/relay-endpoint.ts:399 — bridge/relay-endpoint.ts:399 · bridge/telegram-endpoint.ts:1190 — 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 (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) bridge/telegram-content-chunker.ts:593 — bridge/telegram-content-chunker.ts:593 · bridge/telegram-content-chunker.ts:611 — both copies are in the same file, so extract the 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 (10 lines × 2 locations) · ×1
  • Duplicated block (10 lines × 2 locations) bridge/relay-endpoint-handlers.ts:263 — bridge/relay-endpoint-handlers.ts:263 · bridge/relay-server.ts:192 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (9 matched lines × 2 locations) bridge/relay-endpoint.ts:164 — bridge/relay-endpoint.ts:164 · bridge/relay-endpoint.ts:219 — the two spans are one implementation copied and then locally edited — 62 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) bridge/telegram-content-chunker.ts:83 — bridge/telegram-content-chunker.ts:83 · bridge/telegram-content-chunker.ts:113 — 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.
R2 · Cyclomatic Complexity · Complex function handleStreamChunk (cyclomatic 31, cognitive 42) · ×1
  • Complex function handleStreamChunk (cyclomatic 31, cognitive 42) bridge/telegram-endpoint.ts:529 — handleStreamChunk has cyclomatic complexity 31 and cognitive complexity 42; 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 23, cognitive 35) · ×1
  • Complex function (anonymous) (cyclomatic 23, cognitive 35) bridge/telegram-endpoint.ts:905 — (anonymous) has cyclomatic complexity 23 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function formatForTelegram (cyclomatic 21, cognitive 19) · ×1
  • Complex function formatForTelegram (cyclomatic 21, cognitive 19) bridge/telegram-endpoint.ts:395 — formatForTelegram has cyclomatic complexity 21 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 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 getBestSplitPoint (cyclomatic 19, cognitive 27) · ×1
  • Complex function getBestSplitPoint (cyclomatic 19, cognitive 27) bridge/telegram-content-chunker.ts:329 — getBestSplitPoint has cyclomatic complexity 19 and cognitive complexity 27; 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 formatForTelegram (cyclomatic 18, cognitive 15) · ×1
  • Complex function formatForTelegram (cyclomatic 18, cognitive 15) bridge/telegram-formatting.ts:143 — formatForTelegram has cyclomatic complexity 18 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 findTableBoundary (cyclomatic 17, cognitive 28) · ×1
  • Complex function findTableBoundary (cyclomatic 17, cognitive 28) bridge/telegram-content-chunker.ts:272 — findTableBoundary has cyclomatic complexity 17 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 handleRelayMessage (cyclomatic 15, cognitive 11) · ×1
  • Complex function handleRelayMessage (cyclomatic 15, cognitive 11) bridge/relay-endpoint-handlers.ts:185 — handleRelayMessage has cyclomatic complexity 15 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 findListBoundary (cyclomatic 13, cognitive 19) · ×1
  • Complex function findListBoundary (cyclomatic 13, cognitive 19) bridge/telegram-content-chunker.ts:176 — findListBoundary has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleInboundEnvelope (cyclomatic 13, cognitive 15) · ×1
  • Complex function handleInboundEnvelope (cyclomatic 13, cognitive 15) bridge/telegram-endpoint.ts:770 — handleInboundEnvelope has cyclomatic complexity 13 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 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 · bridge/telegram-endpoint.ts · ×1
  • bridge/telegram-endpoint.ts: 1069 lines of code bridge/telegram-endpoint.ts:1 — bridge/telegram-endpoint.ts has 1069 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 · bridge/telegram-content-chunker.ts · ×1
  • bridge/telegram-content-chunker.ts: 548 lines of code bridge/telegram-content-chunker.ts:1 — bridge/telegram-content-chunker.ts has 548 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · No test or lint script · ×1
  • No test or lint script — test ✗ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~160 LoC) · ×1
  • Dead file (~160 LoC) bridge/telegram-buffering.ts — no import path from any entry point (3 application, 0 tooling, 13 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X2 · Cancellation propagation · Async function without AbortSignal · ×1
  • Async function without AbortSignal: downloadPhotoAsBase64 bridge/telegram-endpoint.ts:269 — `downloadPhotoAsBase64` 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 })`.
Minor — 172 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging rust/agent-loop/src/terminal_overflow_recovery.rs:48 — `info!` at line 48 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`.
  • Interpolated log message defeats structured logging rust/agent-loop/src/persist.rs:61 — `debug!` at line 61 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: `debug!(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 rust/agent-loop/src/persist.rs:132 — `debug!` at line 132 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: `debug!(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 rust/agent-loop/src/persist.rs:190 — `debug!` at line 190 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: `debug!(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 rust/agent-loop/src/persist.rs:221 — `debug!` at line 221 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: `debug!(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 rust/agent-loop/src/persist.rs:251 — `warn!` at line 251 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 rust/agent-loop/src/persist.rs:263 — `warn!` at line 263 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 rust/agent-loop/src/persist.rs:274 — `debug!` at line 274 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: `debug!(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 rust/agent-loop/src/persist.rs:283 — `debug!` at line 283 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: `debug!(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 rust/agent-loop/src/persist.rs:294 — `warn!` at line 294 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 rust/agent-loop/src/persist.rs:306 — `warn!` at line 306 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 rust/agent-loop/src/hooks.rs:58 — `debug!` at line 58 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: `debug!(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 rust/agent-loop/src/hooks.rs:63 — `debug!` at line 63 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: `debug!(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 rust/agent-loop/src/generate_compaction_handler.rs:83 — `debug!` at line 83 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: `debug!(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 rust/agent-loop/src/generate_compaction_handler.rs:147 — `info!` at line 147 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`.
  • Interpolated log message defeats structured logging rust/agent-loop/src/generate_compaction_handler.rs:158 — `warn!` at line 158 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 rust/agent-loop/src/generate_compaction_handler.rs:221 — `warn!` at line 221 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 rust/agent-loop/src/generate_compaction_handler.rs:559 — `info!` at line 559 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`.
  • Interpolated log message defeats structured logging rust/agent-loop/src/generate_compaction_handler.rs:710 — `warn!` at line 710 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 rust/agent-loop/src/generate_compaction_handler.rs:720 — `warn!` at line 720 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 rust/agent-loop/src/generate_compaction_handler.rs:749 — `error!` at line 749 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: `error!(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 rust/agent-loop/src/generate_compaction_handler.rs:809 — `info!` at line 809 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`.
  • Interpolated log message defeats structured logging rust/agent-loop/src/dispatch.rs:42 — `debug!` at line 42 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: `debug!(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 rust/agent-loop/src/dispatch.rs:67 — `info!` at line 67 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`.
  • Interpolated log message defeats structured logging rust/agent-loop/src/dispatch.rs:74 — `warn!` at line 74 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`.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on Err · ×38
  • Silent fallback default on Err rust/cli/src/interactive_helpers.rs:126 — `extract_tool_result_text` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/cli/src/interactive_helpers.rs:148 — `extract_message_text` turns every `Err` into `"[]".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/common/src/tool_usage.rs:350 — `synthesize_object` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/common/src/tool_usage.rs:425 — `compact_value` turns every `Err` into `"?".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/core/src/git_state.rs:426 — `snapshot` turns every `Err` into `GitState::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 rust/core/src/session_manager_handle.rs:1632 — `list_sessions` 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 rust/core/src/session_manager_handle.rs:1740 — `list_providers` 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 rust/core/src/session_manager_handle.rs:2309 — `list_provider_credentials` 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 rust/core/src/session_manager_handle.rs:2425 — `blocklist_list` 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 rust/core/src/session_manager_handle.rs:2464 — `prune_orphaned_worktrees` turns every `Err` into `Ok(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 rust/core/src/session_manager_handle.rs:2473 — `list_session_worktrees` 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 rust/core/src/session_manager_handle.rs:2523 — `schedule_list` 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 rust/core/src/session_manager_handle.rs:2624 — `loop_list` 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 rust/core/src/work_units.rs:320 — `snapshot` 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 rust/fspec-core/src/commands/add_schedule.rs:218 — `load_or_default` turns every `Err` into `Ok(SchedulesData::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 rust/fspec-core/src/commands/export_dependencies.rs:174 — `generate_json_map` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/fspec-core/src/commands/link_coverage.rs:339 — `scenarios_from_feature_file` 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 rust/fspec-core/src/commands/link_coverage.rs:367 — `detect_work_unit_type` turns every `Err` into `"story".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/fspec-core/src/commands/query_work_units.rs:443 — `render_json_envelope` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/fspec-core/src/commands/query_work_units.rs:471 — `render_table_envelope` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust/fspec-core/src/commands/remove_schedule.rs:112 — `load_or_default` turns every `Err` into `Ok(SchedulesData::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 rust/fspec-core/src/commands/reverse.rs:608 — `find_feature_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 rust/fspec-core/src/commands/review.rs:711 — `scan_linked_features` 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 rust/fspec-core/src/commands/search_implementation.rs:170 — `read_impl_refs` 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 rust/fspec-core/src/commands/show_test_patterns.rs:144 — `read_test_refs` 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.
  • + 13 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate bridge/telegram-endpoint.ts:385 — `beforeMarker.includes('\n') && !beforeMarker.includes('```')` appears character-identically in 2 files — bridge/telegram-endpoint.ts, bridge/telegram-formatting.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 bridge/telegram-endpoint.ts:349 — `endingHasOpenBlock || beginningOpenBlocks > 0` appears character-identically in 2 files — bridge/telegram-endpoint.ts, bridge/telegram-formatting.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 bridge/telegram-endpoint.ts:352 — `firstCodeBlockInEnding === -1 || endingHasOpenBlock` appears character-identically in 2 files — bridge/telegram-endpoint.ts, bridge/telegram-formatting.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 bridge/telegram-endpoint.ts:418 — `map.get(chunk.tool_call_id) || 'unknown'` appears character-identically in 2 files — bridge/telegram-endpoint.ts, bridge/telegram-formatting.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 bridge/telegram-buffering.ts:145 — `state.bufferCharCount >= MAX_BUFFER_CHARS || state.messageBuffer.length >= MAX_BUFFER_SIZE` appears character-identically in 2 files — bridge/telegram-buffering.ts, bridge/telegram-endpoint.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 rust/providers/src/credentials.rs:219 — `!auth.access_token.is_empty() && !auth.refresh_token.is_empty()` appears character-identically in 3 files — rust/providers/src/credentials.rs, rust/providers/src/manager.rs, rust/sessions/src/credentials/resolver.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust/agent-loop/src/persist.rs:181 — `!content.is_char_boundary(end) && end > 0` appears character-identically in 2 files — rust/agent-loop/src/persist.rs, rust/napi/src/persist.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 rust/fspec-tui/src/views/provider_settings/profile_form_paste.rs:21 — `!form.is_editing_name && is_streaming_field(form.field_index)` appears character-identically in 2 files — rust/fspec-tui/src/views/provider_settings/profile_form_paste.rs, rust/fspec-tui/src/views/provider_settings/profile_form_streaming.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 rust/sessions/src/model_parsing.rs:93 — `!is_profile_model && !is_codex_model && codelet_providers::custom_provider_registered(registry_provider)` appears character-identically in 2 files — rust/sessions/src/model_parsing.rs, rust/sessions/src/model_resolution.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 rust/graph/src/ast_pipeline/ast_csharp_extractor.rs:391 — `!name.is_empty() && !builtins.contains(name.as_str())` appears character-identically in 2 files — rust/graph/src/ast_pipeline/ast_csharp_extractor.rs, rust/graph/src/ast_pipeline/ast_rust_extractor.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 rust/tools/src/astgrep_refactor.rs:600 — `!output.is_empty() && !output.ends_with('\n')` appears character-identically in 2 files — rust/tools/src/astgrep_refactor.rs, rust/tools/src/bash_output.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 rust/fspec-core/src/commands/add_tag_to_feature.rs:334 — `!trimmed.starts_with('@') && !trimmed.is_empty()` appears character-identically in 2 files — rust/fspec-core/src/commands/add_tag_to_feature.rs, rust/fspec-core/src/commands/add_tag_to_scenario.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 rust/graph/src/ast_pipeline/ast_ts_extractor.rs:438 — `b.is_ascii_alphabetic() || b == b'_' || b == b'$'` appears character-identically in 2 files — rust/graph/src/ast_pipeline/ast_ts_extractor.rs, rust/graph/src/ast_pipeline/edge_helpers.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 rust/graph/src/ast_pipeline/ast_ts_extractor.rs:442 — `b.is_ascii_alphanumeric() || b == b'_' || b == b'$'` appears character-identically in 2 files — rust/graph/src/ast_pipeline/ast_ts_extractor.rs, rust/graph/src/ast_pipeline/edge_helpers.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 rust/graph/src/ast_pipeline/ast_ts_extractor.rs:358 — `bytes[i] == b'\'' || bytes[i] == b'"' || bytes[i] == b'`'` appears character-identically in 2 files — rust/graph/src/ast_pipeline/ast_ts_extractor.rs, rust/graph/src/ast_pipeline/edge_helpers.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 rust/napi/src/astgrep.rs:941 — `ch.is_uppercase() && prev_lower && !current.is_empty()` appears character-identically in 2 files — rust/napi/src/astgrep.rs, rust/tools/src/astgrep_refactor.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 rust/fspec-tui/src/views/agent/menu_keys.rs:44 — `code == key.code && key.modifiers == KeyModifiers::NONE` appears character-identically in 3 files — rust/fspec-tui/src/views/agent/menu_keys.rs, rust/fspec-tui/src/views/board/menu_keys.rs, rust/fspec-tui/src/views/multiplex/menu_keys.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 rust/fspec-tui/src/views/changed_files/mod.rs:369 — `col >= r.x && col < r.x.saturating_add(r.width) && row >= r.y && row < r.y.saturating_add(r.height)` appears character-identically in 2 files — rust/fspec-tui/src/views/changed_files/mod.rs, rust/fspec-tui/src/views/checkpoints/mod.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 rust/patches/rig-core/src/providers/openai/completion/streaming.rs:292 — `combined.trim_start().starts_with('{') && combined.trim_end().ends_with('}')` appears character-identically in 2 files — rust/patches/rig-core/src/providers/openai/completion/streaming.rs, rust/patches/rig-core/src/providers/openrouter/streaming.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 rust/fspec-core/src/commands/add_dependencies.rs:184 — `cur_status != WorkUnitStatus::Blocked && cur_status != WorkUnitStatus::Done` appears character-identically in 2 files — rust/fspec-core/src/commands/add_dependencies.rs, rust/fspec-core/src/commands/add_dependency.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 rust/fspec-core/src/commands/show_acceptance_criteria.rs:458 — `end > start && slice[end - 1].chars().all(char::is_whitespace)` appears character-identically in 2 files — rust/fspec-core/src/commands/show_acceptance_criteria.rs, rust/fspec-core/src/io/gherkin_format.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 rust/fspec-tui/src/views/agent/resume_session_view_mouse.rs:21 — `ev.column >= body_rect.x && ev.column < body_rect.x + body_rect.width && ev.row >= body_rect.y && ev.row < body_rect.y + body_rect.height` appears character-identically in 2 files — rust/fspec-tui/src/views/agent/resume_session_view_mouse.rs, rust/fspec-tui/src/views/agent/search_history_view_mouse.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 rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs:55 — `ev.column >= popup_rect.x && ev.column < popup_rect.x + popup_rect.width && ev.row >= popup_rect.y && ev.row < popup_rect.y + popup_rect.hei…` appears character-identically in 2 files — rust/fspec-tui/src/views/agent/file_search_popup_mouse.rs, rust/fspec-tui/src/views/agent/slash_command_popup_mouse.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 rust/fspec-core/src/commands/add_scenario.rs:192 — `feature.ends_with(".feature") || feature.starts_with("spec/features/")` appears character-identically in 6 files — rust/fspec-core/src/commands/add_scenario.rs, rust/fspec-core/src/commands/add_step.rs, rust/fspec-core/src/commands/delete_scenario.rs, rust/fspec-core/src/commands/delete_step.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 rust/fspec-core/src/commands/add_scenario.rs:111 — `feature.keyword.is_empty() && feature.name.is_empty() && feature.scenarios.is_empty()` appears character-identically in 3 files — rust/fspec-core/src/commands/add_scenario.rs, rust/fspec-core/src/commands/add_step.rs, rust/fspec-core/src/commands/list_scenario_tags.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X9 · Subsumed condition operand · Subsumed condition operand · ×25
  • Subsumed condition operand rust/agent-loop/tests/rig014_streaming_loop_detection.rs:682 — `bg.contains("build_loop_abort_recovery_message")` can never decide this `||` — every value satisfying `bg.contains("build_loop_abort_recovery_message")` also satisfies `bg.contains("loop_abort_recovery")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/cli/src/interactive/error_classifiers.rs:79 — `lower.contains("input is too long for")` can never decide this `||` — every value satisfying `lower.contains("input is too long for")` also satisfies `lower.contains("input is too long")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/cli/src/interactive/error_classifiers.rs:101 — `error_lower.contains("max allowed size")` can never decide this `||` — every value satisfying `error_lower.contains("max allowed size")` also satisfies `error_lower.contains("size")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/cli/tests/cmpct044_subagent_surface_test.rs:50 — `compactor_src.contains( "true, // sub_agent: the compactor must stay on the 7-tool read-only surface" )` can never decide this `||` — every value satisfying `compactor_src.contains( "true, // sub_agent: the compactor must stay on the 7-tool read-only surface" )` also satisfies `compactor_src.contains("true, // sub_agent")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/common/src/tool_usage.rs:663 — `out.contains("connect")` can never decide this `&&` — every value satisfying `out.contains("disconnect")` also satisfies `out.contains("connect")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec-core/tests/show_coverage.rs:1269 — `body.contains("serde(flatten")` can never decide this `||` — every value satisfying `body.contains("serde(flatten")` also satisfies `body.contains("flatten")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec-tui/tests/source_shape_rpc061.rs:68 — `source.contains("Eq")` can never decide this `&&` — every value satisfying `source.contains("PartialEq")` also satisfies `source.contains("Eq")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec-tui/tests/source_shape_rpc054.rs:99 — `source.contains("scroll_viewport::{ensure_visible")` can never decide this `||` — every value satisfying `source.contains("scroll_viewport::{ensure_visible")` also satisfies `source.contains("ensure_visible")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec-tui/tests/role_banner_integration_rpc022.rs:75 — `row.contains("> Type a message")` can never decide this `||` — every value satisfying `row.contains("> Type a message")` also satisfies `row.contains("> ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec-tui/tests/mux004_mux_config_dialog.rs:290 — `text.contains("Add")` can never decide this `||` — every value satisfying `text.contains("Add")` also satisfies `text.contains("A")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec-tui/tests/mux004_mux_config_dialog.rs:298 — `text.contains("Save")` can never decide this `||` — every value satisfying `text.contains("Save")` also satisfies `text.contains("S")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/status_subcommand_rpc011.rs:232 — `stderr.contains("stale daemon.json removed")` can never decide this `||` — every value satisfying `stderr.contains("stale daemon.json removed")` also satisfies `stderr.contains("stale")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/daemon_mode.rs:123 — `common_body.contains("std::io::stderr")` can never decide this `||` — every value satisfying `common_body.contains("std::io::stderr")` also satisfies `common_body.contains("io::stderr")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/combined_smoke.rs:330 — `body.contains("runtime::Handle::current()")` can never decide this `||` — every value satisfying `body.contains("runtime::Handle::current()")` also satisfies `body.contains("Handle::current()")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_work_unit_status.rs:190 — `stderr.contains("Invalid state transition from 'backlog'")` can never decide this `||` — every value satisfying `stderr.contains("Invalid state transition from 'backlog'")` also satisfies `stderr.contains("backlog")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_work_unit_estimate.rs:103 — `stdout.contains("<id>")` can never decide this `||` — every value satisfying `stdout.contains("<id>")` also satisfies `stdout.contains("id")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_work_unit.rs:108 — `stdout.contains("--title")` can never decide this `||` — every value satisfying `stdout.contains("--title")` also satisfies `stdout.contains("-t")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_work_unit.rs:114 — `stdout.contains("--description")` can never decide this `||` — every value satisfying `stdout.contains("--description")` also satisfies `stdout.contains("-d")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_work_unit.rs:120 — `stdout.contains("--epic")` can never decide this `||` — every value satisfying `stdout.contains("--epic")` also satisfies `stdout.contains("-e")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_work_unit.rs:126 — `stdout.contains("--parent")` can never decide this `||` — every value satisfying `stdout.contains("--parent")` also satisfies `stdout.contains("-p")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_update_prefix.rs:346 — `stdout.contains("combined mode")` can never decide this `||` — every value satisfying `stdout.contains("combined mode")` also satisfies `stdout.contains("combined")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_unlink_coverage.rs:247 — `help.contains("combined mode")` can never decide this `||` — every value satisfying `help.contains("combined mode")` also satisfies `help.contains("combined")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_tag_stats.rs:298 — `help.contains("combined mode")` can never decide this `||` — every value satisfying `help.contains("combined mode")` also satisfies `help.contains("combined")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_show_foundation_event_storm.rs:399 — `stdout.contains("--context")` can never decide this `||` — every value satisfying `stdout.contains("--context")` also satisfies `stdout.contains("context")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand rust/fspec/tests/cli_show_foundation_event_storm.rs:615 — `help.contains("combined mode")` can never decide this `||` — every value satisfying `help.contains("combined mode")` also satisfies `help.contains("combined")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
M4 · Documentation accuracy · README/code drift · ×13
  • README/code drift README.md:25 — README.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/BUILD.md:141 — docs/BUILD.md runs `powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1`, but `https:/raw.githubusercontent.com/sengac/fspec/main/scripts/install.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/BUILD.md:244 — docs/BUILD.md names `target\release-slim\fspec.exe`, but no file or folder `target/release-slim/fspec.exe` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/BUILD.md:355 — docs/BUILD.md names `target/debug/deps`, but no file or folder `target/debug/deps` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/MULTIPLEXING.md:112 — docs/MULTIPLEXING.md names `fspec-config.json`, but no file or folder `fspec-config.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/TESTING.md:65 — docs/TESTING.md names `target/debug/deps`, but no file or folder `target/debug/deps` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/TESTING.md:167 — docs/TESTING.md names `temp_dir.rs`, but no file or folder `temp_dir.rs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/research/BUG-169-slash-submit-interception-research.md:305 — docs/research/BUG-169-slash-submit-interception-research.md names `src/tui`, but no file or folder `src/tui` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/research/BUG-181-board-checkpoint-counter-stale-research.md:98 — docs/research/BUG-181-board-checkpoint-counter-stale-research.md names `update-work-unit-status.ts`, but no file or folder `update-work-unit-status.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/research/BUG-181-board-checkpoint-counter-stale-research.md:98 — docs/research/BUG-181-board-checkpoint-counter-stale-research.md names `restore-checkpoint.ts`, but no file or folder `restore-checkpoint.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/research/BUG-181-board-checkpoint-counter-stale-research.md:99 — docs/research/BUG-181-board-checkpoint-counter-stale-research.md names `cleanup-checkpoints.ts`, but no file or folder `cleanup-checkpoints.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift spec/docs/wt-audit/wt-011.md:52 — spec/docs/wt-audit/wt-011.md names `rust/git/src/isolated_session.rs`, but no file or folder `rust/git/src/isolated_session.rs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift spec/docs/wt-audit/wt-011.md:83 — spec/docs/wt-audit/wt-011.md names `isolated_session.rs`, but no file or folder `isolated_session.rs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D10 · Test Quality · Mock-dominated test · ×6
  • Mock-dominated test: should forward message when user ID is in whitelist bridge/__tests__/telegram-endpoint.test.ts:1118 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should drop message and log when user ID is not in whitelist bridge/__tests__/telegram-endpoint.test.ts:1169 — This test sets up 6 test doubles (for example `vi .spyOn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should allow any user in comma-separated whitelist bridge/__tests__/telegram-endpoint.test.ts:1216 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should allow all users when TELEGRAM_ALLOWED_USER_IDS is not set bridge/__tests__/telegram-endpoint.test.ts:1254 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should drop message when msg.from is undefined and whitelist is active bridge/__tests__/telegram-endpoint.test.ts:1292 — This test sets up 6 test doubles (for example `vi .spyOn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should parse only valid numeric IDs from whitelist bridge/__tests__/telegram-endpoint.test.ts:1340 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
C2 · Access Controls · Thin authorization enforcement · ×1
  • Thin authorization enforcement — Only 1 place(s) refuse an unauthorized caller — too few to demonstrate default-deny across handlers.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: contradicts the code docs/BUILD.md — The native build script `scripts/build.sh` still references protoc installed via Homebrew, but the Rust code uses prost-build to compile .proto schema files during cargo build (the nanograph dependency), so protobuf is required at build time only and no runtime. Update the Build Scripts section to reflect that protoc is a build-time dependency only.
D20 · ADR Quality · ADR has no Decision and Consequences section · ×1
  • ADR has no Decision and Consequences section spec/attachments/PROV-029/discovery-context.md:1 — spec/attachments/PROV-029/discovery-context.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality · ADR has no Context and Consequences section · ×1
  • ADR has no Context and Consequences section spec/attachments/RPC-308/ast-research-show-work-unit.md:1 — spec/attachments/RPC-308/ast-research-show-work-unit.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality · ADR has no Context and Decision and Consequences section · ×1
  • ADR has no Context and Decision and Consequences section spec/attachments/TUI-040/delete-session-research.md:1 — spec/attachments/TUI-040/delete-session-research.md has no Context and Decision and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D26 · Project Cohesion · Split rust/fspec · ×1
  • Split rust/fspec — The fspec project is huge (19k LoC) and sits in a single namespace, so it is a massive grab-bag. Suggested:
D26 · Project Cohesion · Split rust/fspec-core · ×1
  • Split rust/fspec-core — A 75k-LoC project with 259 namespaces across commands, types, io, update, help, generators, validators, and foundation is a sprawling dump. Suggested:
D26 · Project Cohesion · Split rust/tools · ×1
  • Split rust/tools — A huge 50k-LoC project with 14 namespaces (rlcd, profile, unified_exec, session_search, agent_manager, blocklist, stage_permissions, apply_patch, graph_search, deep_search, generate_compaction, schedule, deep_search) is a grab-bag. Suggested:
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 6 ADR-shaped document(s) detected by content — `spec/attachments/CTX-005/context-window-unification-overview.md`, `spec/attachments/PROV-029/discovery-context.md`, `spec/attachments/PROV-120/PROV-120-analysis.md`, `spec/attachments/RLCD-001/rlcd-integration-research.md`, `spec/attachments/RPC-308/ast-research-show-work-unit.md`, `spec/attachments/TUI-040/delete-session-research.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
P10 · Library API & versioning · Large public API surface · ×1
  • Large public API surface — 1537/2071 types (74%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 7897 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code · Unused export 'formatForTelegram' · ×1
  • Unused export 'formatForTelegram' bridge/telegram-formatting.ts:143 — Nothing imports THIS copy of 'formatForTelegram' — but bridge/telegram-endpoint.ts:395 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep bridge/telegram-endpoint.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other.
R7 · Dead Code · Unused export 'getMediaTypeFromPath' · ×1
  • Unused export 'getMediaTypeFromPath' bridge/telegram-formatting.ts:192 — Nothing imports THIS copy of 'getMediaTypeFromPath' — but bridge/telegram-endpoint.ts:248 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep bridge/telegram-endpoint.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other.
R7 · Dead Code · Unused export 'createThinkingBlockHandler' · ×1
  • Unused export 'createThinkingBlockHandler' bridge/telegram-thinking-handler.ts:107 — 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(` (rust/attachment-viewer/src/lib.rs:71).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (rust/attachment-viewer/src/lib.rs:71).
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/1 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~0.3 `!` null assertions per 1k TypeScript source lines — 1 assertion(s) across the 3991 source line(s) of the 13 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: bridge/relay-endpoint-handlers.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Minor — 46 finding(s)
D12 · Dependency Hygiene · Outdated · ×45
  • Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in rust/agent-loop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: arc-swap — `arc-swap` is locked at 1.8.2 but 1.9.3 is the current stable release on crates.io, and it already satisfies the `"1.7"` requirement declared in rust/rpc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arc-swap` and commit the updated REDACTED.
  • Outdated: async-trait — `async-trait` is locked at 0.1.89 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in rust/agent-loop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` and commit the updated REDACTED.
  • Outdated: bytes — `bytes` is locked at 1.11.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in rust/providers/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
  • Outdated: chrono — `chrono` is locked at 0.4.44 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in rust/agent-loop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
  • Outdated: clap — `clap` is locked at 4.6.0 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in rust/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: clap_complete — `clap_complete` is locked at 4.6.0 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in rust/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap_complete` and commit the updated REDACTED.
  • Outdated: dashmap — `dashmap` is locked at 6.1.0 but 6.2.1 is the current stable release on crates.io, and it already satisfies the `"6"` requirement declared in rust/tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p dashmap` and commit the updated REDACTED.
  • Outdated: fastrand — `fastrand` is locked at 2.3.0 but 2.5.0 is the current stable release on crates.io, and it already satisfies the `"2.3.0"` requirement declared in rust/patches/rig-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fastrand` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in rust/fspec-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: futures — `futures` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in rust/agent-loop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
  • Outdated: futures-timer — `futures-timer` is locked at 3.0.3 but 3.0.4 is the current stable release on crates.io, and it already satisfies the `"3.0.3"` requirement declared in rust/patches/rig-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-timer` and commit the updated REDACTED.
  • Outdated: glob — `glob` is locked at 0.3.3 but 0.3.4 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in rust/tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p glob` and commit the updated REDACTED.
  • Outdated: globset — `globset` is locked at 0.4.18 but 0.4.20 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in rust/core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p globset` and commit the updated REDACTED.
  • Outdated: grep-matcher — `grep-matcher` is locked at 0.1.8 but 0.1.9 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in rust/agent-loop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p grep-matcher` and commit the updated REDACTED.
  • Outdated: grep-searcher — `grep-searcher` is locked at 0.1.16 but 0.1.17 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in rust/tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p grep-searcher` and commit the updated REDACTED.
  • Outdated: headless_chrome — `headless_chrome` is locked at 1.0.21 but 1.0.22 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in rust/tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p headless_chrome` and commit the updated REDACTED.
  • Outdated: http — `http` is locked at 1.4.0 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in rust/providers/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http` and commit the updated REDACTED.
  • Outdated: http-body-util — `http-body-util` is locked at 0.1.3 but 0.1.5 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in rust/providers/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body-util` and commit the updated REDACTED.
  • Outdated: hyper — `hyper` is locked at 1.8.1 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in rust/providers/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 rust/providers/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.25 but 0.4.33 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in rust/core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ignore` and commit the updated REDACTED.
  • Outdated: indexmap — `indexmap` is locked at 2.13.0 but 2.14.2 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in rust/fspec-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p indexmap` and commit the updated REDACTED.
  • Outdated: lazy_static — `lazy_static` is locked at 1.5.0 but 1.5.1 is the current stable release on crates.io, and it already satisfies the `"1.4"` requirement declared in rust/core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p lazy_static` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.183 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in rust/tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • + 20 more in this group — see findings.md.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: codelet-common — codelet-common: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a32949f040354ed198cdeae1ad84a44a/history.json --exit-code 0 --source .0—
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .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/** . --skip-db-update45artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .8artifacts/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 1 file(s) — `rust/napi/index.d.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a160b0-ff8a-7e37-be59-ec88e673620a · 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