Public report of SaladDay/cc-switch-cli, published 28 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, 28 October 2026, 07:30 UTC · Survey ID cd_2978775137214e29a43827a4d777d1db

SaladDay/cc-switch-cli

Measured 28 October 2026, 07:28 UTC, at code version b54a105

Regression: 1 dimension fell since the last survey

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

CAI score 56out of 100 Adequate
CriticalWeakAdequateStrongExemplary
No change since the last survey

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

A large codebase: 352,651 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 2.7 person-years · Weakest lens: Production Readiness, 42

Findings by how serious they are

51 critical 1444 serious 102 minor

14 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
28 October 2026, 07:28 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 ▸

60of 60 dimensions measured by tools.
1554of 1597 findings point to an exact file and line, so you can open each one in the code. The other 43 concern the repository as a whole, such as missing documentation.
60dimensions across 6 lenses, read from 352,651 lines of product code in 2 projects.
Chapters

Executive summary

SaladDay/cc-switch-cli falls short of our standard for production, in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 56 out of 100 and is rated Adequate, and all 51 of its critical findings are security problems.

Production Readiness, at 42, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 11 points. Adding automated security scanning would lift Production Readiness itself, worth about 7 points. Raising Production Readiness to 70 would lift the score to about 67.

Thirty-five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nine weaknesses in the code could be used by an attacker, and two known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and updating the vulnerable packages would close these risks. Limiting each secret to its own step would fix the secret exposed to more of the pipeline than needed, and the two pipeline steps that run downloads without checking them need each download checked against a known checksum first.

The product code is 352,651 lines, about €390,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%Security and Compliance 64 · counts for 25%Maturity 65 · counts for 14%Code Health 71 · counts for 8%Architecture 86 · counts for 4%Performance 89 · counts for 2%

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

Code composition: what the lines of code are
Product code 91%Tests 9%
New since the last survey: 41 findings

These 41 critical or serious findings weren't in the previous survey, on 14 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: 30 findings

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

  • Cyclomatic Complexity · ProviderAddFormState::apply_template (cyclomatic 20) src-tauri/src/cli/tui/form/provider_templates.rs
  • Cyclomatic Complexity · cc_switch::services::provider::key_field_live::edit_common (cyclomatic 18) src-tauri/src/services/provider/key_field_live.rs
  • Cognitive Complexity · ProviderAddFormState::apply_template (cognitive 25) src-tauri/src/cli/tui/form/provider_templates.rs
  • Cognitive Complexity · ProviderAddFormState::replace_common_config_snippet (cognitive 17) src-tauri/src/cli/tui/form/provider_state.rs
  • God Classes · MethodTooLong: ProviderAddFormState.apply_template src-tauri/src/cli/tui/form/provider_templates.rs
  • Code Duplication · Near-duplicate member pair (67 shared lines) src-tauri/src/cli/commands/provider.rs
  • Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) src-tauri/src/cli/tui/ui/config.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src-tauri/src/cli/tui/runtime_actions/editor.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/cli/tui/ui/overlay/basic.rs
  • Code Duplication · Duplicated block (16 lines × 2) src-tauri/src/cli/commands/provider.rs
  • Code Duplication · Duplicated block (10 lines × 2) src-tauri/src/services/provider/common_config.rs
  • Code Duplication · Duplicated block (8–9 lines × 2) src-tauri/src/cli/tui/form/provider_json.rs
  • Code Duplication · Duplicated block (7 lines × 2) src-tauri/src/cli/commands/provider.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/cli/tui/ui/overlay/pickers.rs src-tauri/src/cli/tui/ui/overlay/pickers.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/cli/tui/app/content_entities.rs src-tauri/src/cli/tui/app/content_entities.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/cli/tui/app/form_handlers/tab.rs src-tauri/src/cli/tui/app/form_handlers/tab.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/proxy/providers/streaming.rs src-tauri/src/proxy/providers/streaming.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/services/session_usage_codex.rs src-tauri/src/services/session_usage_codex.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/cli/tui/ui/shared.rs src-tauri/src/cli/tui/ui/shared.rs
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/session_manager/cache.rs src-tauri/src/session_manager/cache.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/cli/tui/app/content_usage.rs src-tauri/src/cli/tui/app/content_usage.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/services/session_usage_driver.rs src-tauri/src/services/session_usage_driver.rs
  • Churn × Complexity Hotspots · Hotspot: src-tauri/src/services/provider/common.rs src-tauri/src/services/provider/common.rs
  • Churn × Complexity Hotspots · Repeated repair: src-tauri/src/store.rs src-tauri/src/store.rs
  • Churn × Complexity Hotspots · Repeated repair: src-tauri/src/database/dao/skills.rs src-tauri/src/database/dao/skills.rs
  • Churn × Complexity Hotspots · Repeated repair: src-tauri/src/codex_history_migration.rs src-tauri/src/codex_history_migration.rs
  • Churn × Complexity Hotspots · Repeated repair: src-tauri/src/cli/tui/ui/usage.rs src-tauri/src/cli/tui/ui/usage.rs
  • Change Coupling · Change-coupling hub: REDACTED → config.rs, basic.rs, pickers.rs, render.rs src-tauri/src/cli/tui/app/tests.rs
  • Supply-chain Provenance & Signing REDACTED
Rebuild cost: about €390,000 · Estimate
Cost to rebuild€130,000 to €650,000, for 2,173 to 6,894 hours of work, about 2.7 person-years for 1 to 6 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 56. 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: 352,651 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 11 points · Low effort · REDACTED 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 7 points · Medium effort · Security & performance tooling
3
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 2 points · Low effort · ADR Quality

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 €390,000 to build again, about 2.7 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 REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 11 points for low effort, because it clears the 1 REDACTED 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.9 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 116,088 lines over the last 90 days, which is about 470,801 lines a year. At that pace, the extra work comes to an estimated 33.6 to 201.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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

341 modules, with 749 dependencies between them. 2 loops run through 41 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 301 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 cli.tui.text_edit2 daemon.ipc.protocol3 error4 live.patch.dotenv5 proxy.types6 session_manager.scan_cache_store7 cli.tui.route8 cli.tui.theme9 proxy.server10 services.skill11 session_manager12 services.proxy13 session_manager.paged_manifest14 session_manager.project_scope15 store16 services.provider.claude_editor17 cli.commands.provider18 provider19 cli.tui.form20 database21 settings22 cli.tui.data23 cli.tui.app.types24 cli.tui.app.helpers25 cli.tui.app.app_state26 cli.tui.ui.overlay.pickers27 app_config28 cli.tui.help29 cli.tui.runtime_systems.types30 cli.tui.ui.config31 proxy.forwarder32 proxy.usage.logger33 services.provider34 cli.tui.runtime_actions35 cli.tui.runtime_systems.handlers36 proxy.handlers37 proxy.response38 cli.tui39 cli.tui.runtime_actions.editor40 proxy.response_handler
1 cli.tui.text_edit
2 daemon.ipc.protocol
3 error
4 live.patch.dotenv
5 proxy.types
6 session_manager.scan_cache_store
7 cli.tui.route1
8 cli.tui.theme1
9 proxy.server5121
10 services.skill16
11 session_manager1
12 services.proxy161113
13 session_manager.paged_manifest11
14 session_manager.project_scope1
15 store122
16 services.provider.claude_editor1121
17 cli.commands.provider11141
18 provider11
19 cli.tui.form6236
20 database28114
21 settings4112
22 cli.tui.data1322127
23 cli.tui.app.types52115711426
24 cli.tui.app.helpers14435433
25 cli.tui.app.app_state11511851453
26 cli.tui.ui.overlay.pickers11113112113
27 app_config112
28 cli.tui.help7111
29 cli.tui.runtime_systems.types111
30 cli.tui.ui.config5112561
31 proxy.forwarder2442
32 proxy.usage.logger112
33 services.provider2216114
34 cli.tui.runtime_actions11121312
35 cli.tui.runtime_systems.handlers111111114
36 proxy.handlers111121
37 proxy.response11
38 cli.tui1014261
39 cli.tui.runtime_actions.editor1111111
40 proxy.response_handler231132
Uses a module listed above itPart of a loopThe module itself
1 cli.tui.text_edit2 daemon.ipc.protocol3 error4 live.patch.dotenv5 proxy.types6 session_manager.scan_cache_store7 cli.tui.route8 cli.tui.theme9 proxy.server10 services.skill11 session_manager12 services.proxy13 session_manager.paged_manifest14 session_manager.project_scope15 store16 services.provider.claude_editor17 cli.commands.provider18 provider19 cli.tui.form20 database21 settings22 cli.tui.data23 cli.tui.app.types24 cli.tui.app.helpers25 cli.tui.app.app_state26 cli.tui.ui.overlay.pickers27 app_config28 cli.tui.help29 cli.tui.runtime_systems.types30 cli.tui.ui.config31 proxy.forwarder32 proxy.usage.logger33 services.provider34 cli.tui.runtime_actions35 cli.tui.runtime_systems.handlers36 proxy.handlers37 proxy.response38 cli.tui39 cli.tui.runtime_actions.editor40 proxy.response_handlercli.tui.text_edit1daemon.ipc.protocol2error3live.patch.dotenv4proxy.types5session_manager.scan_cache_store6cli.tui.route7cli.tui.theme8proxy.server9services.skill10session_manager11services.proxy12session_manager.paged_manifest13session_manager.project_scope14store15services.provider.claude_editor16cli.commands.provider17provider18cli.tui.form19database20settings21cli.tui.data22cli.tui.app.types23cli.tui.app.helpers24cli.tui.app.app_state25cli.tui.ui.overlay.pickers26app_config27cli.tui.help28cli.tui.runtime_systems.types29cli.tui.ui.config30proxy.forwarder31proxy.usage.logger32services.provider33cli.tui.runtime_actions34cli.tui.runtime_systems.handlers35proxy.handlers36proxy.response37cli.tui38cli.tui.runtime_actions.editor39proxy.response_handler401151211611611131111221121111411162362811441121322127521157114261443543311511851453111131121131127111111511256124421122216114111213121111111141111211110142611111111231132+301 more modules (most-connected shown)

At a glance — Code Health · 71% · Adequate · gated by D2 ·

At a glance — Architecture · 86% · Adequate · gated by D26 ·

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

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

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

At a glance — Performance · 89% · Strong ·

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
A05:2025 — Injection50High / Critical
A03:2025 — Software Supply Chain Failures38High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Immediately resolve the leaked secret in REDACTED and establish automated security checks in CI to prevent regressions. Strengthen system resilience by enforcing request timeouts and retry logic on all outbound HTTP calls, while documenting disaster recovery procedures with clear recovery targets. Finally, create architectural decision records to ensure design choices are properly documented.

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 REDACTED Scanning — start with REDACTED.+10.9 ptsLowREDACTED 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.+7.1 ptsMediumSecurity & performance tooling
Resolve the 1 No ADRs found finding(s) in ADR Quality.+2.3 ptsLowADR Quality
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2).+1.4 ptsLowStatic Analysis (SAST)
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+3.5 ptsMediumOutbound HTTP resilience
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+1.3 ptsLowBus Factor
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+2.6 ptsMediumDR & Backup
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+2.1 ptsMediumArchitecture documentation

File quality

Per-file score 0–10 — a quality signature. Of 218 files carrying findings, judged against the Production bar: 2% slop · 79% mixed · 19% near-clean.

FileScoreBandWorst signal
REDACTED0.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
src-tauri/src/cli/tui/runtime_systems/handlers.rs5.5MixedCyclomatic Complexity: cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg (cyclomatic 87)
src-tauri/src/cli/tui/ui/overlay/pickers.rs5.5MixedCyclomatic Complexity: cc_switch::cli::tui::ui::overlay::pickers::render_claude_model_picker_overlay (cyclomatic 21)
src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs5.5MixedCyclomatic Complexity: App::handle_confirm_overlay_key (cyclomatic 70)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
src-tauri/src/cli/tui/ui/overlay/basic.rs5.9MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
src-tauri/src/cli/i18n.rs6.3MixedCognitive Complexity: cc_switch::cli::i18n::texts::tui_local_proxy_settings_summary (cognitive 16)
REDACTED6.9MixedStatic Analysis (SAST): Medium: REDACTED
src-tauri/src/cli/tui/ui/forms/provider.rs7.0MixedCyclomatic Complexity: cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value (cyclomatic 120)
src-tauri/src/cli/tui/mod.rs7.0MixedCyclomatic Complexity: cc_switch::cli::tui::run (cyclomatic 110)
src-tauri/src/cli/tui/app/form_handlers/provider.rs7.0MixedCyclomatic Complexity: App::handle_provider_field_activate (cyclomatic 94)
src-tauri/src/cli/tui/form/provider_json.rs7.0MixedCyclomatic Complexity: ProviderAddFormState::to_provider_json_value (cyclomatic 81)
src-tauri/src/cli/tui/app/content_entities.rs7.0MixedCyclomatic Complexity: App::on_sessions_key (cyclomatic 57)

How the grades work

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

Critical — 51

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 1444

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

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

Could not be resolved — 14

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. 60 of 60 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — 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 — 60 dimensions across the health lenses
D1D2D3D4D6D9D12D13D14D15D16D17D19D20D26D28D29D30D34D35D36D43AX10AX3AX4AX9C2M1M2M3M4P1P10P2P3P4P5P6P7PF1PF3S1X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X29X3X30

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, 1554 of 1597 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a18169-2763-7e7d-a850-6e8a93b3c85f.

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 (.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 — `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 — `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.
  • 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 (.rs) and this repository declares a Cargo test suite (src-tauri, 287 test files), but it was not re-run: its build outgrew the 7 GB scratch ceiling (7.127 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • 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.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity5.5 / 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.5 / 10 · rule-coverage 100% · ceiling Prevented

196 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was cc_switch::cli::tui::runtime_actions::handle_action at 164. A further 17 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 cc_switch::cli::tui::help::provider_field_help at 47 — they are counted neither in the figure above nor in this dimension's score. 7 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: src-tauri/src/cli/tui/ui/overlay/render.rs (cc_switch::cli::tui::ui::overlay::render::render_overlay at 42), src-tauri/src/cli/tui/text_edit.rs (TextEditCommand::from_key at 21), src-tauri/src/main.rs (cc_switch::run at 21), src-tauri/src/cli/commands/provider.rs (cc_switch::cli::commands::provider::execute at 17), src-tauri/src/cli/commands/skills.rs (cc_switch::cli::commands::skills::execute at 17), and 2 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.

cc_switch::cli::tui::runtime_actions::handle_action (cyclomatic 164) · ×106src-tauri/src/cli/tui/runtime_actions/mod.rs:514
App::handle_provider_field_activate (cyclomatic 94) · ×35src-tauri/src/cli/tui/app/form_handlers/provider.rs:368
ProviderService::refresh_provider_snapshot (cyclomatic 36) · ×11src-tauri/src/services/provider/mod.rs:1358
ProviderAddFormState::to_provider_json_value (cyclomatic 81) · ×5src-tauri/src/cli/tui/form/provider_json.rs:281
RequestForwarder::prepare_request_with_client (cyclomatic 43) · ×5src-tauri/src/proxy/forwarder/request_builder.rs:126

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with cc_switch::cli::tui::runtime_actions::handle_action (cyclomatic 164). — Refactoring it lifts Cyclomatic Complexity from 5.5 to about 5.8/10.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity2.7 / 10Weak✓ Tool-verified

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

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

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

343 method(s) exceeded the cognitive complexity threshold of 15; the worst was cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses at 387.

cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses (cognitive 387) · ×206src-tauri/src/proxy/providers/streaming_responses.rs:156
App::handle_provider_field_activate (cognitive 129) · ×39src-tauri/src/cli/tui/app/form_handlers/provider.rs:368
ProviderService::fetch_provider_models (cognitive 96) · ×16src-tauri/src/services/provider/models.rs:24
SkillService::migrate_storage (cognitive 92) · ×12src-tauri/src/services/skill.rs:2025
ProviderAddFormState::to_provider_json_value (cognitive 219) · ×8src-tauri/src/cli/tui/form/provider_json.rs:281

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

What to do

  1. Bring the 3 bodies over 240 down to 240 or less in Cognitive Complexity — start with cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses (cognitive 387), cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cognitive 333), cc_switch::cli::tui::run (cognitive 282). — 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 3 together lifts Cognitive Complexity from 2.7 to about 3.5/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

242 god class(es) detected.

FileTooLong: cli/i18n.rs · ×87src-tauri/src/cli/i18n.rs
FunctionTooLong: cc_switch::cli::tui::run · ×71src-tauri/src/cli/tui/mod.rs:3051
MethodTooLong: Database.seed_model_pricing · ×51src-tauri/src/database/schema.rs:1735
ClassTooLong: ProxyService · ×14src-tauri/src/services/proxy.rs:50
TooManyMethods: App · ×12src-tauri/src/cli/tui/app/app_state.rs:722

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

What to do

  1. Resolve the 87 FileTooLong finding(s) in God Classes — start with provider.rs (5), REDACTED (4), types.rs (2). — One of this dimension's main actionable groups (87 warning-level).
  2. Resolve the 71 FunctionTooLong finding(s) in God Classes — start with handlers.rs (7), config.rs (6), provider.rs (6). — One of this dimension's main actionable groups (71 warning-level).
  3. Resolve the 51 MethodTooLong finding(s) in God Classes — start with REDACTED (6), schema.rs (5), skill.rs (4). — One of this dimension's main actionable groups (51 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.2 / 10Stronggated by 569 serious findings✓ Tool-verified

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

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

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

548 duplicated block group(s) detected. A further 21 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (7 lines × 2) · ×47src-tauri/src/app_config.rs:38
Duplicated block (8 lines × 2) · ×44src-tauri/src/cli/commands/config.rs:329
Duplicated block (9 lines × 2) · ×38src-tauri/src/cli/commands/provider_input.rs:141
Duplicated block (5 lines × 2) · ×36src-tauri/src/claude_mcp.rs:76
Duplicated block (10 lines × 2) · ×33src-tauri/src/claude_mcp.rs:173

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

What to do

  1. Resolve the 47 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with provider.rs (5), editor_state.rs (3), app_config.rs (2). — One of this dimension's main actionable groups (47 warning-level).
  2. Resolve the 44 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with provider_input.rs (3), codex_config.rs (3), prompts.rs (2). — One of this dimension's main actionable groups (44 warning-level).
  3. Resolve the 38 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with editor.rs (4), helpers.rs (3), workers.rs (3). — One of this dimension's main actionable groups (38 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 140 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_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

5076 test methods: 4576 unit, 500 integration, 0 BDD, 0 e2e. The Rust suite contributes 5071 `#[test]` function(s) across 287 file(s) declaring at least one; its unit/integration split is Cargo's own — 44 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 5 test function(s) across 1 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D12 · Dependency Hygiene8.6 / 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 8.6 / 10 · rule-coverage 100% · ceiling Verified

29 outdated, 0 yanked direct Cargo dependencies. 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 · ×29

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 · REDACTED 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 REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce REDACTED 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 481 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.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.7 / 10Strong✓ Tool-verified

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

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

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

Top hotspots: src-tauri/src/cli/tui/mod.rs (16×110=1760); src-tauri/src/cli/tui/runtime_actions/mod.rs (10×164=1640); src-tauri/src/cli/tui/ui/forms/provider.rs (12×120=1440) Repeated repair below the complexity floor: src-tauri/src/codex_config.rs (5 of 8 changes were fixes); src-tauri/src/cli/provider_quota.rs (5 of 7 changes were fixes); src-tauri/src/services/sync_protocol.rs (4 of 5 changes were fixes)

Hotspot: src-tauri/src/cli/tui/mod.rs · ×38src-tauri/src/cli/tui/mod.rs:3051
Repeated repair: src-tauri/src/codex_config.rs · ×8src-tauri/src/codex_config.rs:3494

What to do

  1. Resolve the 38 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (4), provider.rs (3), handlers.rs (2). — One of this dimension's main actionable groups (38 warning-level).
  2. Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with codex.rs (2), codex_config.rs, provider_quota.rs. — One of this dimension's main actionable groups (8 warning-level).

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

D16 · Bus Factor6.2 / 10Adequate✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

133 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src-tauri/src/cli/tui/app/tests.rs. Counted over 347 of the 390 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D26 · Project Cohesion0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 build units (Cargo, checkout) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

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

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)1.1 / 10Critical✓ 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 1.1 / 10 · rule-coverage 100% · ceiling Documented

50 finding(s): 0 critical, 47 high, 3 medium, 0 low. 35 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 3 file(s) — `REDACTED` (line 61, line 65, line 66), `src-tauri/src/cli/tui/app/tests.rs`, `REDACTED` — 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

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

What to do

  1. Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (9 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. No action in Static Analysis (SAST) — all 35 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 (35 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities3.1 / 10Weak✓ 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 3.1 / 10 · rule-coverage 100% · ceiling Documented

33 finding(s): 0 critical, 2 high, 30 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 16 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (16). — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 2 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 9 Medium vulnerability 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.

D34 · Knowledge Freshness9.7 / 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 9.7 / 10 · rule-coverage 100% · ceiling Documented

12 of 347 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src-tauri/src/claude_mcp.rs. Counted over 347 of the 390 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×12src-tauri/src/claude_mcp.rs:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.5 / 10Stronggated by 6 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: REDACTED↔render.rs 94%; REDACTED↔pickers.rs 87%; i18n.rs↔render.rs 81%

Change coupling: basic.rs ↔ REDACTED · ×4src-tauri/src/cli/tui/ui/overlay/basic.rs:1
Change-coupling hub: REDACTED → basic.rs, pickers.rs, render.rs · ×2src-tauri/src/cli/tui/app/tests.rs

What to do

  1. Resolve the 4 Change coupling finding(s) in Change Coupling — start with basic.rs, pickers.rs, handlers.rs. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with REDACTED, i18n.rs. — One of this dimension's main actionable groups (2 warning-level).

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ 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 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.6 / 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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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 Controls7.0 / 10Strong✓ 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.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
M1 · Documentation (README)8.0 / 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

  • Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

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

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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

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

P2 · Observability8.0 / 10Strong✓ Tool-verified

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

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

What to do

  • Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling0.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 26952 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.
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
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.

  • `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. — src-tauri/src/services/stream_check/provider_extract.rs:188

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.

S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

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

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

  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is 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(` (src-tauri/src/proxy/server.rs:274).

What to do

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

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.

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.

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

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

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

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — scripts/benchmark_cc_switch.py:150
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×5) — scripts/benchmark_cc_switch.py:927, scripts/benchmark_cc_switch.py:985, scripts/benchmark_cc_switch.py:1172, …

What to do

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

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

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

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 Health71%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture86%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness42%Weak — gated by P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security64%Adequate — gated by D29, D30, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance89%StrongStrongest area.
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 — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 56 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: 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.
  • 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.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — 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.
  • D10 Test Quality — ~34514 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D5 Coupling — Not applicable — this Cargo build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (49 value object(s))
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • 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.
  • X16 Unfloored truncation loop — 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
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 51 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 10 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×2
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 1444 finding(s)
D2 · Cognitive Complexity · cc_switch · ×206
  • cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses (cognitive 387) src-tauri/src/proxy/providers/streaming_responses.rs:156 — cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses has cognitive complexity 387 (threshold 15). Drivers by points: if/else 70 (355 pts), match/switch 4 (15 pts), loops 4 (14 pts), boolean chains 3 (nesting depth added 306). 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.
  • cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cognitive 333) src-tauri/src/proxy/providers/streaming.rs:92 — cc_switch::proxy::providers::streaming::create_anthropic_sse_stream has cognitive complexity 333 (threshold 15). Drivers by points: if/else 51 (292 pts), loops 7 (34 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 269). 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.
  • cc_switch::cli::tui::run (cognitive 282) src-tauri/src/cli/tui/mod.rs:3051 — cc_switch::cli::tui::run has cognitive complexity 282 (threshold 15). Drivers by points: if/else 68 (194 pts), loops 17 (48 pts), match/switch 21 (39 pts), boolean chains 1 (nesting depth added 175). 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.
  • cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg (cognitive 175) src-tauri/src/cli/tui/runtime_systems/handlers.rs:425 — cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg has cognitive complexity 175 (threshold 15). Drivers by points: if/else 51 (137 pts), match/switch 11 (21 pts), boolean chains 12, loops 2 (5 pts) (nesting depth added 99). 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.
  • cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini (cognitive 129) src-tauri/src/proxy/providers/streaming_gemini.rs:240 — cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini has cognitive complexity 129 (threshold 15). Drivers by points: if/else 33 (114 pts), loops 4 (9 pts), match/switch 2 (6 pts) (nesting depth added 90). 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.
  • cc_switch::session_manager::transcript::scan_named_json_array (cognitive 129) src-tauri/src/session_manager/transcript.rs:2436 — cc_switch::session_manager::transcript::scan_named_json_array has cognitive complexity 129 (threshold 15). Drivers by points: if/else 34 (109 pts), boolean chains 9, match/switch 2 (8 pts), loops 2 (3 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • cc_switch::daemon::migration::quiesce_for_database_migration (cognitive 118) src-tauri/src/daemon/migration.rs:396 — cc_switch::daemon::migration::quiesce_for_database_migration has cognitive complexity 118 (threshold 15). Drivers by points: if/else 26 (84 pts), match/switch 10 (30 pts), loops 2 (4 pts) (nesting depth added 80). 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.
  • cc_switch::mcp::import_from_codex (cognitive 117) src-tauri/src/mcp.rs:424 — cc_switch::mcp::import_from_codex has cognitive complexity 117 (threshold 15). Drivers by points: if/else 37 (94 pts), loops 5 (14 pts), match/switch 4 (9 pts) (nesting depth added 71). 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.
  • cc_switch::cli::tui::runtime_systems::handlers::handle_webdav_msg (cognitive 87) src-tauri/src/cli/tui/runtime_systems/handlers.rs:1513 — cc_switch::cli::tui::runtime_systems::handlers::handle_webdav_msg has cognitive complexity 87 (threshold 15). Drivers by points: match/switch 17 (52 pts), if/else 12 (33 pts), boolean chains 2 (nesting depth added 56). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
  • cc_switch::cli::commands::provider_input::display_provider_summary (cognitive 76) src-tauri/src/cli/commands/provider_input.rs:4509 — cc_switch::cli::commands::provider_input::display_provider_summary has cognitive complexity 76 (threshold 15). Drivers by points: if/else 37 (73 pts), boolean chains 2, match/switch 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • cc_switch::proxy::forwarder::request_builder::build_request (cognitive 74) src-tauri/src/proxy/forwarder/request_builder.rs:516 — cc_switch::proxy::forwarder::request_builder::build_request has cognitive complexity 74 (threshold 15). Drivers by points: if/else 32 (48 pts), match/switch 4 (12 pts), boolean chains 8, loops 2 (6 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • cc_switch::services::session_usage_codex::sync_single_codex_file (cognitive 69) src-tauri/src/services/session_usage_codex.rs:1530 — cc_switch::services::session_usage_codex::sync_single_codex_file has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (46 pts), match/switch 11 (18 pts), boolean chains 5 (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.
  • cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic (cognitive 68) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:226 — cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (58 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages (cognitive 68) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:505 — cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages has cognitive complexity 68 (threshold 15). Drivers by points: if/else 15 (52 pts), match/switch 3 (10 pts), loops 2 (5 pts), boolean chains 1 (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.
  • cc_switch::cli::tui::handle_usage_pricing_msg (cognitive 65) src-tauri/src/cli/tui/mod.rs:1237 — cc_switch::cli::tui::handle_usage_pricing_msg has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (48 pts), boolean chains 10, match/switch 4 (7 pts) (nesting depth added 32). 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.
  • cc_switch::cli::tui::runtime_actions::handle_action (cognitive 64) src-tauri/src/cli/tui/runtime_actions/mod.rs:514 — cc_switch::cli::tui::runtime_actions::handle_action has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (52 pts), match/switch 4 (7 pts), boolean chains 5 (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.
  • cc_switch::proxy::cache_injector::inject (cognitive 63) src-tauri/src/proxy/cache_injector.rs:5 — cc_switch::proxy::cache_injector::inject has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value (cognitive 63) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:1385 — cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (54 pts), match/switch 3 (5 pts), boolean chains 2, loops 2 (nesting depth added 34). 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.
  • cc_switch::proxy::providers::streaming_codex_anthropic::create_responses_sse_stream_from_anthropic_with_context (cognitive 62) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:667 — cc_switch::proxy::providers::streaming_codex_anthropic::create_responses_sse_stream_from_anthropic_with_context has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 7 (24 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • cc_switch::proxy::providers::transform::openai_to_anthropic (cognitive 62) src-tauri/src/proxy/providers/transform.rs:541 — cc_switch::proxy::providers::transform::openai_to_anthropic has cognitive complexity 62 (threshold 15). Drivers by points: if/else 20 (47 pts), match/switch 3 (8 pts), loops 2 (5 pts), boolean chains 2 (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.
  • cc_switch::proxy::providers::transform::convert_message_to_openai (cognitive 60) src-tauri/src/proxy/providers/transform.rs:315 — cc_switch::proxy::providers::transform::convert_message_to_openai has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (47 pts), match/switch 3 (9 pts), boolean chains 2, loops 1 (2 pts) (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.
  • cc_switch::session_manager::providers::codex::parse_session_lines (cognitive 59) src-tauri/src/session_manager/providers/codex.rs:866 — cc_switch::session_manager::providers::codex::parse_session_lines has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 6, match/switch 2 (3 pts), loops 2 (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.
  • cc_switch::cli::tui::runtime_systems::handlers::handle_skills_msg (cognitive 58) src-tauri/src/cli/tui/runtime_systems/handlers.rs:1278 — cc_switch::cli::tui::runtime_systems::handlers::handle_skills_msg has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 6 (11 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 34). 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.
  • cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value (cognitive 58) src-tauri/src/cli/tui/ui/forms/provider.rs:1916 — cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value has cognitive complexity 58 (threshold 15). Drivers by points: if/else 36 (53 pts), match/switch 4 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • cc_switch::proxy::providers::streaming_codex_chat::create_responses_sse_stream_from_chat_with_context (cognitive 56) src-tauri/src/proxy/providers/streaming_codex_chat.rs:927 — cc_switch::proxy::providers::streaming_codex_chat::create_responses_sse_stream_from_chat_with_context has cognitive complexity 56 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 6 (19 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 181 more in this group — see findings.md.
D1 · Cyclomatic Complexity · cc_switch · ×106
  • cc_switch::cli::tui::runtime_actions::handle_action (cyclomatic 164) src-tauri/src/cli/tui/runtime_actions/mod.rs:514 — cc_switch::cli::tui::runtime_actions::handle_action has cyclomatic complexity 164 (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.
  • cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value (cyclomatic 120) src-tauri/src/cli/tui/ui/forms/provider.rs:1916 — cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value has cyclomatic complexity 120 (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.
  • cc_switch::cli::tui::run (cyclomatic 110) src-tauri/src/cli/tui/mod.rs:3051 — cc_switch::cli::tui::run has cyclomatic complexity 110 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg (cyclomatic 87) src-tauri/src/cli/tui/runtime_systems/handlers.rs:425 — cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses (cyclomatic 84) src-tauri/src/proxy/providers/streaming_responses.rs:156 — cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::cli::tui::help::current_help_target (cyclomatic 62) src-tauri/src/cli/tui/help.rs:104 — cc_switch::cli::tui::help::current_help_target has cyclomatic complexity 62 (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.
  • cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cyclomatic 60) src-tauri/src/proxy/providers/streaming.rs:92 — cc_switch::proxy::providers::streaming::create_anthropic_sse_stream has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::mcp::import_from_codex (cyclomatic 52) src-tauri/src/mcp.rs:424 — cc_switch::mcp::import_from_codex has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::session_manager::transcript::scan_named_json_array (cyclomatic 52) src-tauri/src/session_manager/transcript.rs:2436 — cc_switch::session_manager::transcript::scan_named_json_array has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::daemon::migration::quiesce_for_database_migration (cyclomatic 51) src-tauri/src/daemon/migration.rs:396 — cc_switch::daemon::migration::quiesce_for_database_migration has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::cli::commands::provider_input::display_provider_summary (cyclomatic 45) src-tauri/src/cli/commands/provider_input.rs:4509 — cc_switch::cli::commands::provider_input::display_provider_summary 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.
  • cc_switch::proxy::forwarder::request_builder::build_request (cyclomatic 44) src-tauri/src/proxy/forwarder/request_builder.rs:516 — cc_switch::proxy::forwarder::request_builder::build_request has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::services::session_usage_codex::sync_single_codex_file (cyclomatic 44) src-tauri/src/services/session_usage_codex.rs:1530 — cc_switch::services::session_usage_codex::sync_single_codex_file has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic (cyclomatic 43) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:226 — cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::cli::tui::runtime_systems::handlers::handle_webdav_msg (cyclomatic 41) src-tauri/src/cli/tui/runtime_systems/handlers.rs:1513 — cc_switch::cli::tui::runtime_systems::handlers::handle_webdav_msg has cyclomatic complexity 41 (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.
  • cc_switch::cli::tui::handle_usage_pricing_msg (cyclomatic 40) src-tauri/src/cli/tui/mod.rs:1237 — cc_switch::cli::tui::handle_usage_pricing_msg 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.
  • cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value (cyclomatic 39) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:1385 — cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini (cyclomatic 37) src-tauri/src/proxy/providers/streaming_gemini.rs:240 — cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • cc_switch::proxy::providers::transform::openai_to_anthropic (cyclomatic 32) src-tauri/src/proxy/providers/transform.rs:541 — cc_switch::proxy::providers::transform::openai_to_anthropic 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.
  • cc_switch::services::session_usage::sync_single_file (cyclomatic 32) src-tauri/src/services/session_usage.rs:859 — cc_switch::services::session_usage::sync_single_file 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.
  • cc_switch::cli::tui::ui::render_content (cyclomatic 31) src-tauri/src/cli/tui/ui.rs:137 — cc_switch::cli::tui::ui::render_content has cyclomatic complexity 31 (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.
  • cc_switch::session_manager::providers::utils::build_snippet_cancellable (cyclomatic 31) src-tauri/src/session_manager/providers/utils.rs:427 — cc_switch::session_manager::providers::utils::build_snippet_cancellable 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.
  • cc_switch::cli::tui::ui::forms::mcp::mcp_field_label_and_value (cyclomatic 30) src-tauri/src/cli/tui/ui/forms/mcp.rs:372 — cc_switch::cli::tui::ui::forms::mcp::mcp_field_label_and_value has cyclomatic complexity 30 (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.
  • cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages (cyclomatic 30) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:505 — cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages 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.
  • cc_switch::session_manager::cache::process_stream_batch (cyclomatic 29) src-tauri/src/session_manager/cache.rs:471 — cc_switch::session_manager::cache::process_stream_batch has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 81 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×87
  • FileTooLong: cli/i18n.rs src-tauri/src/cli/i18n.rs — FileTooLong — 8445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 1634 free functions. The bar is 500 significant lines; this is 7945 over it, 16.89× 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: app/types.rs src-tauri/src/cli/tui/app/types.rs — FileTooLong — 3602 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 3102 over it, 7.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ui/config.rs src-tauri/src/cli/tui/ui/config.rs — FileTooLong — 3186 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 109 free functions. The bar is 500 significant lines; this is 2686 over it, 6.37× 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: services/proxy.rs src-tauri/src/services/proxy.rs — FileTooLong — 3082 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: ProxyService (2 blocks, 50-4306). The bar is 500 significant lines; this is 2582 over it, 6.16× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: provider/mod.rs src-tauri/src/services/provider/mod.rs — FileTooLong — 2938 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: ProviderService (373-4129). The bar is 500 significant lines; this is 2438 over it, 5.88× 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: runtime_systems/workers.rs src-tauri/src/cli/tui/runtime_systems/workers.rs — FileTooLong — 2876 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 2376 over it, 5.75× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tui/data.rs src-tauri/src/cli/tui/data.rs — FileTooLong — 2757 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 85 free functions. The bar is 500 significant lines; this is 2257 over it, 5.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tui/mod.rs src-tauri/src/cli/tui/mod.rs — FileTooLong — 2721 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 2221 over it, 5.44× 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: services/skill.rs src-tauri/src/services/skill.rs — FileTooLong — 2544 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: SkillService (630-3753). The bar is 500 significant lines; this is 2044 over it, 5.09× 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: form/provider_state.rs src-tauri/src/cli/tui/form/provider_state.rs — FileTooLong — 2382 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 1882 over it, 4.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: commands/provider_input.rs src-tauri/src/cli/commands/provider_input.rs — FileTooLong — 2242 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 80 free functions. The bar is 500 significant lines; this is 1742 over it, 4.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: session_manager/transcript.rs src-tauri/src/session_manager/transcript.rs — FileTooLong — 2214 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 1714 over it, 4.43× 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: overlay/pickers.rs src-tauri/src/cli/tui/ui/overlay/pickers.rs — FileTooLong — 1999 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 1499 over it, 4.00× 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: database/schema.rs src-tauri/src/database/schema.rs — FileTooLong — 1908 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 100% of them inside a single declaration: Database (9-3475). The bar is 500 significant lines; this is 1408 over it, 3.82× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: session_manager/paged_manifest.rs src-tauri/src/session_manager/paged_manifest.rs — FileTooLong — 1778 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 1278 over it, 3.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: forms/provider.rs src-tauri/src/cli/tui/ui/forms/provider.rs — FileTooLong — 1713 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 1213 over it, 3.43× 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/provider.rs src-tauri/src/cli/commands/provider.rs — FileTooLong — 1627 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 69 free functions. The bar is 500 significant lines; this is 1127 over it, 3.25× 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: services/usage_stats.rs src-tauri/src/services/usage_stats.rs — FileTooLong — 1550 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: Database (2 blocks, 491-1738). The bar is 500 significant lines; this is 1050 over it, 3.10× 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: form_handlers/provider.rs src-tauri/src/cli/tui/app/form_handlers/provider.rs — FileTooLong — 1515 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: App (12-1967). The bar is 500 significant lines; this is 1015 over it, 3.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1437 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 937 over it, 2.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: runtime_systems/handlers.rs src-tauri/src/cli/tui/runtime_systems/handlers.rs — FileTooLong — 1425 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 925 over it, 2.85× 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/codex_config.rs src-tauri/src/codex_config.rs — FileTooLong — 1409 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 88 free functions. The bar is 500 significant lines; this is 909 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: providers/transform_codex_chat.rs src-tauri/src/proxy/providers/transform_codex_chat.rs — FileTooLong — 1355 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 57 free functions. The bar is 500 significant lines; this is 855 over it, 2.71× 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: overlay_handlers/pickers.rs src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs — FileTooLong — 1348 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: App (80-1892). The bar is 500 significant lines; this is 848 over it, 2.70× 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: app/helpers.rs src-tauri/src/cli/tui/app/helpers.rs — FileTooLong — 1308 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 69 free functions. The bar is 500 significant lines; this is 808 over it, 2.62× 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.
  • + 62 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×71
  • FunctionTooLong: cc_switch::cli::tui::run src-tauri/src/cli/tui/mod.rs:3051 — FunctionTooLong — cc_switch::cli::tui::run runs 595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 495 over it, 5.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::runtime_actions::handle_action src-tauri/src/cli/tui/runtime_actions/mod.rs:514 — FunctionTooLong — cc_switch::cli::tui::runtime_actions::handle_action runs 517 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 417 over it, 5.17× 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: cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg src-tauri/src/cli/tui/runtime_systems/handlers.rs:425 — FunctionTooLong — cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg runs 435 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 335 over it, 4.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::ui::overlay::render::render_overlay src-tauri/src/cli/tui/ui/overlay/render.rs:4 — FunctionTooLong — cc_switch::cli::tui::ui::overlay::render::render_overlay runs 321 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 221 over it, 3.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: cc_switch::cli::tui::ui::config::render_openclaw_agents_route src-tauri/src/cli/tui/ui/config.rs:2294 — FunctionTooLong — cc_switch::cli::tui::ui::config::render_openclaw_agents_route runs 302 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 202 over it, 3.02× 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: cc_switch::cli::tui::runtime_systems::workers::handle_session_req src-tauri/src/cli/tui/runtime_systems/workers.rs:1524 — FunctionTooLong — cc_switch::cli::tui::runtime_systems::workers::handle_session_req runs 283 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 183 over it, 2.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: cc_switch::cli::tui::help::provider_field_help src-tauri/src/cli/tui/help.rs:618 — FunctionTooLong — cc_switch::cli::tui::help::provider_field_help runs 248 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::proxy::handlers::handle_passthrough_request src-tauri/src/proxy/handlers.rs:560 — FunctionTooLong — cc_switch::proxy::handlers::handle_passthrough_request runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value src-tauri/src/cli/tui/ui/forms/provider.rs:1916 — FunctionTooLong — cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value runs 229 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::ui::main_page::render_main src-tauri/src/cli/tui/ui/main_page.rs:47 — FunctionTooLong — cc_switch::cli::tui::ui::main_page::render_main runs 216 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 116 over it, 2.16× 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: cc_switch::services::session_usage_codex::sync_single_codex_file src-tauri/src/services/session_usage_codex.rs:1530 — FunctionTooLong — cc_switch::services::session_usage_codex::sync_single_codex_file runs 213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::daemon::migration::quiesce_for_database_migration src-tauri/src/daemon/migration.rs:396 — FunctionTooLong — cc_switch::daemon::migration::quiesce_for_database_migration runs 210 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 110 over it, 2.10× 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: cc_switch::cli::tui::ui::config::render_openclaw_tools_route src-tauri/src/cli/tui/ui/config.rs:1400 — FunctionTooLong — cc_switch::cli::tui::ui::config::render_openclaw_tools_route runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::proxy::handlers::handle_claude_request src-tauri/src/proxy/handlers.rs:219 — FunctionTooLong — cc_switch::proxy::handlers::handle_claude_request runs 189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::runtime_systems::workers::session_dispatcher_loop_with src-tauri/src/cli/tui/runtime_systems/workers.rs:1245 — FunctionTooLong — cc_switch::cli::tui::runtime_systems::workers::session_dispatcher_loop_with runs 188 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 88 over it, 1.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: cc_switch::cli::tui::ui::overlay::pickers::render_claude_model_picker_overlay src-tauri/src/cli/tui/ui/overlay/pickers.rs:83 — FunctionTooLong — cc_switch::cli::tui::ui::overlay::pickers::render_claude_model_picker_overlay runs 184 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 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::runtime_systems::handlers::handle_webdav_msg src-tauri/src/cli/tui/runtime_systems/handlers.rs:1513 — FunctionTooLong — cc_switch::cli::tui::runtime_systems::handlers::handle_webdav_msg runs 181 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 81 over it, 1.81× 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: cc_switch::proxy::forwarder::request_builder::build_request src-tauri/src/proxy/forwarder/request_builder.rs:516 — FunctionTooLong — cc_switch::proxy::forwarder::request_builder::build_request 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: cc_switch::proxy::handlers::finish_codex_live_aware_response src-tauri/src/proxy/handlers.rs:1060 — FunctionTooLong — cc_switch::proxy::handlers::finish_codex_live_aware_response 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: cc_switch::cli::commands::provider_inspect::quota_provider src-tauri/src/cli/commands/provider_inspect.rs:428 — FunctionTooLong — cc_switch::cli::commands::provider_inspect::quota_provider runs 165 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 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::handle_tui_action src-tauri/src/cli/tui/mod.rs:2495 — FunctionTooLong — cc_switch::cli::tui::handle_tui_action runs 160 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 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages src-tauri/src/proxy/providers/transform_codex_anthropic.rs:505 — FunctionTooLong — cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages runs 160 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 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::commands::provider_input::display_provider_summary src-tauri/src/cli/commands/provider_input.rs:4509 — FunctionTooLong — cc_switch::cli::commands::provider_input::display_provider_summary runs 158 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 58 over it, 1.58× 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: cc_switch::proxy::providers::transform_codex_chat::append_responses_item_as_chat_message src-tauri/src/proxy/providers/transform_codex_chat.rs:652 — FunctionTooLong — cc_switch::proxy::providers::transform_codex_chat::append_responses_item_as_chat_message runs 157 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 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cc_switch::cli::tui::ui::config::render_settings src-tauri/src/cli/tui/ui/config.rs:3426 — FunctionTooLong — cc_switch::cli::tui::ui::config::render_settings runs 154 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 54 over it, 1.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.
  • + 46 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×51
  • MethodTooLong: Database.seed_model_pricing src-tauri/src/database/schema.rs:1735 — MethodTooLong — seed_model_pricing runs 467 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 367 over it, 4.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: ProviderAddFormState.to_provider_json_value src-tauri/src/cli/tui/form/provider_json.rs:281 — MethodTooLong — to_provider_json_value runs 366 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 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.on_sessions_key src-tauri/src/cli/tui/app/content_entities.rs:688 — MethodTooLong — on_sessions_key runs 281 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 181 over it, 2.81× 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: Database.create_tables_on_conn src-tauri/src/database/schema.rs:17 — MethodTooLong — create_tables_on_conn runs 272 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 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.handle_provider_field_activate src-tauri/src/cli/tui/app/form_handlers/provider.rs:368 — MethodTooLong — handle_provider_field_activate runs 261 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 161 over it, 2.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: ProviderService.refresh_provider_snapshot src-tauri/src/services/provider/mod.rs:1358 — MethodTooLong — refresh_provider_snapshot runs 224 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 124 over it, 2.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: Database.get_daily_trends src-tauri/src/services/usage_stats.rs:758 — MethodTooLong — get_daily_trends runs 216 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 116 over it, 2.16× 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: RequestForwarder.prepare_request_with_client src-tauri/src/proxy/forwarder/request_builder.rs:126 — MethodTooLong — prepare_request_with_client runs 211 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.handle_confirm_overlay_key src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:75 — MethodTooLong — handle_confirm_overlay_key runs 200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProviderAddFormState.update_provider_meta src-tauri/src/cli/tui/form/provider_json.rs:844 — MethodTooLong — update_provider_meta runs 199 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 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.handle_text_input_submit src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:388 — MethodTooLong — handle_text_input_submit runs 184 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 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProviderAddFormState.apply_template_fields src-tauri/src/cli/tui/form/provider_templates.rs:501 — MethodTooLong — apply_template_fields runs 181 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 81 over it, 1.81× 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: SkillService.migrate_storage src-tauri/src/services/skill.rs:2025 — MethodTooLong — migrate_storage runs 181 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 81 over it, 1.81× 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: Database.validate_imported_schema_contract REDACTED:1007 — MethodTooLong — validate_imported_schema_contract 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: RequestForwarder.forward_response_detailed src-tauri/src/proxy/forwarder.rs:244 — MethodTooLong — forward_response_detailed runs 155 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 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RequestForwarder.forward_buffered_response_detailed src-tauri/src/proxy/forwarder.rs:489 — MethodTooLong — forward_buffered_response_detailed runs 155 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 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.on_settings_key src-tauri/src/cli/tui/app/content_config.rs:840 — MethodTooLong — on_settings_key runs 153 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 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CodexOAuthManager.add_account_internal src-tauri/src/proxy/providers/codex_oauth_auth.rs:1157 — MethodTooLong — add_account_internal runs 149 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 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProviderService.prepare_post_commit_action src-tauri/src/services/provider/mod.rs:1007 — MethodTooLong — prepare_post_commit_action runs 149 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 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Database.apply_schema_migrations_on_conn src-tauri/src/database/schema.rs:431 — MethodTooLong — apply_schema_migrations_on_conn 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.
  • MethodTooLong: RequestForwarder.send_streaming_request src-tauri/src/proxy/forwarder.rs:706 — MethodTooLong — send_streaming_request runs 141 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 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RequestForwarder.send_buffered_request src-tauri/src/proxy/forwarder.rs:903 — MethodTooLong — send_buffered_request runs 141 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 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TranscriptIndexStore.build src-tauri/src/session_manager/transcript.rs:705 — MethodTooLong — build runs 139 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 39 over it, 1.39× 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: ProviderAddFormState.apply_sponsor_preset src-tauri/src/cli/tui/form/provider_templates.rs:739 — MethodTooLong — apply_sponsor_preset runs 136 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 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: App.clamp_selections src-tauri/src/cli/tui/app/menu.rs:1174 — MethodTooLong — clamp_selections runs 132 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 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 26 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×47
  • Duplicated block (7 lines × 2) src-tauri/src/app_config.rs:38 — src-tauri/src/app_config.rs:38-44 | src-tauri/src/app_config.rs:107-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src-tauri/src/app_config.rs:428 — src-tauri/src/app_config.rs:428-434 | src-tauri/src/settings.rs:137-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/cli/commands/provider.rs:1842 — src-tauri/src/cli/commands/provider.rs:1842-1848 | src-tauri/src/cli/commands/provider.rs:2085-2091 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/editor_state.rs:264 — src-tauri/src/cli/tui/app/editor_state.rs:264-270 | src-tauri/src/cli/tui/app/editor_state.rs:305-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src-tauri/src/cli/tui/app/editor_state.rs:641 — src-tauri/src/cli/tui/app/editor_state.rs:641-647 | src-tauri/src/cli/tui/app/editor_state.rs:777-783 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/editor_state.rs:663 — src-tauri/src/cli/tui/app/editor_state.rs:663-669 | src-tauri/src/cli/tui/app/editor_state.rs:689-695 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/form_handlers/provider.rs:779 — src-tauri/src/cli/tui/app/form_handlers/provider.rs:779-785 | src-tauri/src/cli/tui/app/form_handlers/provider.rs:832-838 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/form_handlers/provider.rs:1316 — src-tauri/src/cli/tui/app/form_handlers/provider.rs:1316-1322 | src-tauri/src/cli/tui/app/form_handlers/provider.rs:1328-1334 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/chrome.rs:463 — src-tauri/src/cli/tui/ui/chrome.rs:463-469 | src-tauri/src/cli/tui/ui/chrome.rs:473-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src-tauri/src/cli/tui/ui/forms/provider.rs:579 — src-tauri/src/cli/tui/ui/forms/provider.rs:579-585 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:1039-1045 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/provider.rs` and `src-tauri/src/cli/tui/ui/overlay/pickers.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) src-tauri/src/database/dao/proxy.rs:351 — src-tauri/src/database/dao/proxy.rs:351-357 | src-tauri/src/database/dao/proxy.rs:397-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src-tauri/src/live/project/codex.rs:315 — src-tauri/src/live/project/codex.rs:315-321 | src-tauri/src/live/project/codex.rs:325-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 (7 lines × 2) src-tauri/src/mcp.rs:543 — src-tauri/src/mcp.rs:543-549 | src-tauri/src/mcp.rs:565-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src-tauri/src/mcp.rs:1176 — src-tauri/src/mcp.rs:1176-1182 | src-tauri/src/mcp.rs:1192-1198 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/codex_chat_history.rs:377 — src-tauri/src/proxy/providers/codex_chat_history.rs:377-383 | src-tauri/src/proxy/providers/streaming_gemini.rs:263-270 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:97 — src-tauri/src/proxy/providers/streaming_responses.rs:97-103 | src-tauri/src/proxy/providers/streaming_responses.rs:108-114 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:878 — src-tauri/src/proxy/providers/transform_codex_anthropic.rs:878-884 | src-tauri/src/proxy/providers/transform_responses.rs:208-214 — before extracting anything, compare `src-tauri/src/proxy/providers/transform_codex_anthropic.rs` and `src-tauri/src/proxy/providers/transform_responses.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.
  • Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/transform_gemini.rs:186 — src-tauri/src/proxy/providers/transform_gemini.rs:186-192 | src-tauri/src/proxy/providers/transform_gemini.rs:755-761 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/provider/mod.rs:2083 — src-tauri/src/services/provider/mod.rs:2083-2089 | src-tauri/src/services/provider/mod.rs:2099-2105 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/provider/pi.rs:194 — src-tauri/src/services/provider/pi.rs:194-200 | src-tauri/src/services/provider/pi.rs:218-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src-tauri/src/services/proxy.rs:4140 — src-tauri/src/services/proxy.rs:4140-4146 | src-tauri/src/services/proxy.rs:4156-4162 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/claude.rs:94 — src-tauri/src/session_manager/providers/claude.rs:94-100 | src-tauri/src/session_manager/providers/openclaw.rs:383-389 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 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 (7 lines × 2) REDACTED:1753 — REDACTED:1753-1759 | REDACTED:1786-1792 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/transcript.rs:2407 — src-tauri/src/session_manager/transcript.rs:2407-2413 | src-tauri/src/session_manager/transcript.rs:2415-2421 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/claude_temp_launch.rs:263 — src-tauri/src/cli/claude_temp_launch.rs:263-269 | src-tauri/src/cli/codex_temp_launch.rs:292-298 — before extracting anything, compare `src-tauri/src/cli/claude_temp_launch.rs` and `src-tauri/src/cli/codex_temp_launch.rs` as WHOLE FILES: this scan already matched 5 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.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×44
  • Duplicated block (8 lines × 2) src-tauri/src/cli/commands/config.rs:329 — src-tauri/src/cli/commands/config.rs:329-336 | src-tauri/src/cli/commands/config.rs:400-407 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/config_webdav.rs:273 — src-tauri/src/cli/commands/config_webdav.rs:273-280 | src-tauri/src/cli/commands/config_webdav.rs:284-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 (8 lines × 2) src-tauri/src/cli/commands/prompts.rs:417 — src-tauri/src/cli/commands/prompts.rs:417-424 | src-tauri/src/cli/commands/prompts.rs:602-609 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/provider_input.rs:3012 — src-tauri/src/cli/commands/provider_input.rs:3012-3019 | src-tauri/src/cli/tui/form/provider_json.rs:523-530 — before extracting anything, compare `src-tauri/src/cli/commands/provider_input.rs` and `src-tauri/src/cli/tui/form/provider_json.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) src-tauri/src/cli/tui/app/editor_state.rs:199 — src-tauri/src/cli/tui/app/editor_state.rs:199-206 | src-tauri/src/cli/tui/ui/forms/shared.rs:361-368 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) src-tauri/src/cli/tui/data.rs:2613 — src-tauri/src/cli/tui/data.rs:2613-2620 | src-tauri/src/cli/tui/data.rs:2659-2666 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:792 — src-tauri/src/cli/tui/runtime_actions/editor.rs:792-799 | src-tauri/src/cli/tui/runtime_actions/editor.rs:811-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src-tauri/src/cli/tui/runtime_systems/types.rs:953 — src-tauri/src/cli/tui/runtime_systems/types.rs:953-960 | src-tauri/src/services/provider/models.rs:85-92 — before extracting anything, compare `src-tauri/src/cli/tui/runtime_systems/types.rs` and `src-tauri/src/services/provider/models.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) src-tauri/src/cli/tui/runtime_systems/workers.rs:468 — src-tauri/src/cli/tui/runtime_systems/workers.rs:468-475 | src-tauri/src/cli/tui/runtime_systems/workers.rs:551-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src-tauri/src/cli/tui/ui.rs:227 — src-tauri/src/cli/tui/ui.rs:227-234 | src-tauri/src/cli/tui/ui.rs:240-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 (8 lines × 2) src-tauri/src/cli/tui/ui/overlay/layout.rs:96 — src-tauri/src/cli/tui/ui/overlay/layout.rs:96-103 | src-tauri/src/cli/tui/ui/overlay/layout.rs:128-135 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/pricing.rs:159 — src-tauri/src/cli/tui/ui/pricing.rs:159-166 | src-tauri/src/cli/tui/ui/pricing.rs:184-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 (8 lines × 2) src-tauri/src/cli/tui/ui/prompts.rs:166 — src-tauri/src/cli/tui/ui/prompts.rs:166-173 | src-tauri/src/cli/tui/ui/prompts.rs:241-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 (8 lines × 2) src-tauri/src/codex_config.rs:381 — src-tauri/src/codex_config.rs:381-388 | src-tauri/src/codex_config.rs:401-408 — both copies are in the same file, so extract the block into 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) src-tauri/src/codex_config.rs:1396 — src-tauri/src/codex_config.rs:1396-1403 | src-tauri/src/codex_config.rs:1444-1451 — both copies are in the same file, so extract the block into 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) REDACTED:1435 — REDACTED:1435-1442 | src-tauri/src/database/dao/proxy.rs:1158-1165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) src-tauri/src/hermes_config.rs:334 — src-tauri/src/hermes_config.rs:334-341 | src-tauri/src/openclaw_config.rs:349-356 — before extracting anything, compare `src-tauri/src/hermes_config.rs` and `src-tauri/src/openclaw_config.rs` as WHOLE FILES: this scan already matched 6 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 (8 lines × 2) src-tauri/src/proxy/error.rs:211 — src-tauri/src/proxy/error.rs:211-218 | src-tauri/src/proxy/response/error_summary.rs:44-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:677 — src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:677-684 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:935-942 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/proxy/providers/streaming_codex_chat.rs:212 — src-tauri/src/proxy/providers/streaming_codex_chat.rs:212-219 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:242-249 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/provider/common_config.rs:652 — src-tauri/src/services/provider/common_config.rs:652-659 | src-tauri/src/services/provider/common_config.rs:705-712 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/provider/common_config.rs:667 — src-tauri/src/services/provider/common_config.rs:667-674 | src-tauri/src/services/provider/common_config.rs:720-727 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/skill.rs:1475 — src-tauri/src/services/skill.rs:1475-1482 | src-tauri/src/services/skill.rs:2764-2771 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/skill.rs:3355 — src-tauri/src/services/skill.rs:3355-3362 | src-tauri/src/services/skill.rs:3450-3457 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/paged_manifest.rs:314 — src-tauri/src/session_manager/paged_manifest.rs:314-321 | src-tauri/src/session_manager/transcript.rs:2704-2711 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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.
D2 · Cognitive Complexity · App · ×39
  • App::handle_provider_field_activate (cognitive 129) src-tauri/src/cli/tui/app/form_handlers/provider.rs:368 — App::handle_provider_field_activate has cognitive complexity 129 (threshold 15). Drivers by points: if/else 55 (118 pts), match/switch 5 (10 pts), boolean chains 1 (nesting depth added 68). 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::on_sessions_key (cognitive 89) src-tauri/src/cli/tui/app/content_entities.rs:688 — App::on_sessions_key has cognitive complexity 89 (threshold 15). Drivers by points: if/else 32 (69 pts), match/switch 8 (13 pts), boolean chains 7 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_form_tab_key (cognitive 62) src-tauri/src/cli/tui/app/form_handlers/tab.rs:4 — App::handle_form_tab_key has cognitive complexity 62 (threshold 15). Drivers by points: if/else 20 (42 pts), match/switch 6 (14 pts), boolean chains 6 (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.
  • App::handle_confirm_overlay_key (cognitive 52) src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:75 — App::handle_confirm_overlay_key has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (36 pts), match/switch 7 (16 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_text_input_submit (cognitive 50) src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:388 — App::handle_text_input_submit has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (46 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • App::handle_model_fetch_picker_key (cognitive 48) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1119 — App::handle_model_fetch_picker_key has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (45 pts), boolean chains 2, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::commit_active_text_edit (cognitive 45) src-tauri/src/cli/tui/app/form_handlers/mod.rs:119 — App::commit_active_text_edit has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 7 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::on_providers_key (cognitive 44) src-tauri/src/cli/tui/app/content_entities.rs:219 — App::on_providers_key has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 2, match/switch 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_claude_model_picker_select_key (cognitive 40) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:982 — App::handle_claude_model_picker_select_key has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (33 pts), match/switch 3 (4 pts), boolean chains 3 (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.
  • App::build_provider_form_save_action (cognitive 39) src-tauri/src/cli/tui/app/form_handlers/provider.rs:48 — App::build_provider_form_save_action has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 7, 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.
  • App::on_filter_key (cognitive 39) src-tauri/src/cli/tui/app/menu.rs:944 — App::on_filter_key has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 7, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::clamp_selections (cognitive 39) src-tauri/src/cli/tui/app/menu.rs:1174 — App::clamp_selections has cognitive complexity 39 (threshold 15). Drivers by points: if/else 35 (36 pts), boolean chains 3 (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.
  • App::on_key_after_clamp (cognitive 36) src-tauri/src/cli/tui/app/menu.rs:738 — App::on_key_after_clamp has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 7, match/switch 3 (6 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • App::handle_mcp_key_value_entry_editor_key (cognitive 36) src-tauri/src/cli/tui/app/overlay_handlers/mcp_key_value.rs:78 — App::handle_mcp_key_value_entry_editor_key has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 10 (16 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::on_s3_sync_form_key (cognitive 35) src-tauri/src/cli/tui/app/form_handlers/s3.rs:4 — App::on_s3_sync_form_key has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 3 (4 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • App::on_webdav_sync_form_key (cognitive 32) src-tauri/src/cli/tui/app/form_handlers/webdav.rs:4 — App::on_webdav_sync_form_key has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 3 (4 pts) (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.
  • App::on_settings_key (cognitive 31) src-tauri/src/cli/tui/app/content_config.rs:840 — App::on_settings_key has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 7 (18 pts), if/else 4 (10 pts), boolean chains 3 (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.
  • App::handle_session_project_picker_key (cognitive 28) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1256 — App::handle_session_project_picker_key has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::on_usage_logs_key (cognitive 27) src-tauri/src/cli/tui/app/content_usage.rs:136 — App::on_usage_logs_key has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • App::handle_mcp_field_navigation (cognitive 27) src-tauri/src/cli/tui/app/form_handlers/mcp.rs:156 — App::handle_mcp_field_navigation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • App::handle_codex_reasoning_picker_key (cognitive 25) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:81 — App::handle_codex_reasoning_picker_key has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 3 (5 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • App::handle_picker_overlay_key (cognitive 24) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:146 — App::handle_picker_overlay_key has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. 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.
  • App::handle_managed_account_picker_key (cognitive 22) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:728 — App::handle_managed_account_picker_key has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 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.
  • App::on_skills_installed_key (cognitive 21) src-tauri/src/cli/tui/app/content_skills.rs:20 — App::on_skills_installed_key has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_codex_inline_catalog_key (cognitive 20) src-tauri/src/cli/tui/app/form_handlers/provider.rs:994 — App::handle_codex_inline_catalog_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • + 14 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×38
  • Hotspot: src-tauri/src/cli/tui/mod.rs src-tauri/src/cli/tui/mod.rs:3051 — src-tauri/src/cli/tui/mod.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in cc_switch::cli::tui::run at line 3051. 6 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/mod.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: src-tauri/src/cli/tui/runtime_actions/mod.rs src-tauri/src/cli/tui/runtime_actions/mod.rs:514 — src-tauri/src/cli/tui/runtime_actions/mod.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 164 in cc_switch::cli::tui::runtime_actions::handle_action at line 514. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/runtime_actions/mod.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: src-tauri/src/cli/tui/ui/forms/provider.rs src-tauri/src/cli/tui/ui/forms/provider.rs:1916 — src-tauri/src/cli/tui/ui/forms/provider.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 120 in cc_switch::cli::tui::ui::forms::provider::provider_field_label_and_value at line 1916. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/ui/forms/provider.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src-tauri/src/cli/tui/help.rs src-tauri/src/cli/tui/help.rs:104 — src-tauri/src/cli/tui/help.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in cc_switch::cli::tui::help::current_help_target at line 104. 10 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/help.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: src-tauri/src/cli/tui/app/form_handlers/provider.rs src-tauri/src/cli/tui/app/form_handlers/provider.rs:368 — src-tauri/src/cli/tui/app/form_handlers/provider.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in App::handle_provider_field_activate at line 368. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/app/form_handlers/provider.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src-tauri/src/cli/tui/runtime_systems/handlers.rs src-tauri/src/cli/tui/runtime_systems/handlers.rs:425 — src-tauri/src/cli/tui/runtime_systems/handlers.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in cc_switch::cli::tui::runtime_systems::handlers::handle_session_msg at line 425. 3 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/runtime_systems/handlers.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: src-tauri/src/cli/tui/form/provider_json.rs src-tauri/src/cli/tui/form/provider_json.rs:281 — src-tauri/src/cli/tui/form/provider_json.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in ProviderAddFormState::to_provider_json_value at line 281. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/form/provider_json.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: src-tauri/src/cli/commands/provider_input.rs src-tauri/src/cli/commands/provider_input.rs:4509 — src-tauri/src/cli/commands/provider_input.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in cc_switch::cli::commands::provider_input::display_provider_summary at line 4509. 4 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/commands/provider_input.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src-tauri/src/services/skill.rs src-tauri/src/services/skill.rs:2025 — src-tauri/src/services/skill.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in SkillService::migrate_storage at line 2025. 5 of those changes were fix/bug commits, and the other 6 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/services/skill.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: src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:75 — src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in App::handle_confirm_overlay_key at line 75. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/app/overlay_handlers/dialogs.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: src-tauri/src/cli/tui/form/provider_templates.rs src-tauri/src/cli/tui/form/provider_templates.rs:739 — src-tauri/src/cli/tui/form/provider_templates.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ProviderAddFormState::apply_sponsor_preset at line 739. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/form/provider_templates.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: src-tauri/src/services/provider/mod.rs src-tauri/src/services/provider/mod.rs:1358 — src-tauri/src/services/provider/mod.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in ProviderService::refresh_provider_snapshot at line 1358. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/services/provider/mod.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: src-tauri/src/cli/tui/form/provider_state.rs src-tauri/src/cli/tui/form/provider_state.rs:723 — src-tauri/src/cli/tui/form/provider_state.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ProviderAddFormState::input at line 723. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/form/provider_state.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src-tauri/src/cli/tui/ui/overlay/render.rs src-tauri/src/cli/tui/ui/overlay/render.rs:4 — src-tauri/src/cli/tui/ui/overlay/render.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in cc_switch::cli::tui::ui::overlay::render::render_overlay at line 4. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/ui/overlay/render.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: src-tauri/src/cli/tui/app/content_config.rs src-tauri/src/cli/tui/app/content_config.rs:840 — src-tauri/src/cli/tui/app/content_config.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in App::on_settings_key at line 840. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/app/content_config.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: src-tauri/src/cli/tui/app/menu.rs src-tauri/src/cli/tui/app/menu.rs:1105 — src-tauri/src/cli/tui/app/menu.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in App::on_content_key at line 1105. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/app/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: src-tauri/src/database/schema.rs src-tauri/src/database/schema.rs:431 — src-tauri/src/database/schema.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Database::apply_schema_migrations_on_conn at line 431. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/database/schema.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: src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:982 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in App::handle_claude_model_picker_select_key at line 982. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/app/overlay_handlers/pickers.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: src-tauri/src/cli/tui/runtime_systems/workers.rs src-tauri/src/cli/tui/runtime_systems/workers.rs:1956 — src-tauri/src/cli/tui/runtime_systems/workers.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in cc_switch::cli::tui::runtime_systems::workers::run_session_scan at line 1956. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/runtime_systems/workers.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: src-tauri/src/cli/commands/provider_inspect.rs src-tauri/src/cli/commands/provider_inspect.rs:428 — src-tauri/src/cli/commands/provider_inspect.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in cc_switch::cli::commands::provider_inspect::quota_provider at line 428. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/commands/provider_inspect.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: src-tauri/src/cli/tui/ui.rs src-tauri/src/cli/tui/ui.rs:137 — src-tauri/src/cli/tui/ui.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in cc_switch::cli::tui::ui::render_content at line 137. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/ui.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: src-tauri/src/cli/tui/runtime_systems/types.rs src-tauri/src/cli/tui/runtime_systems/types.rs:967 — src-tauri/src/cli/tui/runtime_systems/types.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in cc_switch::cli::tui::runtime_systems::types::fetch_provider_models_for_tui at line 967. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/runtime_systems/types.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: src-tauri/src/proxy/forwarder/request_builder.rs src-tauri/src/proxy/forwarder/request_builder.rs:516 — src-tauri/src/proxy/forwarder/request_builder.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in cc_switch::proxy::forwarder::request_builder::build_request at line 516. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/proxy/forwarder/request_builder.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: src-tauri/src/database/mod.rs src-tauri/src/database/mod.rs:508 — src-tauri/src/database/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in Database::init_impl_inner at line 508. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/database/mod.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: src-tauri/src/cli/tui/form/provider_state_loading.rs src-tauri/src/cli/tui/form/provider_state_loading.rs:68 — src-tauri/src/cli/tui/form/provider_state_loading.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in cc_switch::cli::tui::form::provider_state_loading::populate_usage_query_form at line 68. 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-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/form/provider_state_loading.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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×38
  • Duplicated block (9 lines × 2) src-tauri/src/cli/commands/provider_input.rs:141 — src-tauri/src/cli/commands/provider_input.rs:141-149 | src-tauri/src/cli/tui/form/provider_state.rs:355-363 — 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) src-tauri/src/cli/commands/provider_input.rs:3646 — src-tauri/src/cli/commands/provider_input.rs:3646-3654 | src-tauri/src/cli/tui/form/provider_json.rs:1541-1549 — before extracting anything, compare `src-tauri/src/cli/commands/provider_input.rs` and `src-tauri/src/cli/tui/form/provider_json.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) src-tauri/src/cli/provider_quota.rs:203 — src-tauri/src/cli/provider_quota.rs:203-211 | src-tauri/src/cli/tui/ui/shared.rs:893-901 — 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) src-tauri/src/cli/tui/app/content_entities.rs:692 — src-tauri/src/cli/tui/app/content_entities.rs:692-700 | src-tauri/src/cli/tui/app/content_entities.rs:1125-1133 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/content_entities.rs:702 — src-tauri/src/cli/tui/app/content_entities.rs:702-710 | src-tauri/src/cli/tui/app/content_entities.rs:1135-1143 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/helpers.rs:1369 — src-tauri/src/cli/tui/app/helpers.rs:1369-1377 | src-tauri/src/session_manager/query_manifest.rs:155-163 — before extracting anything, compare `src-tauri/src/cli/tui/app/helpers.rs` and `src-tauri/src/session_manager/query_manifest.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) src-tauri/src/cli/tui/app/helpers.rs:1430 — src-tauri/src/cli/tui/app/helpers.rs:1430-1438 | src-tauri/src/session_manager/query_manifest.rs:181-189 — before extracting anything, compare `src-tauri/src/cli/tui/app/helpers.rs` and `src-tauri/src/session_manager/query_manifest.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) src-tauri/src/cli/tui/app/helpers.rs:1605 — src-tauri/src/cli/tui/app/helpers.rs:1605-1613 | src-tauri/src/cli/tui/ui/skills/helpers.rs:12-20 — 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) src-tauri/src/cli/tui/form/provider_json.rs:311 — src-tauri/src/cli/tui/form/provider_json.rs:311-319 | src-tauri/src/cli/tui/form/provider_json.rs:453-461 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:516 — src-tauri/src/cli/tui/runtime_actions/editor.rs:516-524 | src-tauri/src/cli/tui/runtime_actions/editor.rs:561-569 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:869 — src-tauri/src/cli/tui/runtime_actions/editor.rs:869-877 | src-tauri/src/cli/tui/runtime_actions/editor.rs:931-939 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:1200 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1200-1208 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1275-1283 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:1275 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1275-1283 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1319-1327 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_systems/workers.rs:179 — src-tauri/src/cli/tui/runtime_systems/workers.rs:179-187 | src-tauri/src/cli/tui/runtime_systems/workers.rs:3769-3777 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_systems/workers.rs:292 — src-tauri/src/cli/tui/runtime_systems/workers.rs:292-300 | src-tauri/src/cli/tui/runtime_systems/workers.rs:697-705 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_systems/workers.rs:1317 — src-tauri/src/cli/tui/runtime_systems/workers.rs:1317-1325 | src-tauri/src/cli/tui/runtime_systems/workers.rs:1353-1361 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/overlay/pickers.rs:1233 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:1233-1242 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:1410-1418 — both copies are in the same file, so extract the block into 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) src-tauri/src/config.rs:348 — src-tauri/src/config.rs:348-356 | src-tauri/src/config.rs:1373-1381 — both copies are in the same file, so extract the block into 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) src-tauri/src/daemon/supervisor.rs:1256 — src-tauri/src/daemon/supervisor.rs:1256-1264 | src-tauri/src/services/proxy.rs:4112-4120 — 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) src-tauri/src/mcp.rs:810 — src-tauri/src/mcp.rs:810-818 | src-tauri/src/mcp.rs:1457-1465 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/forwarder.rs:765 — src-tauri/src/proxy/forwarder.rs:765-773 | src-tauri/src/proxy/forwarder.rs:962-970 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1352 — src-tauri/src/proxy/providers/codex_oauth_auth.rs:1352-1360 | src-tauri/src/proxy/providers/copilot_auth.rs:1175-1183 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/proxy/providers/streaming_gemini.rs:76 — src-tauri/src/proxy/providers/streaming_gemini.rs:76-84 | src-tauri/src/proxy/providers/transform_gemini.rs:1032-1040 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/proxy/providers/streaming_responses.rs:316 — src-tauri/src/proxy/providers/streaming_responses.rs:316-324 | src-tauri/src/proxy/providers/streaming_responses.rs:584-592 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/s3_sync.rs:265 — src-tauri/src/services/s3_sync.rs:265-273 | REDACTED:345-353 — 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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×36
  • Duplicated block (5 lines × 2) src-tauri/src/claude_mcp.rs:76 — src-tauri/src/claude_mcp.rs:76-80 | src-tauri/src/gemini_mcp.rs:35-39 — before extracting anything, compare `src-tauri/src/claude_mcp.rs` and `src-tauri/src/gemini_mcp.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/commands/provider_input.rs:3173 — src-tauri/src/cli/commands/provider_input.rs:3173-3177 | src-tauri/src/cli/commands/provider_input.rs:3394-3398 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/provider_quota.rs:226 — src-tauri/src/cli/provider_quota.rs:226-230 | src-tauri/src/cli/tui/ui/shared.rs:916-920 — 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) src-tauri/src/cli/tui/app/content_entities.rs:770 — src-tauri/src/cli/tui/app/content_entities.rs:770-774 | src-tauri/src/cli/tui/app/content_entities.rs:783-787 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/editor_state.rs:716 — src-tauri/src/cli/tui/app/editor_state.rs:716-720 | src-tauri/src/cli/tui/app/editor_state.rs:733-737 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/types.rs:3033 — src-tauri/src/cli/tui/app/types.rs:3033-3037 | src-tauri/src/cli/tui/app/types.rs:3695-3699 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/config.rs:182 — src-tauri/src/cli/tui/ui/config.rs:182-186 | src-tauri/src/cli/tui/ui/config.rs:244-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 (5 lines × 2) src-tauri/src/cli/tui/ui/usage.rs:888 — src-tauri/src/cli/tui/ui/usage.rs:888-892 | src-tauri/src/cli/tui/ui/usage.rs:944-948 — both copies are in the same file, so extract the block into 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) src-tauri/src/codex_history_migration.rs:1681 — src-tauri/src/codex_history_migration.rs:1681-1685 | REDACTED:894-898 — 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) src-tauri/src/pi_config/mod.rs:123 — src-tauri/src/pi_config/mod.rs:123-128 | src-tauri/src/pi_config/mod.rs:226-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 (5 lines × 2) src-tauri/src/pi_config/mod.rs:177 — src-tauri/src/pi_config/mod.rs:177-181 | src-tauri/src/pi_config/mod.rs:207-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 (5 lines × 2) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:494 — src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:494-498 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:871-875 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/proxy/providers/transform.rs:112 — src-tauri/src/proxy/providers/transform.rs:112-116 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:238-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:859 — src-tauri/src/proxy/providers/transform_codex_anthropic.rs:859-863 | src-tauri/src/proxy/providers/transform_responses.rs:193-197 — before extracting anything, compare `src-tauri/src/proxy/providers/transform_codex_anthropic.rs` and `src-tauri/src/proxy/providers/transform_responses.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.
  • Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/transform_codex_chat.rs:1404 — src-tauri/src/proxy/providers/transform_codex_chat.rs:1404-1408 | src-tauri/src/proxy/providers/transform_codex_chat.rs:1425-1429 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/transform_responses.rs:14 — src-tauri/src/proxy/providers/transform_responses.rs:14-18 | src-tauri/src/proxy/providers/transform_responses.rs:45-49 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/env_checker.rs:52 — src-tauri/src/services/env_checker.rs:52-56 | src-tauri/src/services/env_checker.rs:68-72 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/provider/endpoints.rs:87 — src-tauri/src/services/provider/endpoints.rs:87-91 | src-tauri/src/services/provider/endpoints.rs:111-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src-tauri/src/services/provider/live.rs:228 — src-tauri/src/services/provider/live.rs:228-232 | src-tauri/src/services/provider/live.rs:402-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src-tauri/src/services/usage_stats.rs:576 — src-tauri/src/services/usage_stats.rs:576-581 | src-tauri/src/services/usage_stats.rs:696-700 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/usage_stats.rs:1129 — src-tauri/src/services/usage_stats.rs:1129-1133 | src-tauri/src/services/usage_stats.rs:1241-1245 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/paged_manifest.rs:527 — src-tauri/src/session_manager/paged_manifest.rs:527-531 | src-tauri/src/session_manager/paged_manifest.rs:619-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src-tauri/src/proxy/forwarder/request_builder.rs:796 — src-tauri/src/proxy/forwarder/request_builder.rs:796-800 | src-tauri/src/proxy/gemini_url.rs:158-162 — 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) src-tauri/src/proxy/providers/codex_oauth_auth.rs:888 — src-tauri/src/proxy/providers/codex_oauth_auth.rs:888-892 | src-tauri/src/proxy/providers/copilot_auth.rs:464-468 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/commands/config_s3.rs:185 — src-tauri/src/cli/commands/config_s3.rs:185-189 | src-tauri/src/cli/commands/config_webdav.rs:265-269 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 11 more in this group — see findings.md.
D1 · Cyclomatic Complexity · App · ×35
  • App::handle_provider_field_activate (cyclomatic 94) src-tauri/src/cli/tui/app/form_handlers/provider.rs:368 — App::handle_provider_field_activate has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent 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_confirm_overlay_key (cyclomatic 70) src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:75 — App::handle_confirm_overlay_key has cyclomatic complexity 70 (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::on_sessions_key (cyclomatic 57) src-tauri/src/cli/tui/app/content_entities.rs:688 — App::on_sessions_key has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::handle_form_tab_key (cyclomatic 51) src-tauri/src/cli/tui/app/form_handlers/tab.rs:4 — App::handle_form_tab_key has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::handle_text_input_submit (cyclomatic 43) src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:388 — App::handle_text_input_submit has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::on_key_after_clamp (cyclomatic 38) src-tauri/src/cli/tui/app/menu.rs:738 — App::on_key_after_clamp has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • App::on_providers_key (cyclomatic 36) src-tauri/src/cli/tui/app/content_entities.rs:219 — App::on_providers_key has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::on_settings_key (cyclomatic 33) src-tauri/src/cli/tui/app/content_config.rs:840 — App::on_settings_key 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.
  • App::build_provider_form_save_action (cyclomatic 32) src-tauri/src/cli/tui/app/form_handlers/provider.rs:48 — App::build_provider_form_save_action has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • App::handle_claude_model_picker_select_key (cyclomatic 28) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:982 — App::handle_claude_model_picker_select_key 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.
  • App::handle_model_fetch_picker_key (cyclomatic 27) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1119 — App::handle_model_fetch_picker_key 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.
  • App::commit_active_text_edit (cyclomatic 26) src-tauri/src/cli/tui/app/form_handlers/mod.rs:119 — App::commit_active_text_edit 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.
  • App::handle_mcp_key_value_entry_editor_key (cyclomatic 25) src-tauri/src/cli/tui/app/overlay_handlers/mcp_key_value.rs:78 — App::handle_mcp_key_value_entry_editor_key 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::handle_picker_overlay_key (cyclomatic 25) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:146 — App::handle_picker_overlay_key has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • App::handle_session_project_picker_key (cyclomatic 24) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1256 — App::handle_session_project_picker_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.
  • App::on_filter_key (cyclomatic 23) src-tauri/src/cli/tui/app/menu.rs:944 — App::on_filter_key has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: App::on_content_key (cyclomatic 31) 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.
  • App::clamp_selections (cyclomatic 23) src-tauri/src/cli/tui/app/menu.rs:1174 — App::clamp_selections 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. This is NOT this file's highest cyclomatic complexity: App::on_content_key (cyclomatic 31) 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.
  • App::on_config_key (cyclomatic 21) src-tauri/src/cli/tui/app/content_config.rs:33 — App::on_config_key has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • App::nav_item_for_route (cyclomatic 21) src-tauri/src/cli/tui/app/menu.rs:181 — App::nav_item_for_route has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: App::on_content_key (cyclomatic 31) 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.
  • App::on_skills_installed_key (cyclomatic 20) src-tauri/src/cli/tui/app/content_skills.rs:20 — App::on_skills_installed_key has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::on_usage_logs_key (cyclomatic 20) src-tauri/src/cli/tui/app/content_usage.rs:136 — App::on_usage_logs_key has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::handle_mcp_field_navigation (cyclomatic 20) src-tauri/src/cli/tui/app/form_handlers/mcp.rs:156 — App::handle_mcp_field_navigation has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::on_s3_sync_form_key (cyclomatic 20) src-tauri/src/cli/tui/app/form_handlers/s3.rs:4 — App::on_s3_sync_form_key has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::handle_codex_inline_catalog_key (cyclomatic 19) src-tauri/src/cli/tui/app/form_handlers/provider.rs:994 — App::handle_codex_inline_catalog_key has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::on_webdav_sync_form_key (cyclomatic 19) src-tauri/src/cli/tui/app/form_handlers/webdav.rs:4 — App::on_webdav_sync_form_key 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.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×33
  • Duplicated block (10 lines × 2) src-tauri/src/claude_mcp.rs:173 — src-tauri/src/claude_mcp.rs:173-182 | src-tauri/src/mcp.rs:25-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) src-tauri/src/cli/commands/sessions.rs:238 — src-tauri/src/cli/commands/sessions.rs:238-247 | src-tauri/src/cli/commands/sessions.rs:504-513 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/sessions.rs:883 — src-tauri/src/cli/commands/sessions.rs:883-892 | src-tauri/src/cli/tui/ui/sessions.rs:718-727 — 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) src-tauri/src/cli/tui/app/types.rs:4962 — src-tauri/src/cli/tui/app/types.rs:4962-4971 | src-tauri/src/cli/tui/app/types.rs:5008-5017 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/form/provider_state.rs:3186 — src-tauri/src/cli/tui/form/provider_state.rs:3186-3195 | src-tauri/src/cli/tui/form/provider_state.rs:3206-3215 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:1024 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1024-1033 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1122-1131 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:1123 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1123-1132 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1319-1328 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_systems/types.rs:879 — src-tauri/src/cli/tui/runtime_systems/types.rs:879-888 | src-tauri/src/services/provider/models.rs:145-154 — before extracting anything, compare `src-tauri/src/cli/tui/runtime_systems/types.rs` and `src-tauri/src/services/provider/models.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) src-tauri/src/cli/tui/runtime_systems/workers.rs:2207 — src-tauri/src/cli/tui/runtime_systems/workers.rs:2207-2216 | src-tauri/src/cli/tui/runtime_systems/workers.rs:2221-2230 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/config.rs:1309 — src-tauri/src/cli/tui/ui/config.rs:1309-1318 | src-tauri/src/cli/tui/ui/config.rs:2230-2239 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/forms/prompt.rs:93 — src-tauri/src/cli/tui/ui/forms/prompt.rs:93-102 | src-tauri/src/cli/tui/ui/forms/provider.rs:561-570 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/prompt.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/tui/ui/forms/provider.rs:900 — src-tauri/src/cli/tui/ui/forms/provider.rs:900-909 | src-tauri/src/cli/tui/ui/forms/provider.rs:1136-1145 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/overlay/basic.rs:338 — src-tauri/src/cli/tui/ui/overlay/basic.rs:338-347 | src-tauri/src/cli/tui/ui/overlay/status.rs:316-325 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/cli/tui/ui/shared.rs:985 — src-tauri/src/cli/tui/ui/shared.rs:985-994 | src-tauri/src/cli/tui/ui/shared.rs:1049-1058 — both copies are in the same file, so extract the block into 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) src-tauri/src/database/dao/proxy.rs:1049 — src-tauri/src/database/dao/proxy.rs:1049-1058 | src-tauri/src/database/dao/proxy.rs:1124-1133 — both copies are in the same file, so extract the block into 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) src-tauri/src/hermes_config.rs:343 — src-tauri/src/hermes_config.rs:343-352 | src-tauri/src/openclaw_config.rs:358-367 — before extracting anything, compare `src-tauri/src/hermes_config.rs` and `src-tauri/src/openclaw_config.rs` as WHOLE FILES: this scan already matched 6 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) src-tauri/src/openclaw_config.rs:502 — src-tauri/src/openclaw_config.rs:502-511 | src-tauri/src/openclaw_config.rs:524-533 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/codex.rs:388 — src-tauri/src/proxy/providers/codex.rs:388-397 | src-tauri/src/proxy/providers/codex.rs:445-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src-tauri/src/proxy/providers/copilot_auth.rs:916 — src-tauri/src/proxy/providers/copilot_auth.rs:916-925 | src-tauri/src/proxy/providers/copilot_auth.rs:1030-1039 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/coding_plan.rs:147 — src-tauri/src/services/coding_plan.rs:147-156 | src-tauri/src/services/coding_plan.rs:168-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src-tauri/src/services/provider/endpoints.rs:56 — src-tauri/src/services/provider/endpoints.rs:56-65 | src-tauri/src/services/provider/mod.rs:2957-2966 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/services/skill.rs:1176 — src-tauri/src/services/skill.rs:1176-1185 | src-tauri/src/services/skill.rs:1507-1516 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/skill.rs:1697 — src-tauri/src/services/skill.rs:1697-1706 | src-tauri/src/services/skill.rs:1787-1796 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/usage_stats.rs:537 — src-tauri/src/services/usage_stats.rs:537-546 | src-tauri/src/services/usage_stats.rs:1205-1214 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/webdav.rs:256 — src-tauri/src/services/webdav.rs:256-265 | src-tauri/src/services/webdav.rs:414-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×30
  • Duplicated block (6 lines × 2) src-tauri/src/cli/commands/provider_input.rs:3777 — src-tauri/src/cli/commands/provider_input.rs:3777-3783 | src-tauri/src/cli/commands/provider_input.rs:4316-4321 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/form_handlers/provider.rs:1300 — src-tauri/src/cli/tui/app/form_handlers/provider.rs:1300-1305 | src-tauri/src/cli/tui/app/form_handlers/provider.rs:1550-1555 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/data.rs:3048 — src-tauri/src/cli/tui/data.rs:3048-3053 | src-tauri/src/cli/tui/data.rs:3093-3098 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/form/mcp.rs:306 — src-tauri/src/cli/tui/form/mcp.rs:306-311 | src-tauri/src/cli/tui/form/s3.rs:186-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) src-tauri/src/cli/tui/ui/config.rs:4150 — src-tauri/src/cli/tui/ui/config.rs:4150-4155 | src-tauri/src/cli/tui/ui/config.rs:4263-4268 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/editor.rs:76 — src-tauri/src/cli/tui/ui/editor.rs:76-81 | src-tauri/src/cli/tui/ui/forms/prompt.rs:206-212 — 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) src-tauri/src/cli/tui/ui/forms/mcp.rs:45 — src-tauri/src/cli/tui/ui/forms/mcp.rs:45-50 | src-tauri/src/cli/tui/ui/forms/prompt.rs:31-36 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/tui/ui/forms/provider.rs:891 — src-tauri/src/cli/tui/ui/forms/provider.rs:891-896 | src-tauri/src/cli/tui/ui/forms/provider.rs:1127-1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) src-tauri/src/cli/tui/ui/forms/s3.rs:60 — src-tauri/src/cli/tui/ui/forms/s3.rs:60-65 | src-tauri/src/cli/tui/ui/forms/webdav.rs:53-58 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/s3.rs` and `src-tauri/src/cli/tui/ui/forms/webdav.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/deeplink/provider.rs:619 — src-tauri/src/deeplink/provider.rs:619-624 | src-tauri/src/deeplink/provider.rs:666-673 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/copilot_optimizer.rs:282 — src-tauri/src/proxy/copilot_optimizer.rs:282-288 | src-tauri/src/proxy/copilot_optimizer.rs:311-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 (6 lines × 2) src-tauri/src/proxy/providers/codex_chat_common.rs:10 — src-tauri/src/proxy/providers/codex_chat_common.rs:10-15 | src-tauri/src/proxy/providers/codex_chat_common.rs:55-60 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/transform.rs:159 — src-tauri/src/proxy/providers/transform.rs:159-164 | src-tauri/src/proxy/providers/transform_responses.rs:309-314 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 5 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 (6 lines × 2) src-tauri/src/proxy/providers/transform.rs:629 — src-tauri/src/proxy/providers/transform.rs:629-634 | src-tauri/src/proxy/providers/transform_responses.rs:674-679 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 5 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 (6 lines × 2) src-tauri/src/services/skill.rs:1741 — src-tauri/src/services/skill.rs:1741-1746 | src-tauri/src/services/skill.rs:1771-1776 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/usage_stats.rs:821 — src-tauri/src/services/usage_stats.rs:821-826 | src-tauri/src/services/usage_stats.rs:911-916 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/paged_manifest.rs:2688 — src-tauri/src/session_manager/paged_manifest.rs:2688-2693 | src-tauri/src/session_manager/paged_manifest.rs:2721-2726 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/claude_temp_launch.rs:238 — src-tauri/src/cli/claude_temp_launch.rs:238-243 | src-tauri/src/cli/codex_temp_launch.rs:260-265 — before extracting anything, compare `src-tauri/src/cli/claude_temp_launch.rs` and `src-tauri/src/cli/codex_temp_launch.rs` as WHOLE FILES: this scan already matched 5 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 × 2) src-tauri/src/cli/commands/failover.rs:76 — src-tauri/src/cli/commands/failover.rs:76-81 | src-tauri/src/cli/commands/proxy.rs:76-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/cli/provider_quota.rs:195 — src-tauri/src/cli/provider_quota.rs:195-200 | src-tauri/src/cli/tui/ui/shared.rs:885-890 — 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) src-tauri/src/cli/tui/app/helpers.rs:1418 — src-tauri/src/cli/tui/app/helpers.rs:1418-1423 | src-tauri/src/session_manager/query_manifest.rs:169-174 — before extracting anything, compare `src-tauri/src/cli/tui/app/helpers.rs` and `src-tauri/src/session_manager/query_manifest.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) src-tauri/src/services/provider/mod.rs:116 — src-tauri/src/services/provider/mod.rs:116-121 | src-tauri/src/services/subscription.rs:674-679 — 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) src-tauri/src/app_config.rs:746 — src-tauri/src/app_config.rs:746-753 | src-tauri/src/proxy/providers/gemini.rs:98-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 (6 lines × 2) src-tauri/src/cli/commands/prompts.rs:427 — src-tauri/src/cli/commands/prompts.rs:427-432 | src-tauri/src/cli/commands/prompts.rs:612-619 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/hermes.rs:174 — src-tauri/src/session_manager/providers/hermes.rs:174-179 | REDACTED:204-209 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×29
  • Duplicated block (11 lines × 2) src-tauri/src/cli/commands/provider_input.rs:382 — src-tauri/src/cli/commands/provider_input.rs:382-392 | src-tauri/src/cli/commands/provider_input.rs:449-459 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:625 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:625-635 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:686-696 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/claude_temp_launch.rs:54 — src-tauri/src/cli/tui/runtime_actions/claude_temp_launch.rs:54-64 | src-tauri/src/cli/tui/runtime_actions/codex_temp_launch.rs:41-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/codex_config.rs:3538 — src-tauri/src/codex_config.rs:3538-3548 | src-tauri/src/codex_config.rs:3612-3622 — both copies are in the same file, so extract the block into 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) src-tauri/src/database/dao/proxy.rs:194 — src-tauri/src/database/dao/proxy.rs:194-204 | src-tauri/src/database/dao/proxy.rs:218-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src-tauri/src/openclaw_config.rs:819 — src-tauri/src/openclaw_config.rs:819-829 | src-tauri/src/openclaw_config.rs:898-908 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/codex_oauth_auth.rs:747 — src-tauri/src/proxy/providers/codex_oauth_auth.rs:747-757 | src-tauri/src/proxy/providers/codex_oauth_auth.rs:775-785 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1380 — src-tauri/src/proxy/providers/codex_oauth_auth.rs:1380-1390 | src-tauri/src/proxy/providers/copilot_auth.rs:1204-1214 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/proxy/response.rs:373 — src-tauri/src/proxy/response.rs:373-383 | src-tauri/src/proxy/response.rs:403-413 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/session_usage.rs:1049 — src-tauri/src/services/session_usage.rs:1049-1059 | src-tauri/src/services/session_usage_gemini.rs:259-269 — before extracting anything, compare `src-tauri/src/services/session_usage.rs` and `src-tauri/src/services/session_usage_gemini.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 (11 lines × 2) src-tauri/src/services/skill.rs:733 — src-tauri/src/services/skill.rs:733-743 | src-tauri/src/services/skill.rs:763-773 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/skill.rs:3016 — src-tauri/src/services/skill.rs:3016-3026 | src-tauri/src/services/skill.rs:3045-3055 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/cache.rs:238 — src-tauri/src/session_manager/cache.rs:238-248 | src-tauri/src/session_manager/cache.rs:282-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src-tauri/src/session_manager/paged_manifest.rs:2501 — src-tauri/src/session_manager/paged_manifest.rs:2501-2511 | src-tauri/src/session_manager/paged_manifest.rs:2559-2569 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/hermes.rs:393 — src-tauri/src/session_manager/providers/hermes.rs:393-403 | REDACTED:572-582 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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 (11 lines × 2) src-tauri/src/session_manager/providers/hermes.rs:812 — src-tauri/src/session_manager/providers/hermes.rs:812-822 | REDACTED:1194-1204 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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 (11 lines × 2) src-tauri/src/session_manager/providers/hermes.rs:903 — src-tauri/src/session_manager/providers/hermes.rs:903-913 | REDACTED:1297-1307 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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 (11 lines × 2) src-tauri/src/session_manager/providers/pi.rs:666 — src-tauri/src/session_manager/providers/pi.rs:666-676 | src-tauri/src/session_manager/providers/pi.rs:807-817 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/transcript.rs:2856 — src-tauri/src/session_manager/transcript.rs:2856-2866 | src-tauri/src/session_manager/transcript.rs:2967-2977 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/helpers.rs:62 — src-tauri/src/cli/tui/runtime_actions/helpers.rs:62-72 | src-tauri/src/services/visible_apps.rs:185-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) src-tauri/src/session_manager/providers/gemini.rs:70 — src-tauri/src/session_manager/providers/gemini.rs:70-83 | src-tauri/src/session_manager/providers/openclaw.rs:98-108 — before extracting anything, compare `src-tauri/src/session_manager/providers/gemini.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) src-tauri/src/session_manager/providers/gemini.rs:87 — src-tauri/src/session_manager/providers/gemini.rs:87-98 | src-tauri/src/session_manager/providers/openclaw.rs:112-122 — before extracting anything, compare `src-tauri/src/session_manager/providers/gemini.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) src-tauri/src/cli/commands/config_openclaw.rs:994 — src-tauri/src/cli/commands/config_openclaw.rs:994-1004 | src-tauri/src/cli/commands/config_openclaw.rs:1036-1046 — both copies are in the same file, so extract the block into 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) src-tauri/src/database/dao/proxy.rs:196 — src-tauri/src/database/dao/proxy.rs:196-206 | src-tauri/src/database/dao/proxy.rs:276-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 (11 lines × 2) src-tauri/src/services/session_usage.rs:580 — src-tauri/src/services/session_usage.rs:580-590 | src-tauri/src/services/session_usage_codex.rs:1391-1401 — before extracting anything, compare `src-tauri/src/services/session_usage.rs` and `src-tauri/src/services/session_usage_codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×19
  • Duplicated block (12 lines × 2) src-tauri/src/cli/tui/app/form_handlers/provider.rs:863 — src-tauri/src/cli/tui/app/form_handlers/provider.rs:863-874 | src-tauri/src/cli/tui/app/form_handlers/provider.rs:995-1006 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:1300 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1300-1311 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1337-1348 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/forms/prompt.rs:41 — src-tauri/src/cli/tui/ui/forms/prompt.rs:41-52 | src-tauri/src/cli/tui/ui/forms/provider.rs:1542-1553 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/prompt.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/tui/ui/forms/provider.rs:1202 — src-tauri/src/cli/tui/ui/forms/provider.rs:1202-1213 | src-tauri/src/cli/tui/ui/forms/provider.rs:1322-1333 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/overlay/pickers.rs:259 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:259-270 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:1145-1156 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/overlay/pickers.rs:1817 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:1817-1828 | src-tauri/src/cli/tui/ui/sessions.rs:760-771 — 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) src-tauri/src/cli/tui/ui/overlay/pickers.rs:2005 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:2005-2016 | src-tauri/src/cli/tui/ui/shared.rs:422-433 — 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) src-tauri/src/codex_history_migration.rs:999 — src-tauri/src/codex_history_migration.rs:999-1010 | src-tauri/src/codex_history_migration.rs:1138-1149 — both copies are in the same file, so extract the block into 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) src-tauri/src/mcp.rs:364 — src-tauri/src/mcp.rs:364-375 | src-tauri/src/mcp.rs:755-766 — both copies are in the same file, so extract the block into 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) src-tauri/src/openclaw_config.rs:726 — src-tauri/src/openclaw_config.rs:726-737 | src-tauri/src/openclaw_config.rs:751-762 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/handlers.rs:228 — src-tauri/src/proxy/handlers.rs:228-239 | src-tauri/src/proxy/handlers.rs:571-582 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/streaming.rs:425 — src-tauri/src/proxy/providers/streaming.rs:425-436 | src-tauri/src/proxy/providers/streaming.rs:525-536 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/streaming_responses.rs:340 — src-tauri/src/proxy/providers/streaming_responses.rs:340-351 | src-tauri/src/proxy/providers/streaming_responses.rs:606-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 (12 lines × 2) src-tauri/src/services/provider/mod.rs:4004 — src-tauri/src/services/provider/mod.rs:4004-4015 | src-tauri/src/services/provider/mod.rs:4091-4102 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/skill.rs:2124 — src-tauri/src/services/skill.rs:2124-2135 | src-tauri/src/services/skill.rs:2152-2163 — both copies are in the same file, so extract the block into 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) src-tauri/src/daemon/migration.rs:491 — src-tauri/src/daemon/migration.rs:491-503 | src-tauri/src/daemon/migration.rs:555-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src-tauri/src/services/proxy.rs:3185 — src-tauri/src/services/proxy.rs:3185-3196 | src-tauri/src/services/proxy.rs:3202-3213 — both copies are in the same file, so extract the block into 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) src-tauri/src/mcp.rs:381 — src-tauri/src/mcp.rs:381-392 | src-tauri/src/mcp.rs:772-783 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/codex_oauth.rs:41 — src-tauri/src/services/codex_oauth.rs:41-52 | src-tauri/src/services/copilot_auth.rs:40-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×18
  • Duplicated block (14 lines × 2) src-tauri/src/cli/commands/provider_input.rs:2980 — src-tauri/src/cli/commands/provider_input.rs:2980-2993 | src-tauri/src/cli/tui/form/provider_json.rs:491-504 — before extracting anything, compare `src-tauri/src/cli/commands/provider_input.rs` and `src-tauri/src/cli/tui/form/provider_json.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) src-tauri/src/cli/tui/ui/config.rs:1575 — src-tauri/src/cli/tui/ui/config.rs:1575-1588 | src-tauri/src/cli/tui/ui/config.rs:2565-2578 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/config.rs:3960 — src-tauri/src/cli/tui/ui/config.rs:3960-3973 | src-tauri/src/cli/tui/ui/config.rs:4013-4026 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/editor.rs:15 — src-tauri/src/cli/tui/ui/editor.rs:15-28 | src-tauri/src/cli/tui/ui/skills/detail.rs:38-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) src-tauri/src/cli/tui/ui/forms/shared.rs:545 — src-tauri/src/cli/tui/ui/forms/shared.rs:545-558 | src-tauri/src/cli/tui/ui/forms/shared.rs:580-593 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/ui/usage.rs:495 — src-tauri/src/cli/tui/ui/usage.rs:495-508 | src-tauri/src/cli/tui/ui/usage.rs:522-535 — both copies are in the same file, so extract the block into 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) src-tauri/src/codex_history_migration.rs:576 — src-tauri/src/codex_history_migration.rs:576-589 | src-tauri/src/codex_history_migration.rs:1501-1514 — both copies are in the same file, so extract the block into 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) src-tauri/src/codex_history_migration.rs:1098 — src-tauri/src/codex_history_migration.rs:1098-1111 | src-tauri/src/codex_history_migration.rs:1161-1174 — both copies are in the same file, so extract the block into 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) src-tauri/src/daemon/mod.rs:44 — src-tauri/src/daemon/mod.rs:44-57 | src-tauri/src/daemon/mod.rs:70-83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src-tauri/src/database/dao/proxy.rs:330 — src-tauri/src/database/dao/proxy.rs:330-343 | src-tauri/src/database/dao/proxy.rs:376-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src-tauri/src/proxy/forwarder.rs:1195 — src-tauri/src/proxy/forwarder.rs:1195-1208 | src-tauri/src/proxy/handlers.rs:1300-1313 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) src-tauri/src/proxy/handlers.rs:267 — src-tauri/src/proxy/handlers.rs:267-280 | src-tauri/src/proxy/handlers.rs:384-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src-tauri/src/proxy/providers/streaming.rs:441 — src-tauri/src/proxy/providers/streaming.rs:441-454 | src-tauri/src/proxy/providers/streaming.rs:457-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src-tauri/src/proxy/providers/streaming_codex_chat.rs:499 — src-tauri/src/proxy/providers/streaming_codex_chat.rs:499-512 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:745-758 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/provider/mod.rs:2709 — src-tauri/src/services/provider/mod.rs:2709-2722 | src-tauri/src/services/provider/mod.rs:2819-2832 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/scan_cache_store.rs:476 — src-tauri/src/session_manager/scan_cache_store.rs:476-489 | src-tauri/src/session_manager/scan_cache_store.rs:505-518 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/provider.rs:1059 — src-tauri/src/cli/commands/provider.rs:1059-1072 | src-tauri/src/cli/commands/provider.rs:2133-2146 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/transform_gemini.rs:590 — src-tauri/src/proxy/providers/transform_gemini.rs:590-603 | src-tauri/src/proxy/providers/transform_gemini.rs:613-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · ProviderService · ×16
  • ProviderService::fetch_provider_models (cognitive 96) src-tauri/src/services/provider/models.rs:24 — ProviderService::fetch_provider_models has cognitive complexity 96 (threshold 15). Drivers by points: if/else 17 (72 pts), loops 4 (21 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 73). 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.
  • ProviderService::refresh_provider_snapshot (cognitive 68) src-tauri/src/services/provider/mod.rs:1358 — ProviderService::refresh_provider_snapshot has cognitive complexity 68 (threshold 15). Drivers by points: if/else 31 (65 pts), boolean chains 2, match/switch 1 (nesting depth added 34). 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.
  • ProviderService::build_effective_live_snapshot (cognitive 46) src-tauri/src/services/provider/mod.rs:3632 — ProviderService::build_effective_live_snapshot has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 1 (5 pts), 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.
  • ProviderService::apply_prepared_post_commit_action (cognitive 41) src-tauri/src/services/provider/mod.rs:1188 — ProviderService::apply_prepared_post_commit_action has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 4 (11 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderService::delete (cognitive 32) src-tauri/src/services/provider/mod.rs:3973 — ProviderService::delete has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderService::update (cognitive 30) src-tauri/src/services/provider/mod.rs:2494 — ProviderService::update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ProviderService::sync_current_to_live (cognitive 30) src-tauri/src/services/provider/mod.rs:3132 — ProviderService::sync_current_to_live has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (6 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderService::save_claude_from_editor (cognitive 26) src-tauri/src/services/provider/claude_editor_service.rs:15 — ProviderService::save_claude_from_editor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, match/switch 1 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • ProviderService::prepare_post_commit_action (cognitive 26) src-tauri/src/services/provider/mod.rs:1007 — ProviderService::prepare_post_commit_action has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderService::validate_provider_settings (cognitive 26) src-tauri/src/services/provider/mod.rs:3763 — ProviderService::validate_provider_settings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderService::extract_codex_common_config_from_config_toml (cognitive 22) src-tauri/src/services/provider/codex.rs:118 — ProviderService::extract_codex_common_config_from_config_toml has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderService::run_staged_transaction (cognitive 22) src-tauri/src/services/provider/mod.rs:847 — ProviderService::run_staged_transaction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 4 (5 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ProviderService::query_provider_usage (cognitive 20) src-tauri/src/services/provider/usage.rs:155 — ProviderService::query_provider_usage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 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.
  • ProviderService::set_common_config_snippet (cognitive 19) src-tauri/src/services/provider/mod.rs:2198 — ProviderService::set_common_config_snippet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ProviderService::prepare_live_snapshot (cognitive 19) src-tauri/src/services/provider/mod.rs:3409 — ProviderService::prepare_live_snapshot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts), boolean chains 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.
  • ProviderService::import_default_config (cognitive 18) src-tauri/src/services/provider/mod.rs:2673 — ProviderService::import_default_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: ProxyService src-tauri/src/services/proxy.rs:50 — ClassTooLong — 2988 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 162 methods, 2 blocks, lines 50-4306. The bar is 400 significant lines; this is 2588 over it, 7.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.
  • ClassTooLong: ProviderService src-tauri/src/services/provider/mod.rs:91 — ClassTooLong — 2682 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 157 methods. The bar is 400 significant lines; this is 2282 over it, 6.71× 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: SkillService src-tauri/src/services/skill.rs:622 — ClassTooLong — 2126 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 126 methods. The bar is 400 significant lines; this is 1726 over it, 5.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SessionsState src-tauri/src/cli/tui/app/types.rs:1121 — ClassTooLong — 1525 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 111 methods, 3 blocks, lines 1121-4242. The bar is 400 significant lines; this is 1125 over it, 3.81× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Supervisor src-tauri/src/daemon/supervisor.rs:91 — ClassTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 3 blocks, lines 91-1170. The bar is 400 significant lines; this is 361 over it, 1.90× 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: CodexOAuthManager src-tauri/src/proxy/providers/codex_oauth_auth.rs:317 — ClassTooLong — 698 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 28 methods, 2 blocks, lines 317-1513. The bar is 400 significant lines; this is 298 over it, 1.75× 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: RequestForwarder src-tauri/src/proxy/forwarder.rs:28 — ClassTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 28-1096. The bar is 400 significant lines; this is 268 over it, 1.67× 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: CopilotAuthManager src-tauri/src/proxy/providers/copilot_auth.rs:411 — ClassTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 2 blocks, lines 411-1563. The bar is 400 significant lines; this is 262 over it, 1.66× 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: ChatToResponsesState src-tauri/src/proxy/providers/streaming_codex_chat.rs:66 — ClassTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 3 blocks, lines 66-888. The bar is 400 significant lines; this is 175 over it, 1.44× 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: TranscriptIndexStore src-tauri/src/session_manager/transcript.rs:426 — ClassTooLong — 573 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 426-1240. The bar is 400 significant lines; this is 173 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TranscriptRemotePager src-tauri/src/cli/tui/app/types.rs:1023 — ClassTooLong — 513 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 28 methods, 2 blocks, lines 1023-2036. The bar is 400 significant lines; this is 113 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EditorState src-tauri/src/cli/tui/app/editor_state.rs:80 — ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 80-820. The bar is 400 significant lines; this is 100 over it, 1.25× 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: UiDataByAppCache src-tauri/src/cli/tui/mod.rs:446 — ClassTooLong — 454 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 2 blocks, lines 446-1235. The bar is 400 significant lines; this is 54 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ScanCacheStore src-tauri/src/session_manager/scan_cache_store.rs:39 — ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 2 blocks, lines 39-743. The bar is 400 significant lines; this is 16 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×14
  • Duplicated block (13 lines × 2) src-tauri/src/cli/claude_temp_launch.rs:280 — src-tauri/src/cli/claude_temp_launch.rs:280-292 | src-tauri/src/cli/codex_temp_launch.rs:309-321 — before extracting anything, compare `src-tauri/src/cli/claude_temp_launch.rs` and `src-tauri/src/cli/codex_temp_launch.rs` as WHOLE FILES: this scan already matched 5 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 (13 lines × 2) src-tauri/src/cli/commands/provider_input.rs:2714 — src-tauri/src/cli/commands/provider_input.rs:2714-2726 | src-tauri/src/cli/commands/provider_input.rs:2740-2752 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/provider_input.rs:3657 — src-tauri/src/cli/commands/provider_input.rs:3657-3669 | src-tauri/src/cli/tui/form/provider_json.rs:1552-1564 — before extracting anything, compare `src-tauri/src/cli/commands/provider_input.rs` and `src-tauri/src/cli/tui/form/provider_json.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src-tauri/src/cli/commands/provider_inspect.rs:987 — src-tauri/src/cli/commands/provider_inspect.rs:987-999 | src-tauri/src/cli/tui/ui/shared.rs:628-640 — 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) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:330 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:330-342 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:366-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 (13 lines × 2) src-tauri/src/cli/tui/mod.rs:3706 — src-tauri/src/cli/tui/mod.rs:3706-3718 | src-tauri/src/cli/tui/mod.rs:3763-3775 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/forwarder.rs:345 — src-tauri/src/proxy/forwarder.rs:345-357 | src-tauri/src/proxy/forwarder.rs:590-602 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/response.rs:601 — src-tauri/src/proxy/response.rs:601-613 | src-tauri/src/proxy/response.rs:853-865 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/proxy.rs:3152 — src-tauri/src/services/proxy.rs:3152-3164 | src-tauri/src/services/proxy.rs:3201-3213 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/proxy/codex_toml.rs:7 — src-tauri/src/services/proxy/codex_toml.rs:7-19 | src-tauri/src/services/proxy/codex_toml.rs:46-58 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/hermes.rs:156 — src-tauri/src/session_manager/providers/hermes.rs:156-168 | REDACTED:178-190 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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 (13 lines × 2) src-tauri/src/session_manager/terminal/mod.rs:33 — src-tauri/src/session_manager/terminal/mod.rs:33-45 | src-tauri/src/session_manager/terminal/mod.rs:56-72 — both copies are in the same file, so extract the block into 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) src-tauri/src/database/dao/proxy.rs:257 — src-tauri/src/database/dao/proxy.rs:257-269 | src-tauri/src/database/dao/proxy.rs:309-321 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/hermes.rs:180 — src-tauri/src/session_manager/providers/hermes.rs:180-192 | REDACTED:210-222 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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.
D2 · Cognitive Complexity · SkillService · ×12
  • SkillService::migrate_storage (cognitive 92) src-tauri/src/services/skill.rs:2025 — SkillService::migrate_storage has cognitive complexity 92 (threshold 15). Drivers by points: if/else 24 (59 pts), match/switch 5 (14 pts), loops 7 (11 pts), boolean chains 8 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SkillService::migrate_ssot_if_pending (cognitive 79) src-tauri/src/services/skill.rs:893 — SkillService::migrate_ssot_if_pending has cognitive complexity 79 (threshold 15). Drivers by points: if/else 17 (53 pts), match/switch 6 (16 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 50). 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.
  • SkillService::check_updates (cognitive 39) src-tauri/src/services/skill.rs:2539 — SkillService::check_updates has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 6 (20 pts), if/else 5 (15 pts), loops 3 (4 pts) (nesting depth added 25). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
  • SkillService::update_skill (cognitive 28) src-tauri/src/services/skill.rs:2679 — SkillService::update_skill has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 1, loops 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.
  • SkillService::scan_unmanaged (cognitive 26) src-tauri/src/services/skill.rs:3349 — SkillService::scan_unmanaged has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SkillService::import_from_apps (cognitive 24) src-tauri/src/services/skill.rs:3434 — SkillService::import_from_apps has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (6 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.
  • SkillService::extract_repo_archive_with_limits (cognitive 23) src-tauri/src/services/skill/discovery.rs:578 — SkillService::extract_repo_archive_with_limits has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 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.
  • SkillService::sync_to_app_unlocked (cognitive 23) src-tauri/src/services/skill.rs:1584 — SkillService::sync_to_app_unlocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 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.
  • SkillService::merge_local_ssot_skills (cognitive 20) src-tauri/src/services/skill/discovery.rs:103 — SkillService::merge_local_ssot_skills has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), match/switch 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.
  • SkillService::source_path_from_readme (cognitive 20) src-tauri/src/services/skill.rs:2451 — SkillService::source_path_from_readme has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SkillService::sync_updated_skill_to_app (cognitive 17) src-tauri/src/services/skill.rs:1421 — SkillService::sync_updated_skill_to_app has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SkillService::migration_tree_hash_with_ignored_root_file::visit (cognitive 17) src-tauri/src/services/skill.rs:1677 — SkillService::migration_tree_hash_with_ignored_root_file::visit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyMethods · ×12
  • TooManyMethods: App src-tauri/src/cli/tui/app/app_state.rs:722 — TooManyMethods — 281 methods, declared across 19 files: app/menu.rs (61), app/content_config.rs (53), form_handlers/provider.rs (36), overlay_handlers/pickers.rs (29), +15 more file(s). The bar is 30 methods; this is 251 over it, 9.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Database src-tauri/src/database/mod.rs:381 — TooManyMethods — 251 methods, declared across 17 files: dao/proxy.rs (46), database/schema.rs (41), REDACTED (37), dao/settings.rs (25), +13 more file(s). The bar is 30 methods; this is 221 over it, 8.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProviderAddFormState src-tauri/src/cli/tui/form.rs:541 — TooManyMethods — 206 methods, declared across 4 files: form/provider_state.rs (178), form/provider_json.rs (15), form/provider_templates.rs (11), tui/form.rs (2). The bar is 30 methods; this is 176 over it, 6.87× 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: ProxyService src-tauri/src/services/proxy.rs:50 — TooManyMethods — 162 methods. The bar is 30 methods; this is 132 over it, 5.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProviderService src-tauri/src/services/provider/mod.rs:91 — TooManyMethods — 157 methods, declared across 10 files: provider/mod.rs (102), provider/codex.rs (15), provider/usage.rs (9), provider/claude.rs (8), +6 more file(s). The bar is 30 methods; this is 127 over it, 5.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SkillService src-tauri/src/services/skill.rs:622 — TooManyMethods — 126 methods, declared across 2 files: services/skill.rs (101), skill/discovery.rs (25). The bar is 30 methods; this is 96 over it, 4.20× 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: SessionsState src-tauri/src/cli/tui/app/types.rs:1121 — TooManyMethods — 111 methods. The bar is 30 methods; this is 81 over it, 3.70× 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: McpAddFormState src-tauri/src/cli/tui/form.rs:693 — TooManyMethods — 41 methods, declared across 2 files: form/mcp.rs (40), tui/form.rs (1). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PagedListState src-tauri/src/cli/tui/app/paged_list.rs:143 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CopilotAuthManager src-tauri/src/proxy/providers/copilot_auth.rs:411 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PagedManifestStore src-tauri/src/session_manager/paged_manifest.rs:395 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Supervisor src-tauri/src/daemon/supervisor.rs:91 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D1 · Cyclomatic Complexity · ProviderService · ×11
  • ProviderService::refresh_provider_snapshot (cyclomatic 36) src-tauri/src/services/provider/mod.rs:1358 — ProviderService::refresh_provider_snapshot has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::delete (cyclomatic 29) src-tauri/src/services/provider/mod.rs:3973 — ProviderService::delete has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::apply_prepared_post_commit_action (cyclomatic 25) src-tauri/src/services/provider/mod.rs:1188 — ProviderService::apply_prepared_post_commit_action has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::update (cyclomatic 23) src-tauri/src/services/provider/mod.rs:2494 — ProviderService::update 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.
  • ProviderService::fetch_provider_models (cyclomatic 21) src-tauri/src/services/provider/models.rs:24 — ProviderService::fetch_provider_models has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::build_effective_live_snapshot (cyclomatic 19) src-tauri/src/services/provider/mod.rs:3632 — ProviderService::build_effective_live_snapshot 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.
  • ProviderService::validate_provider_settings (cyclomatic 19) src-tauri/src/services/provider/mod.rs:3763 — ProviderService::validate_provider_settings 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.
  • ProviderService::save_claude_from_editor (cyclomatic 18) src-tauri/src/services/provider/claude_editor_service.rs:15 — ProviderService::save_claude_from_editor 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.
  • ProviderService::prepare_post_commit_action (cyclomatic 17) src-tauri/src/services/provider/mod.rs:1007 — ProviderService::prepare_post_commit_action has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::import_default_config (cyclomatic 17) src-tauri/src/services/provider/mod.rs:2673 — ProviderService::import_default_config has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderService::sync_current_to_live (cyclomatic 16) src-tauri/src/services/provider/mod.rs:3132 — ProviderService::sync_current_to_live 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 (15 lines × 2) · ×11
  • Duplicated block (15 lines × 2) src-tauri/src/claude_mcp.rs:338 — src-tauri/src/claude_mcp.rs:338-352 | src-tauri/src/gemini_mcp.rs:176-190 — before extracting anything, compare `src-tauri/src/claude_mcp.rs` and `src-tauri/src/gemini_mcp.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/tui/app/content_entities.rs:814 — src-tauri/src/cli/tui/app/content_entities.rs:814-828 | src-tauri/src/cli/tui/app/content_entities.rs:855-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src-tauri/src/cli/tui/app/content_entities.rs:830 — src-tauri/src/cli/tui/app/content_entities.rs:830-844 | src-tauri/src/cli/tui/app/content_entities.rs:871-885 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/types.rs:1840 — src-tauri/src/cli/tui/app/types.rs:1840-1854 | src-tauri/src/cli/tui/app/types.rs:2215-2229 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/forwarder.rs:737 — src-tauri/src/proxy/forwarder.rs:737-751 | src-tauri/src/proxy/forwarder.rs:934-948 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/handlers.rs:395 — src-tauri/src/proxy/handlers.rs:395-409 | src-tauri/src/proxy/handlers.rs:822-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src-tauri/src/proxy/response.rs:218 — src-tauri/src/proxy/response.rs:218-232 | src-tauri/src/proxy/response.rs:282-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src-tauri/src/services/provider/mod.rs:2937 — src-tauri/src/services/provider/mod.rs:2937-2951 | src-tauri/src/services/provider/mod.rs:4028-4042 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/usage_stats.rs:852 — src-tauri/src/services/usage_stats.rs:852-866 | src-tauri/src/services/usage_stats.rs:1017-1031 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/codex.rs:886 — src-tauri/src/session_manager/providers/codex.rs:886-900 | src-tauri/src/session_manager/providers/openclaw.rs:541-555 — before extracting anything, compare `src-tauri/src/session_manager/providers/codex.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/session_manager/providers/hermes.rs:952 — src-tauri/src/session_manager/providers/hermes.rs:952-966 | REDACTED:1396-1410 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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 (16 lines × 2) · ×10
  • Duplicated block (16 lines × 2) src-tauri/src/cli/tui/app/types.rs:1948 — src-tauri/src/cli/tui/app/types.rs:1948-1963 | src-tauri/src/cli/tui/app/types.rs:2283-2298 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/form/provider_json.rs:1374 — src-tauri/src/cli/tui/form/provider_json.rs:1374-1389 | src-tauri/src/services/provider/common.rs:159-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) src-tauri/src/cli/tui/ui/config.rs:403 — src-tauri/src/cli/tui/ui/config.rs:403-418 | src-tauri/src/cli/tui/ui/config.rs:431-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src-tauri/src/database/dao/proxy.rs:80 — src-tauri/src/database/dao/proxy.rs:80-95 | src-tauri/src/database/dao/proxy.rs:111-126 — both copies are in the same file, so extract the block into 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) src-tauri/src/mcp.rs:400 — src-tauri/src/mcp.rs:400-415 | src-tauri/src/mcp.rs:791-806 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/s3.rs:282 — src-tauri/src/services/s3.rs:282-297 | src-tauri/src/services/s3.rs:398-413 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/usage_stats.rs:529 — src-tauri/src/services/usage_stats.rs:529-544 | src-tauri/src/services/usage_stats.rs:935-950 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/config.rs:184 — src-tauri/src/cli/commands/config.rs:184-201 | src-tauri/src/cli/commands/config.rs:310-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src-tauri/src/services/subscription.rs:1289 — src-tauri/src/services/subscription.rs:1289-1304 | src-tauri/src/services/subscription.rs:1349-1364 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/commands/env.rs:151 — src-tauri/src/cli/commands/env.rs:151-166 | src-tauri/src/cli/commands/env.rs:174-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×10
  • Duplicated block (9 lines × 3) src-tauri/src/cli/commands/provider_inspect.rs:1083 — src-tauri/src/cli/commands/provider_inspect.rs:1083-1091 | src-tauri/src/cli/commands/provider_inspect.rs:1103-1111 | src-tauri/src/cli/commands/provider_inspect.rs:1122-1130 — 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:687 — src-tauri/src/cli/tui/runtime_actions/editor.rs:687-695 | src-tauri/src/cli/tui/runtime_actions/editor.rs:757-765 | src-tauri/src/cli/tui/runtime_actions/editor.rs:850-858 — 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) src-tauri/src/cli/tui/ui/overlay/mcp_key_value.rs:121 — src-tauri/src/cli/tui/ui/overlay/mcp_key_value.rs:121-129 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:255-263 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:1141-1149 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) src-tauri/src/proxy/providers/streaming_responses.rs:357 — src-tauri/src/proxy/providers/streaming_responses.rs:357-365 | src-tauri/src/proxy/providers/streaming_responses.rs:563-571 | src-tauri/src/proxy/providers/streaming_responses.rs:708-716 — 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) src-tauri/src/services/session_usage.rs:1054 — src-tauri/src/services/session_usage.rs:1054-1062 | src-tauri/src/services/session_usage_codex.rs:1935-1943 | src-tauri/src/services/session_usage_gemini.rs:264-272 — before extracting anything, compare `src-tauri/src/services/session_usage.rs` and `src-tauri/src/services/session_usage_codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/session_manager/providers/claude.rs:239 — src-tauri/src/session_manager/providers/claude.rs:239-248 | src-tauri/src/session_manager/providers/codex.rs:870-878 | src-tauri/src/session_manager/providers/openclaw.rs:525-534 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/session_manager/providers/codex.rs:752 — src-tauri/src/session_manager/providers/codex.rs:752-760 | src-tauri/src/session_manager/providers/hermes.rs:840-848 | src-tauri/src/session_manager/providers/openclaw.rs:402-410 — before extracting anything, compare `src-tauri/src/session_manager/providers/codex.rs` and `src-tauri/src/session_manager/providers/hermes.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.
  • Duplicated block (9 lines × 3) src-tauri/src/session_manager/providers/gemini.rs:52 — src-tauri/src/session_manager/providers/gemini.rs:52-63 | src-tauri/src/session_manager/providers/openclaw.rs:80-91 | src-tauri/src/session_manager/providers/pi.rs:331-339 — before extracting anything, compare `src-tauri/src/session_manager/providers/gemini.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 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 (9 lines × 3) src-tauri/src/session_manager/providers/claude.rs:250 — src-tauri/src/session_manager/providers/claude.rs:250-258 | src-tauri/src/session_manager/providers/codex.rs:889-897 | src-tauri/src/session_manager/providers/openclaw.rs:544-552 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/openclaw_config.rs:830 — src-tauri/src/openclaw_config.rs:830-838 | src-tauri/src/openclaw_config.rs:909-917 | src-tauri/src/openclaw_config.rs:946-954 — 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D15 · Churn × Complexity Hotspots · Repeated repair · ×8
  • Repeated repair: src-tauri/src/codex_config.rs src-tauri/src/codex_config.rs:3494 — src-tauri/src/codex_config.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is cc_switch::codex_config::codex_auth_resolved_mode at line 3494), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex): preserve provider authentication in forms”; “fix(codex): align provider switching and auth with upstream (#486)”; “fix(codex): respect user-owned model_catalog_json when generating catalog (#454)”; “fix(codex): align official login preservation with upstream”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/codex_config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/cli/provider_quota.rs src-tauri/src/cli/provider_quota.rs:202 — src-tauri/src/cli/provider_quota.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is cc_switch::cli::provider_quota::usage_value_summary at line 202), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): align managed OAuth quota controls with upstream”; “fix(tui): clarify managed Codex OAuth quota refresh controls”; “fix(database): align schema and migrations with upstream v20 (#484)”; “fix(usage): align official subscription queries”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/provider_quota.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/services/sync_protocol.rs src-tauri/src/services/sync_protocol.rs:212 — src-tauri/src/services/sync_protocol.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is cc_switch::services::sync_protocol::validate_manifest_compat at line 212), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(database): align schema migrations through upstream v22 (#528)”; “fix(database): align schema and migrations with upstream v20 (#484)”; “fix(config): avoid nested executor during SQL import”; “fix(skills): coordinate state mutations”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/services/sync_protocol.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/cli/tui/ui/forms/shared.rs src-tauri/src/cli/tui/ui/forms/shared.rs:14 — src-tauri/src/cli/tui/ui/forms/shared.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is cc_switch::cli::tui::ui::forms::shared::add_form_key_items at line 14), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude): align configuration editing with upstream (#536)”; “fix(tui): add independent 1M toggle for Claude default model (#519)”; “fix(tui): replace provider template chip row with a template field and grouped picker (#428)”; “fix(tui): persist provider common config changes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/tui/ui/forms/shared.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/cli/commands/auth.rs src-tauri/src/cli/commands/auth.rs:372 — src-tauri/src/cli/commands/auth.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is cc_switch::cli::commands::auth::reset_quota at line 372), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex-oauth): isolate shared workspace accounts (#509)”; “fix: pin quota reset targets and distinguish inspection failures (#477)”; “fix(database): align schema and migrations with upstream v20 (#484)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/commands/auth.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/services/provider/codex.rs src-tauri/src/services/provider/codex.rs:118 — src-tauri/src/services/provider/codex.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ProviderService::extract_codex_common_config_from_config_toml at line 118), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex): align provider switching and auth with upstream (#486)”; “fix(provider): preserve Codex model mappings on switch”; “fix(codex): refresh auth during forced provider sync”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/services/provider/codex.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/proxy/providers/codex.rs src-tauri/src/proxy/providers/codex.rs:317 — src-tauri/src/proxy/providers/codex.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is cc_switch::proxy::providers::codex::infer_codex_chat_reasoning_config at line 317), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex): infer OpenCode Zen reasoning settings”; “fix: align credential display across config views”; “fix(codex): resolve active provider base URL”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/proxy/providers/codex.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src-tauri/src/cli/commands/provider_usage_query.rs src-tauri/src/cli/commands/provider_usage_query.rs:230 — src-tauri/src/cli/commands/provider_usage_query.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is cc_switch::cli::commands::provider_usage_query::set at line 230), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: align credential display across config views”; “fix(usage): align official subscription queries”; “fix(codex): resolve active provider base URL”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 22:25:41 +08:00' --until='2026-10-25 22:25:41 +08:00' --full-history --no-merges -- src-tauri/src/cli/commands/provider_usage_query.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.
D2 · Cognitive Complexity · ProviderAddFormState · ×8
  • ProviderAddFormState::to_provider_json_value (cognitive 219) src-tauri/src/cli/tui/form/provider_json.rs:281 — ProviderAddFormState::to_provider_json_value has cognitive complexity 219 (threshold 15). Drivers by points: if/else 77 (188 pts), match/switch 8 (20 pts), boolean chains 7, loops 2 (4 pts) (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.
  • ProviderAddFormState::update_provider_meta (cognitive 95) src-tauri/src/cli/tui/form/provider_json.rs:844 — ProviderAddFormState::update_provider_meta has cognitive complexity 95 (threshold 15). Drivers by points: if/else 47 (80 pts), boolean chains 10, match/switch 2 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderAddFormState::apply_sponsor_preset (cognitive 34) src-tauri/src/cli/tui/form/provider_templates.rs:739 — ProviderAddFormState::apply_sponsor_preset has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderAddFormState::apply_template_fields (cognitive 25) src-tauri/src/cli/tui/form/provider_templates.rs:501 — ProviderAddFormState::apply_template_fields has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderAddFormState::fields (cognitive 24) src-tauri/src/cli/tui/form/provider_state.rs:480 — ProviderAddFormState::fields has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderAddFormState::normalized_codex_model_catalog_for_save (cognitive 21) src-tauri/src/cli/tui/form/provider_json.rs:1211 — ProviderAddFormState::normalized_codex_model_catalog_for_save has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProviderAddFormState::apply_provider_json_value_to_fields (cognitive 19) src-tauri/src/cli/tui/form/provider_state.rs:2786 — ProviderAddFormState::apply_provider_json_value_to_fields has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ProviderAddFormState::toggle_include_common_config (cognitive 16) src-tauri/src/cli/tui/form/provider_state.rs:2903 — ProviderAddFormState::toggle_include_common_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×8
  • Duplicated block (10 lines × 3) src-tauri/src/cli/tui/app/helpers.rs:1444 — src-tauri/src/cli/tui/app/helpers.rs:1444-1453 | src-tauri/src/cli/tui/ui/sessions.rs:734-743 | src-tauri/src/session_manager/query_manifest.rs:195-204 — before extracting anything, compare `src-tauri/src/cli/tui/app/helpers.rs` and `src-tauri/src/session_manager/query_manifest.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) src-tauri/src/cli/tui/ui/config.rs:870 — src-tauri/src/cli/tui/ui/config.rs:870-879 | src-tauri/src/cli/tui/ui/config.rs:1368-1377 | src-tauri/src/cli/tui/ui/config.rs:2262-2271 — 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 (10 lines × 3) src-tauri/src/deeplink/provider.rs:405 — src-tauri/src/deeplink/provider.rs:405-414 | src-tauri/src/deeplink/provider.rs:433-442 | src-tauri/src/deeplink/provider.rs:729-738 — 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 (10 lines × 3) src-tauri/src/proxy/handlers.rs:274 — src-tauri/src/proxy/handlers.rs:274-283 | src-tauri/src/proxy/handlers.rs:391-400 | src-tauri/src/proxy/handlers.rs:818-827 — 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 (10 lines × 3) src-tauri/src/proxy/providers/codex.rs:364 — src-tauri/src/proxy/providers/codex.rs:364-373 | src-tauri/src/proxy/providers/codex.rs:376-385 | src-tauri/src/proxy/providers/codex.rs:412-421 — 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 (10 lines × 3) src-tauri/src/proxy/response.rs:324 — src-tauri/src/proxy/response.rs:324-333 | src-tauri/src/proxy/response.rs:371-380 | src-tauri/src/proxy/response.rs:401-410 — 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 (10 lines × 3) src-tauri/src/services/coding_plan.rs:127 — src-tauri/src/services/coding_plan.rs:127-136 | src-tauri/src/services/coding_plan.rs:298-307 | src-tauri/src/services/coding_plan.rs:383-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.
  • Duplicated block (10 lines × 3) src-tauri/src/services/s3.rs:283 — src-tauri/src/services/s3.rs:283-292 | src-tauri/src/services/s3.rs:346-355 | src-tauri/src/services/s3.rs:399-408 — 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 (19 lines × 2) · ×7
  • Duplicated block (19 lines × 2) src-tauri/src/cli/commands/provider_input.rs:2690 — src-tauri/src/cli/commands/provider_input.rs:2690-2708 | src-tauri/src/cli/tui/form/provider_json.rs:430-448 — before extracting anything, compare `src-tauri/src/cli/commands/provider_input.rs` and `src-tauri/src/cli/tui/form/provider_json.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) src-tauri/src/cli/tui/app/types.rs:3178 — src-tauri/src/cli/tui/app/types.rs:3178-3196 | src-tauri/src/cli/tui/app/types.rs:3294-3312 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/form/provider_state.rs:2682 — src-tauri/src/cli/tui/form/provider_state.rs:2682-2700 | src-tauri/src/cli/tui/form/provider_state.rs:2790-2808 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/claude.rs:399 — src-tauri/src/proxy/providers/claude.rs:399-417 | src-tauri/src/proxy/providers/gemini.rs:53-71 — before extracting anything, compare `src-tauri/src/proxy/providers/claude.rs` and `src-tauri/src/proxy/providers/gemini.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/proxy/providers/claude.rs:472 — src-tauri/src/proxy/providers/claude.rs:472-490 | src-tauri/src/proxy/providers/gemini.rs:141-159 — before extracting anything, compare `src-tauri/src/proxy/providers/claude.rs` and `src-tauri/src/proxy/providers/gemini.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/session_manager/cache.rs:202 — src-tauri/src/session_manager/cache.rs:202-220 | src-tauri/src/session_manager/cache.rs:321-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) src-tauri/src/usage_script.rs:74 — src-tauri/src/usage_script.rs:74-92 | src-tauri/src/usage_script.rs:154-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×7
  • Duplicated block (6 lines × 3) src-tauri/src/cli/commands/provider.rs:351 — src-tauri/src/cli/commands/provider.rs:351-356 | src-tauri/src/cli/commands/provider.rs:604-609 | src-tauri/src/cli/commands/provider_input.rs:4045-4050 — 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) src-tauri/src/cli/commands/provider_input.rs:4096 — src-tauri/src/cli/commands/provider_input.rs:4096-4101 | src-tauri/src/cli/commands/provider_input.rs:4402-4407 | src-tauri/src/cli/commands/provider_input.rs:4421-4426 — 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) src-tauri/src/proxy/providers/transform.rs:339 — src-tauri/src/proxy/providers/transform.rs:339-344 | src-tauri/src/proxy/providers/transform_gemini.rs:573-582 | src-tauri/src/proxy/providers/transform_responses.rs:540-546 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 5 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 (6 lines × 3) src-tauri/src/services/session_usage.rs:687 — src-tauri/src/services/session_usage.rs:687-692 | src-tauri/src/services/session_usage_codex.rs:1514-1519 | src-tauri/src/services/session_usage_gemini.rs:140-145 — before extracting anything, compare `src-tauri/src/services/session_usage.rs` and `src-tauri/src/services/session_usage_codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/app_config.rs:745 — src-tauri/src/app_config.rs:745-751 | src-tauri/src/proxy/providers/gemini.rs:97-102 | src-tauri/src/proxy/usage/parser.rs:298-303 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) src-tauri/src/deeplink/provider.rs:530 — src-tauri/src/deeplink/provider.rs:530-535 | src-tauri/src/deeplink/provider.rs:597-602 | src-tauri/src/deeplink/provider.rs:643-648 — 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) src-tauri/src/config.rs:654 — src-tauri/src/config.rs:654-659 | src-tauri/src/database/mod.rs:133-138 | src-tauri/src/database/mod.rs:152-157 — before extracting anything, compare `src-tauri/src/config.rs` and `src-tauri/src/database/mod.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/cli/tui/ui/overlay/basic.rs:243 — src-tauri/src/cli/tui/ui/overlay/basic.rs:243-271 | src-tauri/src/cli/tui/ui/overlay/basic.rs:305-335 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2536-2580 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2587-2626 — 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) src-tauri/src/codex_history_migration.rs:900 — src-tauri/src/codex_history_migration.rs:900-959 | src-tauri/src/codex_history_migration.rs:972-1034 | src-tauri/src/codex_history_migration.rs:1042-1114 | src-tauri/src/codex_history_migration.rs:1122-1177 — 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) src-tauri/src/deeplink/provider.rs:508 — src-tauri/src/deeplink/provider.rs:508-563 | src-tauri/src/deeplink/provider.rs:610-651 | src-tauri/src/deeplink/provider.rs:656-694 | src-tauri/src/deeplink/provider.rs:699-746 — 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) src-tauri/src/mcp.rs:348 — src-tauri/src/mcp.rs:348-415 | src-tauri/src/mcp.rs:743-806 | src-tauri/src/mcp.rs:907-975 | src-tauri/src/mcp.rs:1625-1714 — 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) src-tauri/src/mcp.rs:809 — src-tauri/src/mcp.rs:809-856 | src-tauri/src/mcp.rs:859-904 | src-tauri/src/mcp.rs:1456-1502 | src-tauri/src/mcp.rs:1506-1547 — 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) src-tauri/src/session_manager/providers/claude.rs:57 — src-tauri/src/session_manager/providers/claude.rs:57-69 | src-tauri/src/session_manager/providers/codex.rs:683-695 | src-tauri/src/session_manager/providers/hermes.rs:757-769 | src-tauri/src/session_manager/providers/openclaw.rs:354-366 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • Duplicated block (11–12 lines × 2) src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:813 — src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:813-823 | src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:827-838 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/mod.rs:1721 — src-tauri/src/cli/tui/mod.rs:1721-1732 | src-tauri/src/cli/tui/mod.rs:1804-1814 — both copies are in the same file, so extract the block into 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) src-tauri/src/codex_history_migration.rs:917 — src-tauri/src/codex_history_migration.rs:917-927 | src-tauri/src/codex_history_migration.rs:1144-1155 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/session_usage_codex.rs:1994 — src-tauri/src/services/session_usage_codex.rs:1994-2005 | src-tauri/src/services/session_usage_gemini.rs:354-364 — before extracting anything, compare `src-tauri/src/services/session_usage_codex.rs` and `src-tauri/src/services/session_usage_gemini.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 (11–12 lines × 2) src-tauri/src/session_manager/providers/codex.rs:870 — src-tauri/src/session_manager/providers/codex.rs:870-880 | src-tauri/src/session_manager/providers/openclaw.rs:525-536 — before extracting anything, compare `src-tauri/src/session_manager/providers/codex.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/session_manager/providers/hermes.rs:638 — src-tauri/src/session_manager/providers/hermes.rs:638-649 | src-tauri/src/session_manager/providers/hermes.rs:706-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×6
  • Duplicated block (5 lines × 3) src-tauri/src/cli/claude_temp_launch.rs:273 — src-tauri/src/cli/claude_temp_launch.rs:273-277 | src-tauri/src/cli/codex_temp_launch.rs:302-306 | src-tauri/src/cli/commands/update.rs:1304-1308 — before extracting anything, compare `src-tauri/src/cli/claude_temp_launch.rs` and `src-tauri/src/cli/codex_temp_launch.rs` as WHOLE FILES: this scan already matched 5 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 (5 lines × 3) src-tauri/src/cli/commands/provider.rs:1578 — src-tauri/src/cli/commands/provider.rs:1578-1582 | src-tauri/src/cli/commands/provider.rs:1714-1718 | src-tauri/src/cli/commands/provider.rs:1992-1996 — 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) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:531 — src-tauri/src/proxy/providers/transform_codex_anthropic.rs:531-535 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:567-572 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:589-594 — 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) src-tauri/src/cli/commands/provider.rs:507 — src-tauri/src/cli/commands/provider.rs:507-511 | src-tauri/src/cli/commands/provider.rs:1168-1172 | src-tauri/src/cli/tui/data.rs:3534-3538 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) src-tauri/src/cli/commands/provider_input.rs:4101 — src-tauri/src/cli/commands/provider_input.rs:4101-4105 | src-tauri/src/cli/commands/provider_input.rs:4388-4392 | src-tauri/src/cli/commands/provider_input.rs:4407-4411 — 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) src-tauri/src/cli/commands/start.rs:409 — src-tauri/src/cli/commands/start.rs:409-413 | src-tauri/src/cli/tui/runtime_actions/claude_temp_launch.rs:93-97 | src-tauri/src/cli/tui/runtime_actions/codex_temp_launch.rs:94-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D1 · Cyclomatic Complexity · ProviderAddFormState · ×5
  • ProviderAddFormState::to_provider_json_value (cyclomatic 81) src-tauri/src/cli/tui/form/provider_json.rs:281 — ProviderAddFormState::to_provider_json_value has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderAddFormState::update_provider_meta (cyclomatic 49) src-tauri/src/cli/tui/form/provider_json.rs:844 — ProviderAddFormState::update_provider_meta has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ProviderAddFormState::apply_sponsor_preset (cyclomatic 28) src-tauri/src/cli/tui/form/provider_templates.rs:739 — ProviderAddFormState::apply_sponsor_preset 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.
  • ProviderAddFormState::fields (cyclomatic 22) src-tauri/src/cli/tui/form/provider_state.rs:480 — ProviderAddFormState::fields 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. This is NOT this file's highest cyclomatic complexity: ProviderAddFormState::input (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • ProviderAddFormState::apply_template_fields (cyclomatic 20) src-tauri/src/cli/tui/form/provider_templates.rs:501 — ProviderAddFormState::apply_template_fields 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 · RequestForwarder · ×5
  • RequestForwarder::prepare_request_with_client (cyclomatic 43) src-tauri/src/proxy/forwarder/request_builder.rs:126 — RequestForwarder::prepare_request_with_client has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RequestForwarder::send_buffered_request (cyclomatic 26) src-tauri/src/proxy/forwarder.rs:903 — RequestForwarder::send_buffered_request 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.
  • RequestForwarder::forward_response_detailed (cyclomatic 24) src-tauri/src/proxy/forwarder.rs:244 — RequestForwarder::forward_response_detailed 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. This shape REPEATS in the file: one other method here (RequestForwarder::forward_buffered_response_detailed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • RequestForwarder::forward_buffered_response_detailed (cyclomatic 24) src-tauri/src/proxy/forwarder.rs:489 — RequestForwarder::forward_buffered_response_detailed 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. This shape REPEATS in the file: one other method here (RequestForwarder::forward_response_detailed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • RequestForwarder::send_streaming_request (cyclomatic 24) src-tauri/src/proxy/forwarder.rs:706 — RequestForwarder::send_streaming_request 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.
D2 · Cognitive Complexity · RequestForwarder · ×5
  • RequestForwarder::send_streaming_request (cognitive 84) src-tauri/src/proxy/forwarder.rs:706 — RequestForwarder::send_streaming_request has cognitive complexity 84 (threshold 15). Drivers by points: if/else 20 (69 pts), match/switch 3 (9 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RequestForwarder::send_buffered_request (cognitive 83) src-tauri/src/proxy/forwarder.rs:903 — RequestForwarder::send_buffered_request has cognitive complexity 83 (threshold 15). Drivers by points: if/else 20 (63 pts), match/switch 4 (13 pts), boolean chains 4, loops 2 (3 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.
  • RequestForwarder::prepare_request_with_client (cognitive 64) src-tauri/src/proxy/forwarder/request_builder.rs:126 — RequestForwarder::prepare_request_with_client has cognitive complexity 64 (threshold 15). Drivers by points: if/else 33 (50 pts), boolean chains 11, match/switch 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.
  • RequestForwarder::forward_response_detailed (cognitive 59) src-tauri/src/proxy/forwarder.rs:244 — RequestForwarder::forward_response_detailed has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (47 pts), match/switch 3 (8 pts), boolean chains 3, loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RequestForwarder::forward_buffered_response_detailed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • RequestForwarder::forward_buffered_response_detailed (cognitive 59) src-tauri/src/proxy/forwarder.rs:489 — RequestForwarder::forward_buffered_response_detailed has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (47 pts), match/switch 3 (8 pts), boolean chains 3, loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RequestForwarder::forward_response_detailed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Database · ×5
  • Database::dump_sql (cognitive 54) REDACTED:1221 — Database::dump_sql has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (45 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Database::get_daily_trends (cognitive 40) src-tauri/src/services/usage_stats.rs:758 — Database::get_daily_trends has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 5 (7 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.
  • Database::apply_schema_migrations_on_conn (cognitive 29) src-tauri/src/database/schema.rs:431 — Database::apply_schema_migrations_on_conn has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (10 pts), match/switch 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.
  • Database::init_impl_inner (cognitive 27) src-tauri/src/database/mod.rs:508 — Database::init_impl_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Database::migrate_v5_to_v6 (cognitive 19) src-tauri/src/database/schema.rs:1266 — Database::migrate_v5_to_v6 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (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 · ProxyService · ×5
  • ProxyService::sync_live_config_to_current_provider (cognitive 37) src-tauri/src/services/proxy.rs:3053 — ProxyService::sync_live_config_to_current_provider has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 4, match/switch 3 (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.
  • ProxyService::proxy_status_from_daemon_response_for_app (cognitive 34) src-tauri/src/services/proxy.rs:1156 — ProxyService::proxy_status_from_daemon_response_for_app has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (32 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.
  • ProxyService::get_status_with_cleanup_for_app (cognitive 32) src-tauri/src/services/proxy.rs:948 — ProxyService::get_status_with_cleanup_for_app has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProxyService::preserve_toml_mcp_servers_from_existing_config (cognitive 19) src-tauri/src/services/proxy.rs:2235 — ProxyService::preserve_toml_mcp_servers_from_existing_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProxyService::enable_takeover_for_app_unlocked_with_options (cognitive 17) src-tauri/src/services/proxy.rs:2719 — ProxyService::enable_takeover_for_app_unlocked_with_options has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7. 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.
D3 · God Classes · TooManyFields · ×5
  • TooManyFields: ProviderAddFormState src-tauri/src/cli/tui/form.rs:541 — TooManyFields — 116 stored fields beside 206 methods. The bar is 30 stored fields; this is 86 over it, 3.87× 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: App src-tauri/src/cli/tui/app/app_state.rs:722 — TooManyFields — 78 stored fields beside 281 methods. The bar is 30 stored fields; this is 48 over it, 2.60× 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: SessionsState src-tauri/src/cli/tui/app/types.rs:1121 — TooManyFields — 69 stored fields beside 111 methods. The bar is 30 stored fields; this is 39 over it, 2.30× 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: AppSettings src-tauri/src/settings.rs:514 — TooManyFields — 40 stored fields beside 6 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DeepLinkImportRequest src-tauri/src/deeplink/mod.rs:27 — TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×5
  • Duplicated block (24 lines × 2) src-tauri/src/cli/tui/mod.rs:3732 — src-tauri/src/cli/tui/mod.rs:3732-3755 | src-tauri/src/cli/tui/mod.rs:3789-3812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) src-tauri/src/cli/tui/ui/config.rs:3000 — src-tauri/src/cli/tui/ui/config.rs:3000-3023 | src-tauri/src/cli/tui/ui/config.rs:3030-3053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) src-tauri/src/cli/tui/ui/forms/provider.rs:910 — src-tauri/src/cli/tui/ui/forms/provider.rs:910-933 | src-tauri/src/cli/tui/ui/forms/provider.rs:1146-1169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) src-tauri/src/cli/tui/ui/usage.rs:900 — src-tauri/src/cli/tui/ui/usage.rs:900-923 | src-tauri/src/cli/tui/ui/usage.rs:951-974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (24 lines × 2) src-tauri/src/proxy/providers/streaming_gemini.rs:375 — src-tauri/src/proxy/providers/streaming_gemini.rs:375-398 | src-tauri/src/proxy/providers/streaming_gemini.rs:445-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×5
  • Duplicated block (22 lines × 2) src-tauri/src/proxy/handlers.rs:610 — src-tauri/src/proxy/handlers.rs:610-631 | src-tauri/src/proxy/handlers.rs:761-782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) src-tauri/src/proxy/http_client.rs:83 — src-tauri/src/proxy/http_client.rs:83-104 | src-tauri/src/proxy/http_client.rs:116-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) src-tauri/src/services/codex_oauth.rs:219 — src-tauri/src/services/codex_oauth.rs:219-240 | src-tauri/src/services/codex_oauth.rs:253-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 (22 lines × 2) src-tauri/src/services/session_usage.rs:1297 — src-tauri/src/services/session_usage.rs:1297-1318 | src-tauri/src/services/session_usage_codex.rs:2012-2033 — before extracting anything, compare `src-tauri/src/services/session_usage.rs` and `src-tauri/src/services/session_usage_codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/session_manager/providers/codex.rs:807 — src-tauri/src/session_manager/providers/codex.rs:807-828 | src-tauri/src/session_manager/providers/openclaw.rs:438-459 — before extracting anything, compare `src-tauri/src/session_manager/providers/codex.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) · ×5
  • Duplicated block (18 lines × 2) src-tauri/src/cli/commands/update.rs:821 — src-tauri/src/cli/commands/update.rs:821-838 | src-tauri/src/cli/commands/update.rs:855-872 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/runtime_actions/editor.rs:687 — src-tauri/src/cli/tui/runtime_actions/editor.rs:687-704 | src-tauri/src/cli/tui/runtime_actions/editor.rs:850-867 — both copies are in the same file, so extract the block into 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) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:814 — src-tauri/src/proxy/providers/transform_codex_anthropic.rs:814-831 | src-tauri/src/proxy/providers/transform_responses.rs:161-178 — before extracting anything, compare `src-tauri/src/proxy/providers/transform_codex_anthropic.rs` and `src-tauri/src/proxy/providers/transform_responses.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.
  • Duplicated block (18 lines × 2) src-tauri/src/proxy/response_handler.rs:282 — src-tauri/src/proxy/response_handler.rs:282-300 | src-tauri/src/proxy/response_handler.rs:308-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) src-tauri/src/session_manager/transcript.rs:972 — src-tauri/src/session_manager/transcript.rs:972-989 | src-tauri/src/session_manager/transcript.rs:1071-1088 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) src-tauri/src/cli/tui/app/form_handlers/provider.rs:248 — src-tauri/src/cli/tui/app/form_handlers/provider.rs:248-264 | src-tauri/src/cli/tui/app/form_handlers/provider.rs:1378-1394 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:489 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:489-505 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:868-884 — both copies are in the same file, so extract the block into 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) src-tauri/src/cli/tui/mod.rs:3609 — src-tauri/src/cli/tui/mod.rs:3609-3625 | src-tauri/src/cli/tui/mod.rs:3631-3647 — both copies are in the same file, so extract the block into 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) src-tauri/src/deeplink/provider.rs:764 — src-tauri/src/deeplink/provider.rs:764-780 | src-tauri/src/services/provider/mod.rs:3596-3612 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) src-tauri/src/session_manager/providers/claude.rs:279 — src-tauri/src/session_manager/providers/claude.rs:279-295 | src-tauri/src/session_manager/providers/codex.rs:917-933 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) · ×5
  • Duplicated block (11 lines × 3) src-tauri/src/cli/tui/runtime_actions/settings.rs:438 — src-tauri/src/cli/tui/runtime_actions/settings.rs:438-448 | src-tauri/src/cli/tui/runtime_actions/settings.rs:468-478 | src-tauri/src/cli/tui/runtime_actions/settings.rs:498-508 — 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) src-tauri/src/cli/tui/ui/config.rs:946 — src-tauri/src/cli/tui/ui/config.rs:946-956 | src-tauri/src/cli/tui/ui/config.rs:1419-1429 | src-tauri/src/cli/tui/ui/config.rs:2314-2324 — 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) src-tauri/src/cli/tui/ui/forms/mcp.rs:75 — src-tauri/src/cli/tui/ui/forms/mcp.rs:75-85 | src-tauri/src/cli/tui/ui/forms/provider.rs:494-504 | src-tauri/src/cli/tui/ui/forms/provider.rs:1537-1547 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 154 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/codex_history_migration.rs:1014 — src-tauri/src/codex_history_migration.rs:1014-1024 | src-tauri/src/codex_history_migration.rs:1094-1104 | src-tauri/src/codex_history_migration.rs:1157-1167 — 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) src-tauri/src/proxy/error.rs:198 — src-tauri/src/proxy/error.rs:198-208 | src-tauri/src/proxy/response/error_summary.rs:31-41 | src-tauri/src/proxy/usage/parser.rs:269-279 — 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×5
  • Swallowed exception (empty catch) scripts/benchmark_cc_switch.py:927 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/benchmark_cc_switch.py:985 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/benchmark_cc_switch.py:1172 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/benchmark_cc_switch.py:2000 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/benchmark_cc_switch.py:2079 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D1 · Cyclomatic Complexity · Database · ×4
  • Database::apply_schema_migrations_on_conn (cyclomatic 33) src-tauri/src/database/schema.rs:431 — Database::apply_schema_migrations_on_conn 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.
  • Database::dump_sql (cyclomatic 21) REDACTED:1221 — Database::dump_sql 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.
  • Database::init_impl_inner (cyclomatic 20) src-tauri/src/database/mod.rs:508 — Database::init_impl_inner 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.
  • Database::get_daily_trends (cyclomatic 20) src-tauri/src/services/usage_stats.rs:758 — Database::get_daily_trends 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 · ProxyService · ×4
  • ProxyService::sync_live_config_to_current_provider (cyclomatic 28) src-tauri/src/services/proxy.rs:3053 — ProxyService::sync_live_config_to_current_provider 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.
  • ProxyService::proxy_status_from_daemon_response_for_app (cyclomatic 20) src-tauri/src/services/proxy.rs:1156 — ProxyService::proxy_status_from_daemon_response_for_app 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.
  • ProxyService::get_status_with_cleanup_for_app (cyclomatic 18) src-tauri/src/services/proxy.rs:948 — ProxyService::get_status_with_cleanup_for_app 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.
  • ProxyService::enable_takeover_for_app_unlocked_with_options (cyclomatic 16) src-tauri/src/services/proxy.rs:2719 — ProxyService::enable_takeover_for_app_unlocked_with_options has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TranscriptIndexStore · ×4
  • TranscriptIndexStore::enforce_cache_budget_with_limits (cognitive 31) src-tauri/src/session_manager/transcript.rs:1059 — TranscriptIndexStore::enforce_cache_budget_with_limits has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TranscriptIndexStore::reserve_build_budget (cognitive 20) src-tauri/src/session_manager/transcript.rs:960 — TranscriptIndexStore::reserve_build_budget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 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.
  • TranscriptIndexStore::open_or_build (cognitive 17) src-tauri/src/session_manager/transcript.rs:456 — TranscriptIndexStore::open_or_build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TranscriptIndexStore::open_current (cognitive 17) src-tauri/src/session_manager/transcript.rs:601 — TranscriptIndexStore::open_current has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D35 · Change Coupling · Change coupling · ×4
  • Change coupling: basic.rs ↔ REDACTED src-tauri/src/cli/tui/ui/overlay/basic.rs:1 — `src-tauri/src/cli/tui/ui/overlay/basic.rs` and `REDACTED` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `1902fca8` fix(tui): deduplicate action hints; `03094473` feat(codex): align unified session history; `241c387a` fix(tui): word-wrap dialog messages and size overlays to content — run `git show` on any of them.
  • Change coupling: pickers.rs ↔ REDACTED src-tauri/src/cli/tui/ui/overlay/pickers.rs:1 — `src-tauri/src/cli/tui/ui/overlay/pickers.rs` and `REDACTED` change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `addeb1b5` fix(codex-oauth): isolate shared workspace accounts (#509); `8a5614db` feat(tui): configure per-model Codex reasoning levels (#442); `3c9a916f` feat(tui): expose Skills sync method setting (#430) — run `git show` on any of them.
  • Change coupling: handlers.rs ↔ workers.rs src-tauri/src/cli/tui/runtime_systems/handlers.rs:1 — `src-tauri/src/cli/tui/runtime_systems/handlers.rs` and `src-tauri/src/cli/tui/runtime_systems/workers.rs` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `e6842167` fix(tui): refresh sessions on entry; `97b67bbd` perf(tui): move managed proxy refresh off UI thread; `03094473` feat(codex): align unified session history — run `git show` on any of them.
  • Change coupling: dialogs.rs ↔ basic.rs src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs:1 — `src-tauri/src/cli/tui/app/overlay_handlers/dialogs.rs` and `src-tauri/src/cli/tui/ui/overlay/basic.rs` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `03094473` feat(codex): align unified session history; `edbe0403` refactor: remove switch-path live-conflict surfacing; `8c208420` feat(tui): add Codex OAuth account manager (#243) — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src-tauri/src/cli/tui/runtime_actions/editor.rs:1023 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1023-1114 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1121-1182 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1198-1271 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1273-1311 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1317-1348 — 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) src-tauri/src/cli/tui/ui/config.rs:3061 — src-tauri/src/cli/tui/ui/config.rs:3061-3198 | src-tauri/src/cli/tui/ui/config.rs:3206-3299 | src-tauri/src/cli/tui/ui/config.rs:3307-3405 | src-tauri/src/cli/tui/ui/config.rs:4223-4296 | src-tauri/src/cli/tui/ui/skills/repos.rs:9-111 — 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) src-tauri/src/cli/tui/ui/overlay/pickers.rs:347 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:347-405 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:413-459 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:903-935 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2357-2392 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2643-2680 — 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) src-tauri/src/session_manager/providers/claude.rs:112 — src-tauri/src/session_manager/providers/claude.rs:112-179 | src-tauri/src/session_manager/providers/codex.rs:751-828 | src-tauri/src/session_manager/providers/hermes.rs:839-896 | src-tauri/src/session_manager/providers/openclaw.rs:401-459 | src-tauri/src/session_manager/providers/pi.rs:502-533 — 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 (9–10 lines × 2) · ×4
  • Duplicated block (9–10 lines × 2) src-tauri/src/cli/tui/ui/forms/provider.rs:981 — src-tauri/src/cli/tui/ui/forms/provider.rs:981-989 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:1019-1028 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/provider.rs` and `src-tauri/src/cli/tui/ui/overlay/pickers.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–10 lines × 2) src-tauri/src/cli/tui/ui/overlay/pickers.rs:1829 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:1829-1838 | src-tauri/src/cli/tui/ui/sessions.rs:773-781 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9–10 lines × 2) src-tauri/src/config.rs:585 — src-tauri/src/config.rs:585-593 | src-tauri/src/database/mod.rs:281-290 — before extracting anything, compare `src-tauri/src/config.rs` and `src-tauri/src/database/mod.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–10 lines × 2) src-tauri/src/services/skill.rs:1262 — src-tauri/src/services/skill.rs:1262-1271 | src-tauri/src/services/skill.rs:1426-1434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) src-tauri/src/cli/tui/runtime_actions/mod.rs:38 — src-tauri/src/cli/tui/runtime_actions/mod.rs:38-44 | src-tauri/src/cli/tui/runtime_actions/mod.rs:57-63 | src-tauri/src/cli/tui/runtime_actions/mod.rs:77-83 — 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) src-tauri/src/proxy/providers/copilot_auth.rs:759 — src-tauri/src/proxy/providers/copilot_auth.rs:759-765 | src-tauri/src/proxy/providers/copilot_auth.rs:906-912 | src-tauri/src/proxy/providers/copilot_auth.rs:1020-1026 — 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) src-tauri/src/services/usage_stats.rs:537 — src-tauri/src/services/usage_stats.rs:537-544 | src-tauri/src/services/usage_stats.rs:943-950 | src-tauri/src/services/usage_stats.rs:1205-1211 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) src-tauri/src/cli/commands/config.rs:208 — src-tauri/src/cli/commands/config.rs:208-214 | src-tauri/src/cli/commands/config.rs:274-281 | src-tauri/src/cli/commands/config.rs:499-505 — 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.
D1 · Cyclomatic Complexity · SkillService · ×3
  • SkillService::migrate_storage (cyclomatic 48) src-tauri/src/services/skill.rs:2025 — SkillService::migrate_storage has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SkillService::migrate_ssot_if_pending (cyclomatic 29) src-tauri/src/services/skill.rs:893 — SkillService::migrate_ssot_if_pending has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SkillService::update_skill (cyclomatic 18) src-tauri/src/services/skill.rs:2679 — SkillService::update_skill 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×3
  • Duplicated block (29 lines × 2) src-tauri/src/cli/tui/runtime_actions/editor.rs:180 — src-tauri/src/cli/tui/runtime_actions/editor.rs:180-208 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1362-1390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (29 lines × 2) src-tauri/src/cli/tui/ui/config.rs:1366 — src-tauri/src/cli/tui/ui/config.rs:1366-1394 | src-tauri/src/cli/tui/ui/config.rs:2260-2288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (29 lines × 2) src-tauri/src/proxy/providers/transform_codex_chat.rs:808 — src-tauri/src/proxy/providers/transform_codex_chat.rs:808-836 | src-tauri/src/proxy/providers/transform_codex_chat.rs:838-866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) src-tauri/src/cli/tui/ui/config.rs:3243 — src-tauri/src/cli/tui/ui/config.rs:3243-3266 | src-tauri/src/cli/tui/ui/config.rs:3316-3338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) src-tauri/src/services/proxy.rs:3567 — src-tauri/src/services/proxy.rs:3567-3589 | src-tauri/src/services/proxy.rs:3661-3683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) src-tauri/src/cli/tui/data.rs:3016 — src-tauri/src/cli/tui/data.rs:3016-3040 | src-tauri/src/cli/tui/data.rs:3064-3086 — both copies are in the same file, so extract the 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–19 lines × 2) · ×3
  • Duplicated block (18–19 lines × 2) src-tauri/src/cli/commands/skills.rs:668 — src-tauri/src/cli/commands/skills.rs:668-686 | src-tauri/src/cli/tui/runtime_skills.rs:85-102 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (18–19 lines × 2) src-tauri/src/cli/tui/ui/forms/s3.rs:125 — src-tauri/src/cli/tui/ui/forms/s3.rs:125-142 | src-tauri/src/cli/tui/ui/forms/webdav.rs:111-129 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/s3.rs` and `src-tauri/src/cli/tui/ui/forms/webdav.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–19 lines × 2) src-tauri/src/services/skill.rs:1126 — src-tauri/src/services/skill.rs:1126-1143 | src-tauri/src/services/skill.rs:2333-2351 — both copies are in the same file, so extract the 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 (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) src-tauri/src/cli/commands/provider.rs:1922 — src-tauri/src/cli/commands/provider.rs:1922-1934 | src-tauri/src/cli/tui/form/provider_state.rs:30-42 | src-tauri/src/services/provider/mod.rs:431-443 — 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 (13 lines × 3) src-tauri/src/proxy/handlers.rs:129 — src-tauri/src/proxy/handlers.rs:129-141 | src-tauri/src/proxy/handlers.rs:153-165 | src-tauri/src/proxy/handlers.rs:177-189 — 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 (13 lines × 3) src-tauri/src/proxy/handlers.rs:614 — src-tauri/src/proxy/handlers.rs:614-626 | src-tauri/src/proxy/handlers.rs:765-777 | src-tauri/src/proxy/handlers.rs:811-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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) src-tauri/src/cli/commands/config.rs:212 — src-tauri/src/cli/commands/config.rs:212-224 | src-tauri/src/cli/commands/config.rs:336-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 (12–13 lines × 2) src-tauri/src/cli/tui/ui/forms/prompt.rs:130 — src-tauri/src/cli/tui/ui/forms/prompt.rs:130-142 | src-tauri/src/cli/tui/ui/forms/webdav.rs:93-104 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/prompt.rs` and `src-tauri/src/cli/tui/ui/forms/webdav.rs` as WHOLE FILES: this scan already matched 4 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 (12–13 lines × 2) src-tauri/src/session_manager/providers/claude.rs:236 — src-tauri/src/session_manager/providers/claude.rs:236-248 | src-tauri/src/session_manager/providers/codex.rs:867-878 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) · ×3
  • Duplicated block (12 lines × 3) src-tauri/src/cli/tui/ui/forms/mcp.rs:332 — src-tauri/src/cli/tui/ui/forms/mcp.rs:332-343 | src-tauri/src/cli/tui/ui/forms/provider.rs:1640-1651 | src-tauri/src/cli/tui/ui/forms/s3.rs:107-118 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 154 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/proxy/error.rs:136 — src-tauri/src/proxy/error.rs:136-147 | src-tauri/src/proxy/handlers.rs:1003-1014 | src-tauri/src/proxy/response.rs:875-886 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (12 lines × 3) src-tauri/src/mcp.rs:609 — src-tauri/src/mcp.rs:609-621 | src-tauri/src/mcp.rs:942-953 | src-tauri/src/mcp.rs:1677-1688 — 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 (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) src-tauri/src/cli/tui/runtime_systems/types.rs:935 — src-tauri/src/cli/tui/runtime_systems/types.rs:935-944 | src-tauri/src/services/provider/models.rs:62-73 — before extracting anything, compare `src-tauri/src/cli/tui/runtime_systems/types.rs` and `src-tauri/src/services/provider/models.rs` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10–12 lines × 2) src-tauri/src/cli/tui/ui/config.rs:1422 — src-tauri/src/cli/tui/ui/config.rs:1422-1431 | src-tauri/src/cli/tui/ui/config.rs:2317-2328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–12 lines × 2) src-tauri/src/session_manager/providers/claude.rs:296 — src-tauri/src/session_manager/providers/claude.rs:296-307 | src-tauri/src/session_manager/providers/codex.rs:933-942 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/cli/commands/provider.rs:1830 — src-tauri/src/cli/commands/provider.rs:1830-1840 | src-tauri/src/cli/commands/provider.rs:2074-2083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1368 — src-tauri/src/proxy/providers/codex_oauth_auth.rs:1368-1377 | src-tauri/src/proxy/providers/copilot_auth.rs:1191-1201 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/proxy/providers/streaming_responses.rs:424 — src-tauri/src/proxy/providers/streaming_responses.rs:424-434 | src-tauri/src/proxy/providers/streaming_responses.rs:484-493 — both copies are in the same file, so extract the 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–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) src-tauri/src/cli/commands/provider_input.rs:3800 — src-tauri/src/cli/commands/provider_input.rs:3800-3808 | src-tauri/src/cli/commands/provider_input.rs:4465-4472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) src-tauri/src/cli/tui/app/helpers.rs:1619 — src-tauri/src/cli/tui/app/helpers.rs:1619-1626 | src-tauri/src/cli/tui/app/helpers.rs:1656-1664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) src-tauri/src/proxy/response.rs:519 — src-tauri/src/proxy/response.rs:519-526 | src-tauri/src/proxy/response.rs:595-603 — both copies are in the same file, so extract the 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 lines × 3) · ×3
  • Duplicated block (8 lines × 3) src-tauri/src/cli/tui/app/content_entities.rs:45 — src-tauri/src/cli/tui/app/content_entities.rs:45-52 | src-tauri/src/cli/tui/app/content_entities.rs:702-709 | src-tauri/src/cli/tui/app/content_entities.rs:1135-1142 — 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) src-tauri/src/mcp.rs:362 — src-tauri/src/mcp.rs:362-369 | src-tauri/src/mcp.rs:753-760 | src-tauri/src/mcp.rs:916-923 — 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) src-tauri/src/cli/commands/provider_input.rs:3636 — src-tauri/src/cli/commands/provider_input.rs:3636-3643 | src-tauri/src/cli/tui/form/provider_json.rs:1522-1529 | src-tauri/src/cli/tui/form/provider_json.rs:1531-1538 — before extracting anything, compare `src-tauri/src/cli/commands/provider_input.rs` and `src-tauri/src/cli/tui/form/provider_json.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • Duplicated block (7 lines × 4) src-tauri/src/cli/tui/ui/forms/provider.rs:904 — src-tauri/src/cli/tui/ui/forms/provider.rs:904-911 | src-tauri/src/cli/tui/ui/forms/provider.rs:985-991 | src-tauri/src/cli/tui/ui/forms/provider.rs:1140-1147 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:1023-1030 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/provider.rs` and `src-tauri/src/cli/tui/ui/overlay/pickers.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 4) src-tauri/src/cli/tui/ui/overlay/basic.rs:264 — src-tauri/src/cli/tui/ui/overlay/basic.rs:264-271 | src-tauri/src/cli/tui/ui/overlay/basic.rs:328-335 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2573-2580 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2620-2626 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 4) src-tauri/src/mcp.rs:361 — src-tauri/src/mcp.rs:361-367 | src-tauri/src/mcp.rs:752-758 | src-tauri/src/mcp.rs:915-921 | src-tauri/src/mcp.rs:1633-1639 — 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.
D1 · Cyclomatic Complexity · CodexConfigPatch · ×2
  • CodexConfigPatch::write_route (cyclomatic 24) src-tauri/src/live/project/codex.rs:706 — CodexConfigPatch::write_route 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.
  • CodexConfigPatch::apply_to (cyclomatic 19) src-tauri/src/live/project/codex.rs:605 — CodexConfigPatch::apply_to 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 · TranscriptIndexStore · ×2
  • TranscriptIndexStore::enforce_cache_budget_with_limits (cyclomatic 20) src-tauri/src/session_manager/transcript.rs:1059 — TranscriptIndexStore::enforce_cache_budget_with_limits 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.
  • TranscriptIndexStore::open_current (cyclomatic 16) src-tauri/src/session_manager/transcript.rs:601 — TranscriptIndexStore::open_current 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 · Supervisor · ×2
  • Supervisor::ensure_worker_locked (cyclomatic 16) src-tauri/src/daemon/supervisor.rs:164 — Supervisor::ensure_worker_locked has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Supervisor::watch_worker (cyclomatic 16) src-tauri/src/daemon/supervisor.rs:927 — Supervisor::watch_worker 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 · CodexConfigPatch · ×2
  • CodexConfigPatch::apply_to (cognitive 27) src-tauri/src/live/project/codex.rs:605 — CodexConfigPatch::apply_to has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (9 pts), boolean chains 4 (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.
  • CodexConfigPatch::write_route (cognitive 27) src-tauri/src/live/project/codex.rs:706 — CodexConfigPatch::write_route has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 2, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatToResponsesState · ×2
  • ChatToResponsesState::finalize_tools (cognitive 27) src-tauri/src/proxy/providers/streaming_codex_chat.rs:706 — ChatToResponsesState::finalize_tools has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ChatToResponsesState::handle_chat_chunk (cognitive 21) src-tauri/src/proxy/providers/streaming_codex_chat.rs:114 — ChatToResponsesState::handle_chat_chunk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiAppConfig · ×2
  • MultiAppConfig::load (cognitive 21) src-tauri/src/app_config.rs:494 — MultiAppConfig::load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 6). 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.
  • MultiAppConfig::migrate_mcp_to_unified (cognitive 17) src-tauri/src/app_config.rs:683 — MultiAppConfig::migrate_mcp_to_unified has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Supervisor · ×2
  • Supervisor::watch_worker (cognitive 21) src-tauri/src/daemon/supervisor.rs:927 — Supervisor::watch_worker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 4, boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Supervisor::ensure_worker_locked (cognitive 16) src-tauri/src/daemon/supervisor.rs:164 — Supervisor::ensure_worker_locked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 5, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PagedManifestBuilder · ×2
  • PagedManifestBuilder::publish (cognitive 18) src-tauri/src/session_manager/paged_manifest.rs:1618 — PagedManifestBuilder::publish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 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.
  • PagedManifestBuilder::build_deduplicated_recency_runs (cognitive 17) src-tauri/src/session_manager/paged_manifest.rs:1881 — PagedManifestBuilder::build_deduplicated_recency_runs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PagedManifestStore · ×2
  • PagedManifestStore::validate_generation_pages_in (cognitive 16) src-tauri/src/session_manager/paged_manifest.rs:784 — PagedManifestStore::validate_generation_pages_in has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
  • PagedManifestStore::read_or_recover_coordinator_locked (cognitive 16) src-tauri/src/session_manager/paged_manifest.rs:908 — PagedManifestStore::read_or_recover_coordinator_locked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFunctions · ×2
  • TooManyFunctions: cc_switch::cli::tui::runtime_actions::config src-tauri/src/cli/tui/runtime_actions/config.rs:24 — TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: cc_switch::pi_config src-tauri/src/pi_config/mod.rs:34 — TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: REDACTED → basic.rs, pickers.rs, render.rs src-tauri/src/cli/tui/app/tests.rs — `src-tauri/src/cli/tui/app/tests.rs` changes together with 3 other files — `src-tauri/src/cli/tui/ui/overlay/basic.rs`, `src-tauri/src/cli/tui/ui/overlay/pickers.rs`, `src-tauri/src/cli/tui/ui/overlay/render.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: i18n.rs → types.rs, form.rs, provider.rs, main_page.rs, basic.rs, pickers.rs, render.rs src-tauri/src/cli/i18n.rs — `src-tauri/src/cli/i18n.rs` changes together with 7 other files — `src-tauri/src/cli/tui/app/types.rs`, `src-tauri/src/cli/tui/form.rs`, `src-tauri/src/cli/tui/ui/forms/provider.rs`, `src-tauri/src/cli/tui/ui/main_page.rs`, `src-tauri/src/cli/tui/ui/overlay/basic.rs`, `src-tauri/src/cli/tui/ui/overlay/pickers.rs`, `src-tauri/src/cli/tui/ui/overlay/render.rs` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) src-tauri/src/services/usage_stats.rs:1060 — src-tauri/src/services/usage_stats.rs:1060-1085 | src-tauri/src/services/usage_stats.rs:1186-1211 — both copies are in the same file, so extract the block into 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) src-tauri/src/services/usage_stats.rs:788 — src-tauri/src/services/usage_stats.rs:788-813 | src-tauri/src/services/usage_stats.rs:878-903 — both copies are in the same file, so extract the 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) · ×2
  • Duplicated block (20–23 lines × 2) src-tauri/src/cli/tui/ui/config.rs:2382 — src-tauri/src/cli/tui/ui/config.rs:2382-2401 | src-tauri/src/cli/tui/ui/config.rs:2647-2669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20–23 lines × 2) src-tauri/src/cli/tui/ui/usage.rs:1020 — src-tauri/src/cli/tui/ui/usage.rs:1020-1039 | src-tauri/src/cli/tui/ui/usage.rs:1070-1092 — both copies are in the same file, so extract the 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) src-tauri/src/cli/commands/auth.rs:467 — src-tauri/src/cli/commands/auth.rs:467-488 | src-tauri/src/cli/commands/provider_inspect.rs:569-589 — before extracting anything, compare `src-tauri/src/cli/commands/auth.rs` and `src-tauri/src/cli/commands/provider_inspect.rs` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (21–22 lines × 2) src-tauri/src/session_manager/providers/gemini.rs:283 — src-tauri/src/session_manager/providers/gemini.rs:283-304 | src-tauri/src/session_manager/providers/gemini.rs:351-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) src-tauri/src/cli/tui/mod.rs:1701 — src-tauri/src/cli/tui/mod.rs:1701-1721 | src-tauri/src/cli/tui/mod.rs:1778-1798 — both copies are in the same file, so extract the block into 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) src-tauri/src/session_manager/providers/claude.rs:342 — src-tauri/src/session_manager/providers/claude.rs:342-362 | src-tauri/src/session_manager/providers/codex.rs:966-986 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) · ×2
  • Duplicated block (20 lines × 2) src-tauri/src/cli/tui/ui/forms/provider.rs:1216 — src-tauri/src/cli/tui/ui/forms/provider.rs:1216-1235 | src-tauri/src/cli/tui/ui/forms/provider.rs:1336-1355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) src-tauri/src/services/coding_plan.rs:116 — src-tauri/src/services/coding_plan.rs:116-135 | src-tauri/src/services/coding_plan.rs:372-391 — both copies are in the same file, so extract the 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 lines × 3) · ×2
  • Duplicated block (17 lines × 3) src-tauri/src/cli/commands/provider.rs:122 — src-tauri/src/cli/commands/provider.rs:122-138 | src-tauri/src/proxy/providers/codex.rs:38-54 | src-tauri/src/proxy/providers/codex.rs:90-106 — 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 (17 lines × 3) src-tauri/src/services/coding_plan.rs:106 — src-tauri/src/services/coding_plan.rs:106-122 | src-tauri/src/services/coding_plan.rs:277-293 | src-tauri/src/services/coding_plan.rs:362-378 — 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 (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) src-tauri/src/daemon/migration.rs:473 — src-tauri/src/daemon/migration.rs:473-489 | src-tauri/src/daemon/migration.rs:538-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16–17 lines × 2) src-tauri/src/proxy/providers/streaming.rs:237 — src-tauri/src/proxy/providers/streaming.rs:237-252 | src-tauri/src/proxy/providers/streaming.rs:288-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) src-tauri/src/cli/commands/auth.rs:412 — src-tauri/src/cli/commands/auth.rs:412-426 | src-tauri/src/cli/commands/provider_inspect.rs:514-527 — before extracting anything, compare `src-tauri/src/cli/commands/auth.rs` and `src-tauri/src/cli/commands/provider_inspect.rs` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (14–15 lines × 2) src-tauri/src/cli/tui/app/types.rs:4944 — src-tauri/src/cli/tui/app/types.rs:4944-4958 | src-tauri/src/cli/tui/app/types.rs:4994-5007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) src-tauri/src/cli/commands/provider_input.rs:2862 — src-tauri/src/cli/commands/provider_input.rs:2862-2875 | src-tauri/src/cli/commands/provider_input.rs:3226-3239 | src-tauri/src/cli/commands/provider_input.rs:3433-3446 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) src-tauri/src/services/provider/mod.rs:1376 — src-tauri/src/services/provider/mod.rs:1376-1389 | src-tauri/src/services/provider/mod.rs:1417-1430 | src-tauri/src/services/provider/mod.rs:1578-1591 — 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 (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) src-tauri/src/deeplink/provider.rs:405 — src-tauri/src/deeplink/provider.rs:405-417 | src-tauri/src/deeplink/provider.rs:729-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–14 lines × 2) src-tauri/src/proxy/forwarder.rs:368 — src-tauri/src/proxy/forwarder.rs:368-380 | src-tauri/src/proxy/forwarder.rs:613-626 — both copies are in the same file, so extract the 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–13 lines × 2) · ×2
  • Duplicated block (9–13 lines × 2) src-tauri/src/cli/tui/runtime_actions/editor.rs:1066 — src-tauri/src/cli/tui/runtime_actions/editor.rs:1066-1078 | src-tauri/src/cli/tui/runtime_actions/editor.rs:1145-1153 — both copies are in the same file, so extract the block into 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–13 lines × 2) src-tauri/src/cli/tui/ui/forms/mcp.rs:32 — src-tauri/src/cli/tui/ui/forms/mcp.rs:32-44 | src-tauri/src/cli/tui/ui/forms/prompt.rs:22-30 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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) · ×2
  • Duplicated block (11–12 lines × 3) src-tauri/src/cli/commands/config.rs:208 — src-tauri/src/cli/commands/config.rs:208-219 | src-tauri/src/cli/commands/config.rs:275-285 | src-tauri/src/cli/commands/config.rs:332-342 — 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–12 lines × 3) src-tauri/src/cli/tui/ui/forms/provider.rs:872 — src-tauri/src/cli/tui/ui/forms/provider.rs:872-883 | src-tauri/src/cli/tui/ui/forms/s3.rs:16-26 | src-tauri/src/cli/tui/ui/forms/webdav.rs:16-26 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/provider.rs` and `src-tauri/src/cli/tui/ui/forms/s3.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src-tauri/src/proxy/providers/streaming.rs:236 — src-tauri/src/proxy/providers/streaming.rs:236-246 | src-tauri/src/proxy/providers/streaming.rs:287-297 | src-tauri/src/proxy/providers/streaming.rs:338-348 | src-tauri/src/proxy/providers/streaming.rs:476-486 — 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 (11 lines × 4) src-tauri/src/session_manager/providers/gemini.rs:60 — src-tauri/src/session_manager/providers/gemini.rs:60-70 | src-tauri/src/session_manager/providers/openclaw.rs:88-98 | src-tauri/src/session_manager/providers/pi.rs:336-346 | src-tauri/src/session_manager/providers/pi.rs:367-377 — before extracting anything, compare `src-tauri/src/session_manager/providers/gemini.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 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 (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) src-tauri/src/mcp.rs:747 — src-tauri/src/mcp.rs:747-757 | src-tauri/src/mcp.rs:911-920 | src-tauri/src/mcp.rs:1629-1638 — 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 (10–11 lines × 3) src-tauri/src/services/proxy.rs:743 — src-tauri/src/services/proxy.rs:743-753 | src-tauri/src/services/proxy.rs:799-808 | src-tauri/src/services/proxy.rs:2828-2838 — 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 (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) src-tauri/src/cli/tui/ui/forms/mcp.rs:283 — src-tauri/src/cli/tui/ui/forms/mcp.rs:283-292 | src-tauri/src/cli/tui/ui/forms/prompt.rs:73-82 | src-tauri/src/cli/tui/ui/forms/provider.rs:545-554 | src-tauri/src/cli/tui/ui/forms/provider.rs:1591-1600 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) src-tauri/src/session_manager/providers/claude.rs:60 — src-tauri/src/session_manager/providers/claude.rs:60-69 | src-tauri/src/session_manager/providers/codex.rs:686-695 | src-tauri/src/session_manager/providers/hermes.rs:760-769 | src-tauri/src/session_manager/providers/openclaw.rs:357-366 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) src-tauri/src/codex_history_migration.rs:548 — src-tauri/src/codex_history_migration.rs:548-555 | src-tauri/src/codex_history_migration.rs:1455-1464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–10 lines × 2) src-tauri/src/codex_history_migration.rs:1005 — src-tauri/src/codex_history_migration.rs:1005-1012 | src-tauri/src/codex_history_migration.rs:1081-1090 — both copies are in the same file, so extract the 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 × 5) · ×2
  • Duplicated block (9 lines × 5) src-tauri/src/cli/tui/ui/forms/mcp.rs:69 — src-tauri/src/cli/tui/ui/forms/mcp.rs:69-77 | src-tauri/src/cli/tui/ui/forms/prompt.rs:87-95 | src-tauri/src/cli/tui/ui/forms/provider.rs:898-906 | src-tauri/src/cli/tui/ui/forms/provider.rs:1134-1142 | src-tauri/src/cli/tui/ui/forms/provider.rs:1531-1539 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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 × 5) src-tauri/src/services/provider/mod.rs:1400 — src-tauri/src/services/provider/mod.rs:1400-1408 | src-tauri/src/services/provider/mod.rs:1603-1611 | src-tauri/src/services/provider/mod.rs:1623-1631 | src-tauri/src/services/provider/mod.rs:1643-1651 | src-tauri/src/services/provider/mod.rs:1663-1671 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 5) · ×2
  • Duplicated block (7–8 lines × 5) src-tauri/src/cli/tui/ui/forms/mcp.rs:307 — src-tauri/src/cli/tui/ui/forms/mcp.rs:307-314 | src-tauri/src/cli/tui/ui/forms/prompt.rs:110-116 | src-tauri/src/cli/tui/ui/forms/provider.rs:1615-1621 | src-tauri/src/cli/tui/ui/forms/s3.rs:83-89 | src-tauri/src/cli/tui/ui/forms/webdav.rs:74-80 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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–8 lines × 5) src-tauri/src/cli/tui/ui/forms/mcp.rs:351 — src-tauri/src/cli/tui/ui/forms/mcp.rs:351-357 | src-tauri/src/cli/tui/ui/forms/prompt.rs:145-152 | src-tauri/src/cli/tui/ui/forms/provider.rs:650-656 | src-tauri/src/cli/tui/ui/forms/provider.rs:932-939 | src-tauri/src/cli/tui/ui/forms/provider.rs:1659-1665 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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 × 5) · ×2
  • Duplicated block (8 lines × 5) src-tauri/src/cli/tui/ui/forms/mcp.rs:332 — src-tauri/src/cli/tui/ui/forms/mcp.rs:332-339 | src-tauri/src/cli/tui/ui/forms/prompt.rs:130-137 | src-tauri/src/cli/tui/ui/forms/provider.rs:1640-1647 | src-tauri/src/cli/tui/ui/forms/s3.rs:107-114 | src-tauri/src/cli/tui/ui/forms/webdav.rs:93-100 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) src-tauri/src/cli/tui/ui/overlay/pickers.rs:398 — src-tauri/src/cli/tui/ui/overlay/pickers.rs:398-405 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:452-459 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:928-935 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2385-2392 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2673-2680 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) src-tauri/src/cli/commands/provider.rs:1711 — src-tauri/src/cli/commands/provider.rs:1711-1718 | src-tauri/src/cli/commands/provider.rs:1990-1996 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7–8 lines × 2) src-tauri/src/codex_config.rs:190 — src-tauri/src/codex_config.rs:190-196 | src-tauri/src/codex_config.rs:307-314 — both copies are in the same file, so extract the 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 (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) src-tauri/src/cli/tui/runtime_actions/settings.rs:93 — src-tauri/src/cli/tui/runtime_actions/settings.rs:93-98 | src-tauri/src/cli/tui/runtime_actions/settings.rs:645-651 — both copies are in the same file, so extract the block into 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–7 lines × 2) src-tauri/src/session_manager/providers/gemini.rs:188 — src-tauri/src/session_manager/providers/gemini.rs:188-194 | REDACTED:1678-1683 — before extracting anything, compare `src-tauri/src/session_manager/providers/gemini.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 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.
D1 · Cyclomatic Complexity · benchmark_cc_switch.benchmark_cli (cyclomatic 36) · ×1
  • benchmark_cc_switch.benchmark_cli (cyclomatic 36) scripts/benchmark_cc_switch.py:1458 — benchmark_cc_switch.benchmark_cli has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TuiScreen._handle_csi (cyclomatic 31) · ×1
  • TuiScreen._handle_csi (cyclomatic 31) scripts/benchmark_cc_switch.py:1075 — TuiScreen._handle_csi has cyclomatic complexity 31 (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 · TokenUsage · ×1
  • TokenUsage::from_claude_stream_events (cyclomatic 26) src-tauri/src/proxy/usage/parser.rs:323 — TokenUsage::from_claude_stream_events has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · benchmark_cc_switch.benchmark_tui (cyclomatic 25) · ×1
  • benchmark_cc_switch.benchmark_tui (cyclomatic 25) scripts/benchmark_cc_switch.py:1751 — benchmark_cc_switch.benchmark_tui has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveSnapshot · ×1
  • LiveSnapshot::restore (cyclomatic 23) src-tauri/src/services/provider/live.rs:40 — LiveSnapshot::restore 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 · check_benchmark_thresholds.check_thresholds (cyclomatic 22) · ×1
  • check_benchmark_thresholds.check_thresholds (cyclomatic 22) scripts/check_benchmark_thresholds.py:97 — check_benchmark_thresholds.check_thresholds has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProviderType · ×1
  • ProviderType::from_app_type_and_config (cyclomatic 20) src-tauri/src/proxy/providers/mod.rs:88 — ProviderType::from_app_type_and_config 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 · benchmark_cc_switch.main (cyclomatic 20) · ×1
  • benchmark_cc_switch.main (cyclomatic 20) scripts/benchmark_cc_switch.py:2153 — benchmark_cc_switch.main has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EditorState · ×1
  • EditorState::push_visible_line_segments (cyclomatic 19) src-tauri/src/cli/tui/app/editor_state.rs:393 — EditorState::push_visible_line_segments 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 · CodexOAuthManager · ×1
  • CodexOAuthManager::add_account_internal (cyclomatic 19) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1157 — CodexOAuthManager::add_account_internal 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 · DotenvPatch · ×1
  • DotenvPatch::apply (cyclomatic 18) src-tauri/src/live/patch/dotenv.rs:29 — DotenvPatch::apply 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 · CodexChatHistoryStore · ×1
  • CodexChatHistoryStore::enrich_request (cyclomatic 18) src-tauri/src/proxy/providers/codex_chat_history.rs:89 — CodexChatHistoryStore::enrich_request has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamingOutcomeRecorder · ×1
  • StreamingOutcomeRecorder::finish (cyclomatic 18) src-tauri/src/proxy/response_handler.rs:209 — StreamingOutcomeRecorder::finish 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 · MultiAppConfig · ×1
  • MultiAppConfig::load (cyclomatic 16) src-tauri/src/app_config.rs:494 — MultiAppConfig::load 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 · TranscriptRemotePager · ×1
  • TranscriptRemotePager::refresh_source_if_pending (cyclomatic 16) src-tauri/src/cli/tui/app/types.rs:1535 — TranscriptRemotePager::refresh_source_if_pending 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 · JsonPatch · ×1
  • JsonPatch::apply_to (cyclomatic 16) src-tauri/src/live/patch/json.rs:41 — JsonPatch::apply_to 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 · TomlPatch · ×1
  • TomlPatch::apply_to (cyclomatic 16) src-tauri/src/live/patch/toml.rs:33 — TomlPatch::apply_to 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 · TokenUsage · ×1
  • TokenUsage::from_claude_stream_events (cognitive 102) src-tauri/src/proxy/usage/parser.rs:323 — TokenUsage::from_claude_stream_events has cognitive complexity 102 (threshold 15). Drivers by points: if/else 20 (95 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (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.
D2 · Cognitive Complexity · benchmark_cc_switch.benchmark_cli (cognitive 88) · ×1
  • benchmark_cc_switch.benchmark_cli (cognitive 88) scripts/benchmark_cc_switch.py:1458 — benchmark_cc_switch.benchmark_cli has cognitive complexity 88 (threshold 15). Drivers by points: if/else 17 (55 pts), ternaries 4 (14 pts), boolean chains 13, loops 3 (6 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · benchmark_cc_switch.benchmark_tui (cognitive 80) · ×1
  • benchmark_cc_switch.benchmark_tui (cognitive 80) scripts/benchmark_cc_switch.py:1751 — benchmark_cc_switch.benchmark_tui has cognitive complexity 80 (threshold 15). Drivers by points: if/else 16 (58 pts), error handling 4 (14 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderType · ×1
  • ProviderType::from_app_type_and_config (cognitive 42) src-tauri/src/proxy/providers/mod.rs:88 — ProviderType::from_app_type_and_config has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (37 pts), match/switch 2 (4 pts), boolean chains 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 · CodexChatHistoryStore · ×1
  • CodexChatHistoryStore::enrich_request (cognitive 40) src-tauri/src/proxy/providers/codex_chat_history.rs:89 — CodexChatHistoryStore::enrich_request has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 2 (5 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorState · ×1
  • EditorState::push_visible_line_segments (cognitive 34) src-tauri/src/cli/tui/app/editor_state.rs:393 — EditorState::push_visible_line_segments has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · benchmark_cc_switch.run_pty_command (cognitive 33) · ×1
  • benchmark_cc_switch.run_pty_command (cognitive 33) scripts/benchmark_cc_switch.py:921 — benchmark_cc_switch.run_pty_command has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 4 (10 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_benchmark_thresholds.check_thresholds (cognitive 33) · ×1
  • check_benchmark_thresholds.check_thresholds (cognitive 33) scripts/check_benchmark_thresholds.py:97 — check_benchmark_thresholds.check_thresholds has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamingOutcomeRecorder · ×1
  • StreamingOutcomeRecorder::finish (cognitive 28) src-tauri/src/proxy/response_handler.rs:209 — StreamingOutcomeRecorder::finish has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveSnapshot · ×1
  • LiveSnapshot::restore (cognitive 27) src-tauri/src/services/provider/live.rs:40 — LiveSnapshot::restore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 2 (3 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TranscriptRemotePager · ×1
  • TranscriptRemotePager::refresh_source_if_pending (cognitive 26) src-tauri/src/cli/tui/app/types.rs:1535 — TranscriptRemotePager::refresh_source_if_pending has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DotenvPatch · ×1
  • DotenvPatch::apply (cognitive 25) src-tauri/src/live/patch/dotenv.rs:29 — DotenvPatch::apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonPatch · ×1
  • JsonPatch::apply_to (cognitive 24) src-tauri/src/live/patch/json.rs:41 — JsonPatch::apply_to has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TomlPatch · ×1
  • TomlPatch::apply_to (cognitive 24) src-tauri/src/live/patch/toml.rs:33 — TomlPatch::apply_to has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexOAuthManager · ×1
  • CodexOAuthManager::add_account_internal (cognitive 24) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1157 — CodexOAuthManager::add_account_internal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 3 (5 pts), boolean chains 4 (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 · AnthropicToResponsesState · ×1
  • AnthropicToResponsesState::close_block (cognitive 23) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:337 — AnthropicToResponsesState::close_block has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · benchmark_cc_switch.main (cognitive 23) · ×1
  • benchmark_cc_switch.main (cognitive 23) scripts/benchmark_cc_switch.py:2153 — benchmark_cc_switch.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OpenClawRenderModelPreview · ×1
  • OpenClawRenderModelPreview::from_data (cognitive 22) src-tauri/src/cli/tui/ui/config.rs:1733 — OpenClawRenderModelPreview::from_data has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PagedListState · ×1
  • PagedListState::wheel (cognitive 21) src-tauri/src/cli/tui/app/paged_list.rs:316 — PagedListState::wheel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScanCacheStore · ×1
  • ScanCacheStore::delete_missing_for_provider_bounded (cognitive 21) src-tauri/src/session_manager/scan_cache_store.rs:374 — ScanCacheStore::delete_missing_for_provider_bounded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PromptService · ×1
  • PromptService::enable_prompt (cognitive 20) src-tauri/src/services/prompt.rs:260 — PromptService::enable_prompt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StreamLogCollector · ×1
  • StreamLogCollector::record_chunk (cognitive 19) src-tauri/src/proxy/usage/parser.rs:155 — StreamLogCollector::record_chunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelMapping · ×1
  • ModelMapping::map_model (cognitive 18) src-tauri/src/proxy/model_mapper.rs:51 — ModelMapping::map_model has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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 · TuiScreen._consume_escape (cognitive 18) · ×1
  • TuiScreen._consume_escape (cognitive 18) scripts/benchmark_cc_switch.py:1031 — TuiScreen._consume_escape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TuiScreen._handle_csi (cognitive 17) · ×1
  • TuiScreen._handle_csi (cognitive 17) scripts/benchmark_cc_switch.py:1075 — TuiScreen._handle_csi has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UsageLogPager · ×1
  • UsageLogPager::finish_request (cognitive 16) src-tauri/src/cli/tui/app/types.rs:495 — UsageLogPager::finish_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClaudeProjection · ×1
  • ClaudeProjection::of (cognitive 16) src-tauri/src/live/project/claude.rs:34 — ClaudeProjection::of has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderRouter · ×1
  • ProviderRouter::select_providers (cognitive 16) src-tauri/src/proxy/provider_router.rs:27 — ProviderRouter::select_providers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CopilotAuthManager · ×1
  • CopilotAuthManager::load_from_disk_sync (cognitive 16) src-tauri/src/proxy/providers/copilot_auth.rs:1389 — CopilotAuthManager::load_from_disk_sync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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 · ConfigService · ×1
  • ConfigService::sync_codex_live (cognitive 16) src-tauri/src/services/config.rs:324 — ConfigService::sync_codex_live has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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 · Snapshot.restore (cognitive 16) · ×1
  • Snapshot.restore (cognitive 16) scripts/benchmark_cc_switch.py:295 — Snapshot.restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · 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, 24 shared lines) · ×1
  • Near-duplicate member family (5 members, 24 shared lines) src-tauri/src/cli/tui/ui/forms/mcp.rs:282 — src-tauri/src/cli/tui/ui/forms/mcp.rs:282-370 | src-tauri/src/cli/tui/ui/forms/prompt.rs:72-165 | src-tauri/src/cli/tui/ui/forms/provider.rs:1590-1678 | src-tauri/src/cli/tui/ui/forms/s3.rs:58-142 | src-tauri/src/cli/tui/ui/forms/webdav.rs:51-129 — These 5 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 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, 40 shared lines) · ×1
  • Near-duplicate member family (4 members, 40 shared lines) src-tauri/src/cli/tui/ui/forms/mcp.rs:282 — src-tauri/src/cli/tui/ui/forms/mcp.rs:282-370 | src-tauri/src/cli/tui/ui/forms/prompt.rs:72-165 | src-tauri/src/cli/tui/ui/forms/provider.rs:544-669 | src-tauri/src/cli/tui/ui/forms/provider.rs:1590-1678 — These 4 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (140 shared lines) · ×1
  • Near-duplicate member pair (140 shared lines) src-tauri/src/proxy/forwarder.rs:253 — src-tauri/src/proxy/forwarder.rs:253-455 | src-tauri/src/proxy/forwarder.rs:498-700 — These two members are variants of one another: 140 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 (77 shared lines) · ×1
  • Near-duplicate member pair (77 shared lines) src-tauri/src/session_manager/providers/claude.rs:235 — src-tauri/src/session_manager/providers/claude.rs:235-367 | src-tauri/src/session_manager/providers/codex.rs:866-991 — These two members are variants of one another: 77 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) src-tauri/src/cli/commands/provider.rs:1706 — src-tauri/src/cli/commands/provider.rs:1706-1868 | src-tauri/src/cli/commands/provider.rs:1986-2106 — 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 (63 shared lines) · ×1
  • Near-duplicate member pair (63 shared lines) src-tauri/src/cli/commands/auth.rs:378 — src-tauri/src/cli/commands/auth.rs:378-490 | src-tauri/src/cli/commands/provider_inspect.rs:435-646 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) src-tauri/src/cli/tui/ui/config.rs:4109 — src-tauri/src/cli/tui/ui/config.rs:4109-4215 | src-tauri/src/cli/tui/ui/config.rs:4223-4296 — These two members are variants of one another: 33 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 (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) src-tauri/src/session_manager/providers/hermes.rs:415 — src-tauri/src/session_manager/providers/hermes.rs:415-492 | REDACTED:594-714 — These two members are variants of one another: 28 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 (20 shared lines) · ×1
  • Near-duplicate member pair (20 shared lines) src-tauri/src/services/skill.rs:1669 — src-tauri/src/services/skill.rs:1669-1751 | src-tauri/src/services/skill.rs:1769-1808 — These two members are variants of one another: 20 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 (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) src-tauri/src/cli/tui/ui/shared.rs:971 — src-tauri/src/cli/tui/ui/shared.rs:971-994 | src-tauri/src/cli/tui/ui/shared.rs:1039-1058 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) src-tauri/src/cli/tui/ui/config.rs:942 — src-tauri/src/cli/tui/ui/config.rs:942-1076 | src-tauri/src/cli/tui/ui/config.rs:1409-1660 | src-tauri/src/cli/tui/ui/config.rs:2303-2680 | src-tauri/src/cli/tui/ui/forms/mcp.rs:11-126 | src-tauri/src/cli/tui/ui/forms/prompt.rs:9-63 | src-tauri/src/cli/tui/ui/forms/provider.rs:372-534 | src-tauri/src/cli/tui/ui/forms/provider.rs:1063-1184 | src-tauri/src/cli/tui/ui/forms/provider.rs:1291-1420 | src-tauri/src/cli/tui/ui/forms/provider.rs:1484-1580 — 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 (73–75 lines × 2) · ×1
  • Duplicated block (73–75 lines × 2) src-tauri/src/cli/tui/form/provider_state.rs:2709 — src-tauri/src/cli/tui/form/provider_state.rs:2709-2783 | src-tauri/src/cli/tui/form/provider_state.rs:2827-2899 — both copies are in the same file, so extract the 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 (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) src-tauri/src/cli/tui/app/form_handlers/provider.rs:1013 — src-tauri/src/cli/tui/app/form_handlers/provider.rs:1013-1077 | src-tauri/src/cli/tui/app/form_handlers/provider.rs:1157-1221 — both copies are in the same file, so extract the 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 (41–48 lines × 2) · ×1
  • Duplicated block (41–48 lines × 2) src-tauri/src/cli/commands/provider.rs:1755 — src-tauri/src/cli/commands/provider.rs:1755-1802 | src-tauri/src/cli/commands/provider.rs:2017-2057 — both copies are in the same file, so extract the 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 (45–46 lines × 2) · ×1
  • Duplicated block (45–46 lines × 2) src-tauri/src/cli/tui/ui/config.rs:1433 — src-tauri/src/cli/tui/ui/config.rs:1433-1477 | src-tauri/src/cli/tui/ui/config.rs:2331-2376 — both copies are in the same file, so extract the 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 (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) src-tauri/src/cli/tui/runtime_systems/workers.rs:3773 — src-tauri/src/cli/tui/runtime_systems/workers.rs:3773-3817 | src-tauri/src/cli/tui/runtime_systems/workers.rs:3820-3864 — both copies are in the same file, so extract the 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 (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) src-tauri/src/proxy/forwarder.rs:412 — src-tauri/src/proxy/forwarder.rs:412-455 | src-tauri/src/proxy/forwarder.rs:657-700 — both copies are in the same file, so extract the 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 (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1421 — src-tauri/src/proxy/providers/codex_oauth_auth.rs:1421-1461 | src-tauri/src/proxy/providers/copilot_auth.rs:1259-1299 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) src-tauri/src/cli/tui/form/provider_state.rs:750 — src-tauri/src/cli/tui/form/provider_state.rs:750-789 | src-tauri/src/cli/tui/form/provider_state.rs:822-861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) src-tauri/src/proxy/forwarder.rs:254 — src-tauri/src/proxy/forwarder.rs:254-292 | src-tauri/src/proxy/forwarder.rs:499-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–33 lines × 3) · ×1
  • Duplicated block (26–33 lines × 3) src-tauri/src/cli/tui/ui/pricing.rs:12 — src-tauri/src/cli/tui/ui/pricing.rs:12-44 | src-tauri/src/cli/tui/ui/usage.rs:55-87 | src-tauri/src/cli/tui/ui/usage.rs:107-132 — before extracting anything, compare `src-tauri/src/cli/tui/ui/pricing.rs` and `src-tauri/src/cli/tui/ui/usage.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) src-tauri/src/cli/tui/mod.rs:3312 — src-tauri/src/cli/tui/mod.rs:3312-3343 | src-tauri/src/cli/tui/mod.rs:3365-3396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) src-tauri/src/cli/tui/mod.rs:3419 — src-tauri/src/cli/tui/mod.rs:3419-3449 | src-tauri/src/cli/tui/mod.rs:3878-3909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) src-tauri/src/codex_history_migration.rs:973 — src-tauri/src/codex_history_migration.rs:973-1001 | src-tauri/src/codex_history_migration.rs:1043-1073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) src-tauri/src/proxy/forwarder.rs:310 — src-tauri/src/proxy/forwarder.rs:310-340 | src-tauri/src/proxy/forwarder.rs:555-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) src-tauri/src/cli/commands/auth.rs:435 — src-tauri/src/cli/commands/auth.rs:435-462 | src-tauri/src/cli/commands/provider_inspect.rs:540-567 — before extracting anything, compare `src-tauri/src/cli/commands/auth.rs` and `src-tauri/src/cli/commands/provider_inspect.rs` as WHOLE FILES: this scan already matched 3 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 (23–28 lines × 2) · ×1
  • Duplicated block (23–28 lines × 2) src-tauri/src/cli/commands/config_s3.rs:215 — src-tauri/src/cli/commands/config_s3.rs:215-242 | src-tauri/src/cli/commands/config_webdav.rs:306-328 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) src-tauri/src/cli/tui/runtime_actions/editor.rs:725 — src-tauri/src/cli/tui/runtime_actions/editor.rs:725-750 | src-tauri/src/cli/tui/runtime_actions/editor.rs:967-993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src-tauri/src/services/proxy.rs:3020 — src-tauri/src/services/proxy.rs:3020-3046 | src-tauri/src/services/proxy.rs:3737-3763 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) src-tauri/src/cli/commands/hermes.rs:219 — src-tauri/src/cli/commands/hermes.rs:219-244 | src-tauri/src/cli/tui/runtime_actions/config.rs:431-456 | src-tauri/src/commands/workspace.rs:448-473 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) src-tauri/src/claude_mcp.rs:313 — src-tauri/src/claude_mcp.rs:313-336 | src-tauri/src/gemini_mcp.rs:99-123 — before extracting anything, compare `src-tauri/src/claude_mcp.rs` and `src-tauri/src/gemini_mcp.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 lines × 2) · ×1
  • Duplicated block (25 lines × 2) src-tauri/src/cli/tui/ui/forms/mcp.rs:77 — src-tauri/src/cli/tui/ui/forms/mcp.rs:77-101 | src-tauri/src/cli/tui/ui/forms/provider.rs:496-520 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 154 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) · ×1
  • Duplicated block (24 lines × 5) src-tauri/src/services/balance.rs:73 — src-tauri/src/services/balance.rs:73-96 | src-tauri/src/services/balance.rs:145-168 | src-tauri/src/services/balance.rs:204-227 | src-tauri/src/services/balance.rs:261-284 | src-tauri/src/services/balance.rs:321-344 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) src-tauri/src/config.rs:725 — src-tauri/src/config.rs:725-747 | src-tauri/src/database/mod.rs:256-277 — before extracting anything, compare `src-tauri/src/config.rs` and `src-tauri/src/database/mod.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–22 lines × 4) · ×1
  • Duplicated block (16–22 lines × 4) src-tauri/src/cli/tui/ui/config.rs:3068 — src-tauri/src/cli/tui/ui/config.rs:3068-3083 | src-tauri/src/cli/tui/ui/config.rs:3241-3262 | src-tauri/src/cli/tui/ui/config.rs:3314-3334 | src-tauri/src/cli/tui/ui/skills/repos.rs:20-41 — before extracting anything, compare `src-tauri/src/cli/tui/ui/config.rs` and `src-tauri/src/cli/tui/ui/skills/repos.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) src-tauri/src/cli/tui/ui/config.rs:958 — src-tauri/src/cli/tui/ui/config.rs:958-978 | src-tauri/src/cli/tui/ui/config.rs:1434-1453 | src-tauri/src/cli/tui/ui/config.rs:2333-2352 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) src-tauri/src/cli/tui/ui/usage.rs:204 — src-tauri/src/cli/tui/ui/usage.rs:204-224 | src-tauri/src/cli/tui/ui/usage.rs:227-246 — both copies are in the same file, so extract the 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–20 lines × 4) · ×1
  • Duplicated block (19–20 lines × 4) src-tauri/src/cli/tui/ui/forms/mcp.rs:293 — src-tauri/src/cli/tui/ui/forms/mcp.rs:293-312 | src-tauri/src/cli/tui/ui/forms/provider.rs:1601-1620 | src-tauri/src/cli/tui/ui/forms/s3.rs:69-88 | src-tauri/src/cli/tui/ui/forms/webdav.rs:61-79 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 154 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) · ×1
  • Duplicated block (19–20 lines × 3) src-tauri/src/services/session_usage.rs:1292 — src-tauri/src/services/session_usage.rs:1292-1310 | src-tauri/src/services/session_usage_codex.rs:2007-2025 | src-tauri/src/services/session_usage_gemini.rs:366-385 — before extracting anything, compare `src-tauri/src/services/session_usage.rs` and `src-tauri/src/services/session_usage_codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) src-tauri/src/cli/tui/ui/config.rs:4128 — src-tauri/src/cli/tui/ui/config.rs:4128-4147 | src-tauri/src/cli/tui/ui/config.rs:4244-4261 — both copies are in the same file, so extract the 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–19 lines × 2) · ×1
  • Duplicated block (12–19 lines × 2) src-tauri/src/cli/tui/form/provider_state.rs:1357 — src-tauri/src/cli/tui/form/provider_state.rs:1357-1375 | src-tauri/src/cli/tui/form/provider_state.rs:1408-1419 — both copies are in the same file, so extract the 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–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) src-tauri/src/cli/tui/ui/config.rs:1480 — src-tauri/src/cli/tui/ui/config.rs:1480-1495 | src-tauri/src/cli/tui/ui/config.rs:1625-1643 — both copies are in the same file, so extract the 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 (13–19 lines × 2) · ×1
  • Duplicated block (13–19 lines × 2) src-tauri/src/proxy/providers/transform.rs:596 — src-tauri/src/proxy/providers/transform.rs:596-608 | src-tauri/src/proxy/providers/transform_codex_chat.rs:1213-1231 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) src-tauri/src/cli/tui/ui/forms/mcp.rs:353 — src-tauri/src/cli/tui/ui/forms/mcp.rs:353-370 | src-tauri/src/cli/tui/ui/forms/prompt.rs:148-165 | src-tauri/src/cli/tui/ui/forms/provider.rs:652-669 | src-tauri/src/cli/tui/ui/forms/provider.rs:1661-1678 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1537 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1537-1551 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1684-1701 — both copies are in the same file, so extract the 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–17 lines × 5) · ×1
  • Duplicated block (10–17 lines × 5) src-tauri/src/cli/tui/ui/config.rs:3067 — src-tauri/src/cli/tui/ui/config.rs:3067-3078 | src-tauri/src/cli/tui/ui/config.rs:3240-3255 | src-tauri/src/cli/tui/ui/config.rs:3313-3328 | src-tauri/src/cli/tui/ui/config.rs:4271-4280 | src-tauri/src/cli/tui/ui/skills/repos.rs:19-35 — before extracting anything, compare `src-tauri/src/cli/tui/ui/config.rs` and `src-tauri/src/cli/tui/ui/skills/repos.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 × 3) · ×1
  • Duplicated block (16–17 lines × 3) src-tauri/src/services/usage_stats.rs:506 — src-tauri/src/services/usage_stats.rs:506-522 | src-tauri/src/services/usage_stats.rs:1051-1066 | src-tauri/src/services/usage_stats.rs:1177-1192 — 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–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) src-tauri/src/session_manager/providers/hermes.rs:470 — src-tauri/src/session_manager/providers/hermes.rs:470-484 | REDACTED:670-686 — before extracting anything, compare `src-tauri/src/session_manager/providers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 11 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 (12–16 lines × 3) · ×1
  • Duplicated block (12–16 lines × 3) src-tauri/src/proxy/providers/streaming.rs:202 — src-tauri/src/proxy/providers/streaming.rs:202-217 | src-tauri/src/proxy/providers/streaming_gemini.rs:313-324 | src-tauri/src/proxy/providers/streaming_gemini.rs:425-436 — 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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) src-tauri/src/proxy/cache_injector.rs:19 — src-tauri/src/proxy/cache_injector.rs:19-33 | src-tauri/src/proxy/cache_injector.rs:41-56 — both copies are in the same file, so extract the 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–15 lines × 11) · ×1
  • Duplicated block (9–15 lines × 11) src-tauri/src/cli/tui/ui/config.rs:4190 — src-tauri/src/cli/tui/ui/config.rs:4190-4199 | src-tauri/src/cli/tui/ui/config.rs:4285-4293 | src-tauri/src/cli/tui/ui/forms/prompt.rs:139-148 | src-tauri/src/cli/tui/ui/forms/provider.rs:644-652 | src-tauri/src/cli/tui/ui/forms/provider.rs:926-935 | src-tauri/src/cli/tui/ui/forms/provider.rs:1013-1021 | src-tauri/src/cli/tui/ui/forms/provider.rs:1162-1171 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2303-2317 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:2512-2525 | src-tauri/src/cli/tui/ui/skills/discover.rs:116-129 | src-tauri/src/cli/tui/ui/skills/repos.rs:95-108 — before extracting anything, compare `src-tauri/src/cli/tui/ui/config.rs` and `src-tauri/src/cli/tui/ui/skills/repos.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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–15 lines × 6) · ×1
  • Duplicated block (13–15 lines × 6) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:420 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:420-432 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1538-1552 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1586-1598 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1621-1633 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1688-1702 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1742-1756 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) src-tauri/src/daemon/supervisor.rs:632 — src-tauri/src/daemon/supervisor.rs:632-642 | src-tauri/src/daemon/supervisor.rs:751-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) src-tauri/src/services/usage_stats.rs:499 — src-tauri/src/services/usage_stats.rs:499-512 | src-tauri/src/services/usage_stats.rs:631-642 | src-tauri/src/services/usage_stats.rs:1046-1057 | src-tauri/src/services/usage_stats.rs:1172-1183 — 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–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) src-tauri/src/cli/tui/ui/providers.rs:133 — src-tauri/src/cli/tui/ui/providers.rs:133-145 | src-tauri/src/cli/tui/ui/sessions.rs:703-715 | src-tauri/src/cli/tui/ui/shared.rs:544-557 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) src-tauri/src/cli/tui/runtime_systems/workers.rs:2998 — src-tauri/src/cli/tui/runtime_systems/workers.rs:2998-3011 | src-tauri/src/cli/tui/runtime_systems/workers.rs:3039-3050 — both copies are in the same file, so extract the 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 × 3) · ×1
  • Duplicated block (12–13 lines × 3) src-tauri/src/services/subscription.rs:144 — src-tauri/src/services/subscription.rs:144-156 | src-tauri/src/services/subscription.rs:438-449 | src-tauri/src/services/subscription.rs:1044-1056 — 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–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) src-tauri/src/cli/tui/ui/forms/prompt.rs:17 — src-tauri/src/cli/tui/ui/forms/prompt.rs:17-27 | src-tauri/src/cli/tui/ui/forms/provider.rs:450-462 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/prompt.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) · ×1
  • Duplicated block (10–11 lines × 5) src-tauri/src/session_manager/providers/claude.rs:156 — src-tauri/src/session_manager/providers/claude.rs:156-165 | src-tauri/src/session_manager/providers/codex.rs:806-815 | src-tauri/src/session_manager/providers/hermes.rs:877-886 | src-tauri/src/session_manager/providers/openclaw.rs:437-446 | src-tauri/src/session_manager/providers/pi.rs:513-523 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 10) · ×1
  • Duplicated block (10 lines × 10) src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:423 — src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:423-432 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:496-505 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:598-607 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:776-785 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:821-830 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:875-884 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1543-1552 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1589-1598 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1624-1633 | src-tauri/src/cli/tui/app/overlay_handlers/pickers.rs:1693-1702 — all 10 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 lines × 8) · ×1
  • Duplicated block (10 lines × 8) src-tauri/src/services/balance.rs:76 — src-tauri/src/services/balance.rs:76-85 | src-tauri/src/services/balance.rs:148-157 | src-tauri/src/services/balance.rs:207-216 | src-tauri/src/services/balance.rs:264-273 | src-tauri/src/services/balance.rs:324-333 | src-tauri/src/services/coding_plan.rs:107-116 | src-tauri/src/services/coding_plan.rs:278-287 | src-tauri/src/services/coding_plan.rs:363-372 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) src-tauri/src/services/balance.rs:88 — src-tauri/src/services/balance.rs:88-96 | src-tauri/src/services/balance.rs:160-168 | src-tauri/src/services/balance.rs:219-227 | src-tauri/src/services/balance.rs:276-284 | src-tauri/src/services/balance.rs:336-344 | src-tauri/src/services/coding_plan.rs:130-138 | src-tauri/src/services/coding_plan.rs:301-309 | src-tauri/src/services/coding_plan.rs:386-394 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) src-tauri/src/cli/tui/ui/forms/mcp.rs:297 — src-tauri/src/cli/tui/ui/forms/mcp.rs:297-306 | src-tauri/src/cli/tui/ui/forms/prompt.rs:93-102 | src-tauri/src/cli/tui/ui/forms/provider.rs:561-570 | src-tauri/src/cli/tui/ui/forms/provider.rs:1605-1614 | src-tauri/src/cli/tui/ui/forms/s3.rs:73-82 | src-tauri/src/cli/tui/ui/forms/webdav.rs:65-73 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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) · ×1
  • Duplicated block (9 lines × 4) src-tauri/src/cli/tui/ui/forms/mcp.rs:341 — src-tauri/src/cli/tui/ui/forms/mcp.rs:341-349 | src-tauri/src/cli/tui/ui/forms/provider.rs:640-648 | src-tauri/src/cli/tui/ui/forms/provider.rs:1649-1657 | src-tauri/src/cli/tui/ui/forms/s3.rs:116-124 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/provider.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 154 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) · ×1
  • Duplicated block (7–9 lines × 2) src-tauri/src/cli/commands/provider.rs:351 — src-tauri/src/cli/commands/provider.rs:351-357 | src-tauri/src/cli/commands/provider_input.rs:4045-4053 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) src-tauri/src/proxy/providers/transform.rs:245 — src-tauri/src/proxy/providers/transform.rs:245-253 | src-tauri/src/proxy/providers/transform_responses.rs:396-401 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 5 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) src-tauri/src/cli/tui/ui/overlay/mcp_key_value.rs:62 — src-tauri/src/cli/tui/ui/overlay/mcp_key_value.rs:62-69 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:543-550 | src-tauri/src/cli/tui/ui/overlay/pickers.rs:833-839 — 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 (2–8 lines × 4) · ×1
  • Duplicated block (2–8 lines × 4) src-tauri/src/mcp.rs:840 — src-tauri/src/mcp.rs:840-842 | src-tauri/src/mcp.rs:890-897 | src-tauri/src/mcp.rs:1485-1492 | src-tauri/src/mcp.rs:1535-1536 — 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 (5–7 lines × 2) · ×1
  • Duplicated block (5–7 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:531 — src-tauri/src/proxy/providers/transform_codex_anthropic.rs:531-535 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:567-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) src-tauri/src/cli/tui/ui/config.rs:944 — src-tauri/src/cli/tui/ui/config.rs:944-949 | src-tauri/src/cli/tui/ui/config.rs:1417-1422 | src-tauri/src/cli/tui/ui/config.rs:2312-2317 | src-tauri/src/cli/tui/ui/forms/mcp.rs:20-25 | src-tauri/src/cli/tui/ui/forms/prompt.rs:15-20 | src-tauri/src/cli/tui/ui/forms/provider.rs:448-453 | src-tauri/src/cli/tui/ui/forms/provider.rs:1067-1072 | src-tauri/src/cli/tui/ui/forms/provider.rs:1295-1300 | src-tauri/src/cli/tui/ui/forms/provider.rs:1488-1493 — before extracting anything, compare `src-tauri/src/cli/tui/ui/forms/mcp.rs` and `src-tauri/src/cli/tui/ui/forms/prompt.rs` as WHOLE FILES: this scan already matched 10 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. If that is what happened, the fix is to keep one copy and have the 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–6 lines × 3) · ×1
  • Duplicated block (3–6 lines × 3) src-tauri/src/proxy/providers/transform.rs:179 — src-tauri/src/proxy/providers/transform.rs:179-184 | src-tauri/src/proxy/providers/transform_gemini.rs:78-80 | src-tauri/src/proxy/providers/transform_responses.rs:328-333 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 5 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) src-tauri/src/services/session_usage.rs:657 — src-tauri/src/services/session_usage.rs:657-661 | src-tauri/src/services/session_usage.rs:667-672 — both copies are in the same file, so extract the 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 (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) src-tauri/src/services/skill.rs:1685 — src-tauri/src/services/skill.rs:1685-1690 | src-tauri/src/services/skill.rs:1779-1782 | src-tauri/src/services/webdav_sync/archive.rs:181-186 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (2–5 lines × 4) · ×1
  • Duplicated block (2–5 lines × 4) src-tauri/src/deeplink/provider.rs:524 — src-tauri/src/deeplink/provider.rs:524-528 | src-tauri/src/deeplink/provider.rs:641-642 | src-tauri/src/deeplink/provider.rs:683-687 | src-tauri/src/deeplink/provider.rs:710-714 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) src-tauri/src/cli/tui/form/mcp.rs:350 — src-tauri/src/cli/tui/form/mcp.rs:350-355 | src-tauri/src/cli/tui/form/provider_state.rs:1016-1021 | src-tauri/src/cli/tui/form/s3.rs:232-237 | src-tauri/src/cli/tui/form/webdav.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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) src-tauri/src/mcp.rs:401 — src-tauri/src/mcp.rs:401-415 | src-tauri/src/mcp.rs:792-806 | src-tauri/src/mcp.rs:961-975 — 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 × 4) · ×1
  • Duplicated block (8 lines × 4) src-tauri/src/proxy/providers/claude.rs:368 — src-tauri/src/proxy/providers/claude.rs:368-375 | src-tauri/src/proxy/providers/claude.rs:376-383 | src-tauri/src/proxy/providers/claude.rs:384-391 | src-tauri/src/proxy/providers/claude.rs:392-399 — 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 (7–29 lines × 2) · ×1
  • Duplicated block (7–29 lines × 2) scripts/benchmark_cc_switch.py:780 — scripts/benchmark_cc_switch.py:780-786 | scripts/benchmark_cc_switch.py:811-839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/benchmark_cc_switch.py:780` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience src-tauri/src/services/stream_check/provider_extract.rs:188 — `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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) scripts/benchmark_cc_switch.py:150 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Minor — 73 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate src-tauri/src/cli/tui/app/form_handlers/mcp.rs:69 — `!mcp.server_type.is_remote() && mcp.command.is_blank()` appears character-identically in 2 files — src-tauri/src/cli/tui/app/form_handlers/mcp.rs, src-tauri/src/cli/tui/app/form_handlers/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 src-tauri/src/cli/tui/runtime_systems/types.rs:901 — `!root.is_empty() && root.contains("://")` appears character-identically in 2 files — src-tauri/src/cli/tui/runtime_systems/types.rs, src-tauri/src/services/provider/models.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src-tauri/src/cli/tui/form/provider_json.rs:192 — `!self.include_common_config || common_snippet.trim().is_empty()` appears character-identically in 2 files — src-tauri/src/cli/tui/form/provider_json.rs, src-tauri/src/cli/tui/form/provider_state.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 src-tauri/src/cli/provider_quota.rs:198 — `!trimmed.is_empty() && !trimmed.eq_ignore_ascii_case("default")` appears character-identically in 2 files — src-tauri/src/cli/provider_quota.rs, src-tauri/src/cli/tui/ui/shared.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 src-tauri/src/cli/tui/ui/overlay/pickers.rs:1998 — `(ch.is_whitespace() && ch != ' ') || ch.is_control()` appears character-identically in 2 files — src-tauri/src/cli/tui/ui/overlay/pickers.rs, src-tauri/src/cli/tui/ui/shared.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 src-tauri/src/cli/commands/provider_input.rs:4202 — `attribution.get("commit").and_then(Value::as_str) == Some("") && attribution.get("pr").and_then(Value::as_str) == Some("")` appears character-identically in 2 files — src-tauri/src/cli/commands/provider_input.rs, src-tauri/src/cli/tui/form/provider_json.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 src-tauri/src/cli/tui/runtime_systems/types.rs:884 — `base.ends_with("/v1") || base.ends_with("/v1beta")` appears character-identically in 2 files — src-tauri/src/cli/tui/runtime_systems/types.rs, src-tauri/src/services/provider/models.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src-tauri/src/cli/tui/app/types.rs:2709 — `base.scope_epoch == scope_epoch && base.scope == scope && base.generation == base_generation` appears character-identically in 2 files — src-tauri/src/cli/tui/app/types.rs, src-tauri/src/cli/tui/runtime_systems/handlers.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 src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:592 — `body.get("type").and_then(Value::as_str) == Some("error") || body.get("error").is_some()` appears character-identically in 2 files — src-tauri/src/proxy/providers/streaming_codex_anthropic.rs, src-tauri/src/proxy/providers/transform_codex_anthropic.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 src-tauri/src/cli/commands/provider_input.rs:3700 — `c.is_alphanumeric() || c == '-' || c == '_'` appears character-identically in 2 files — src-tauri/src/cli/commands/provider_input.rs, src-tauri/src/services/prompt.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src-tauri/src/daemon/supervisor.rs:1260 — `connect_host.contains(':') && !connect_host.starts_with('[')` appears character-identically in 2 files — src-tauri/src/daemon/supervisor.rs, src-tauri/src/services/proxy.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 src-tauri/src/proxy/providers/codex_chat_history.rs:411 — `data.trim().is_empty() || data.trim() == "[DONE]"` appears character-identically in 2 files — src-tauri/src/proxy/providers/codex_chat_history.rs, src-tauri/src/proxy/providers/transform_codex_anthropic.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 src-tauri/src/cli/tui/ui/forms/mcp.rs:474 — `editing && matches!(focus, FormFocus::Fields)` appears character-identically in 2 files — src-tauri/src/cli/tui/ui/forms/mcp.rs, src-tauri/src/cli/tui/ui/forms/shared.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 src-tauri/src/codex_history_migration.rs:2749 — `err.to_string().contains("符号链接") || err.to_string().contains("symlink")` appears character-identically in 3 files — src-tauri/src/codex_history_migration.rs, src-tauri/src/config.rs, REDACTED. 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 src-tauri/src/proxy/error.rs:232 — `error.is_timeout() || error.is_connect()` appears character-identically in 2 files — src-tauri/src/proxy/error.rs, src-tauri/src/proxy/forwarder.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 src-tauri/src/proxy/providers/claude.rs:291 — `key.starts_with("ya29.") || key.starts_with('{')` appears character-identically in 3 files — src-tauri/src/proxy/providers/claude.rs, src-tauri/src/proxy/providers/gemini.rs, src-tauri/src/proxy/providers/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 src-tauri/src/cli/tui/app/content_usage.rs:145 — `matches!(key.code, KeyCode::BackTab) || (matches!(key.code, KeyCode::Tab) && key.modifiers.contains(KeyModifiers::SHIFT))` appears character-identically in 2 files — src-tauri/src/cli/tui/app/content_usage.rs, src-tauri/src/cli/tui/app/form_handlers/tab.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 src-tauri/src/cli/tui/app/form_handlers/mcp.rs:66 — `mcp.server_type.is_remote() && mcp.url.is_blank()` appears character-identically in 2 files — src-tauri/src/cli/tui/app/form_handlers/mcp.rs, src-tauri/src/cli/tui/app/form_handlers/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 src-tauri/src/proxy/forwarder.rs:1206 — `media_type == "application/json" || media_type.ends_with("+json")` appears character-identically in 2 files — src-tauri/src/proxy/forwarder.rs, src-tauri/src/proxy/handlers.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 src-tauri/src/services/skill.rs:1741 — `metadata.file_type().is_symlink() || !metadata.is_dir()` appears character-identically in 2 files — src-tauri/src/services/skill.rs, src-tauri/src/session_manager/transcript.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 src-tauri/src/cli/commands/provider.rs:87 — `normalized == "true" || normalized == "1"` appears character-identically in 3 files — src-tauri/src/cli/commands/provider.rs, src-tauri/src/cli/tui/form/provider_state_loading.rs, src-tauri/src/proxy/providers/claude.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 src-tauri/src/session_manager/mod.rs:491 — `provider_id == "hermes" && source_path.starts_with("sqlite:")` appears character-identically in 2 files — src-tauri/src/session_manager/mod.rs, src-tauri/src/session_manager/transcript.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 src-tauri/src/session_manager/mod.rs:488 — `provider_id == "opencode" && source_path.starts_with("sqlite:")` appears character-identically in 2 files — src-tauri/src/session_manager/mod.rs, src-tauri/src/session_manager/transcript.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 src-tauri/src/daemon/supervisor.rs:1250 — `rc == 0 || std::io::Error::last_os_error().raw_os_error() == Some(libc::EPERM)` appears character-identically in 3 files — src-tauri/src/daemon/supervisor.rs, src-tauri/src/services/proxy.rs, src-tauri/src/test_support.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 src-tauri/src/cli/tui/app/helpers.rs:1644 — `repo.owner.to_lowercase().contains(q) || repo.name.to_lowercase().contains(q) || repo.branch.to_lowercase().contains(q)` appears character-identically in 2 files — src-tauri/src/cli/tui/app/helpers.rs, src-tauri/src/cli/tui/ui/skills/repos.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.
D34 · Knowledge Freshness · Orphaned file · ×12
  • Orphaned file src-tauri/src/claude_mcp.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/daemon/ipc/server.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/daemon/restart.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/daemon/ipc/client.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/deeplink/mcp.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/daemon/logging.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/services/env_checker.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/provider_defaults.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/cli/commands/deeplink.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/claude_plugin.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/error.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src-tauri/src/deeplink/prompt.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X9 · Subsumed condition operand · Subsumed condition operand · ×11
  • Subsumed condition operand src-tauri/src/services/coding_plan.rs:31 — `url.contains("open.bigmodel.cn")` can never decide this `||` — every value satisfying `url.contains("open.bigmodel.cn")` also satisfies `url.contains("bigmodel.cn")`, 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 src-tauri/src/proxy/gemini_url.rs:94 — `path.ends_with("/v1beta/openai/chat/completions")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/openai/chat/completions")` also satisfies `path.ends_with("/openai/chat/completions")`, 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 src-tauri/src/proxy/gemini_url.rs:95 — `path.ends_with("/v1beta/openai/responses")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/openai/responses")` also satisfies `path.ends_with("/openai/responses")`, 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 src-tauri/src/proxy/gemini_url.rs:98 — `path.ends_with("/v1/openai/chat/completions")` can never decide this `||` — every value satisfying `path.ends_with("/v1/openai/chat/completions")` also satisfies `path.ends_with("/openai/chat/completions")`, 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 src-tauri/src/proxy/gemini_url.rs:99 — `path.ends_with("/v1/openai/responses")` can never decide this `||` — every value satisfying `path.ends_with("/v1/openai/responses")` also satisfies `path.ends_with("/openai/responses")`, 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 src-tauri/src/proxy/gemini_url.rs:112 — `path.ends_with("/v1beta/models")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/models")` also satisfies `path.ends_with("/models")`, 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 src-tauri/src/proxy/gemini_url.rs:113 — `path.ends_with("/v1beta/openai")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/openai")` also satisfies `path.ends_with("/openai")`, 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 src-tauri/src/proxy/gemini_url.rs:115 — `path.ends_with("/v1/models")` can never decide this `||` — every value satisfying `path.ends_with("/v1/models")` also satisfies `path.ends_with("/models")`, 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 src-tauri/src/proxy/gemini_url.rs:117 — `path.ends_with("/v1/openai")` can never decide this `||` — every value satisfying `path.ends_with("/v1/openai")` also satisfies `path.ends_with("/openai")`, 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 src-tauri/src/proxy/thinking_rectifier.rs:39 — `lower.contains("redacted_thinking")` can never decide this `||` — every value satisfying `lower.contains("redacted_thinking")` also satisfies `lower.contains("thinking")`, 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 src-tauri/src/proxy/thinking_rectifier.rs:54 — `lower.contains("redacted_thinking")` can never decide this `||` — every value satisfying `lower.contains("redacted_thinking")` also satisfies `lower.contains("thinking")`, 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.
X7 · Silent fallback defaults · Silent fallback default on Err · ×10
  • Silent fallback default on Err src-tauri/src/cli/tui/app/content_config.rs:14 — `open_openclaw_editor` 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 src-tauri/src/cli/tui/form/provider_state.rs:3121 — `openclaw_models_editor_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 src-tauri/src/cli/tui/form/provider_request_overrides.rs:157 — `format_local_proxy_header_overrides` 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 src-tauri/src/cli/tui/form/provider_request_overrides.rs:162 — `format_local_proxy_body_override` 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 src-tauri/src/cli/tui/ui/forms/mcp.rs:459 — `mcp_args_summary` 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 src-tauri/src/cli/tui/ui/forms/provider.rs:811 — `codex_auth_preview_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 src-tauri/src/codex_history_migration.rs:842 — `trusted_legacy_codex_model_provider_ids_from_config` turns every `Err` into `BTreeSet::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src-tauri/src/proxy/providers/transform_codex_chat.rs:2026 — `chat_error_to_response_error` turns every `Err` into `"Upstream error".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 src-tauri/src/proxy/tool_media.rs:334 — `strip_media_from_tool_value_at_depth` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src-tauri/src/services/skill.rs:527 — `parse_agents_lock` turns every `Err` into `HashMap::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.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 133 significant file(s) lose their only recent owner: src-tauri/src/cli/tui/app/tests.rs, REDACTED, src-tauri/src/cli/i18n.rs, src-tauri/src/cli/tui/form/tests.rs, src-tauri/src/cli/tui/data.rs, src-tauri/src/cli/tui/runtime_systems/workers.rs, src-tauri/src/proxy/providers/transform_codex_chat.rs, src-tauri/src/services/session_usage_codex.rs (+125 more). Pair on, review, or document these before any departure.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `src-tauri` (350335 LoC, 819 module-visible types across 43 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 12 of 347 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 347 of the 390 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src-tauri/src/claude_mcp.rs, src-tauri/src/daemon/ipc/server.rs, src-tauri/src/daemon/restart.rs, src-tauri/src/daemon/ipc/client.rs, src-tauri/src/deeplink/mcp.rs, src-tauri/src/daemon/logging.rs, src-tauri/src/services/env_checker.rs, src-tauri/src/provider_defaults.rs (and 4 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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 · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
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 26952 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.
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(` (src-tauri/src/proxy/server.rs:274).
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch scripts/benchmark_cc_switch.py:150 — `read_json` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 29 finding(s)
D12 · Dependency Hygiene · Outdated · ×29
  • Outdated: anyhow — `anyhow` is locked at 1.0.100 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: bytes — `bytes` is locked at 1.10.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1.5"` requirement declared in src-tauri/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.42 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src-tauri/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.5.53 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in src-tauri/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.5.61 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in src-tauri/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: env_logger — `env_logger` is locked at 0.11.8 but 0.11.11 is the current stable release on crates.io, and it already satisfies the `"0.11"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p env_logger` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.2 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/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.31 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
  • Outdated: hyper — `hyper` is locked at 1.7.0 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper` and commit the updated REDACTED.
  • Outdated: indexmap — `indexmap` is locked at 2.11.4 but 2.14.2 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p indexmap` and commit the updated REDACTED.
  • Outdated: inquire — `inquire` is locked at 0.9.2 but 0.9.4 is the current stable release on crates.io, and it already satisfies the `"0.9"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p inquire` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.190 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.28 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: once_cell — `once_cell` is locked at 1.21.3 but 1.21.4 is the current stable release on crates.io, and it already satisfies the `"1.21.3"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p once_cell` and commit the updated REDACTED.
  • Outdated: ratatui — `ratatui` is locked at 0.30.0 but 0.30.2 is the current stable release on crates.io, and it already satisfies the `"0.30"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ratatui` and commit the updated REDACTED.
  • Outdated: regex — `regex` is locked at 1.11.3 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1.10"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
  • Outdated: rust_decimal — `rust_decimal` is locked at 1.40.0 but 1.43.0 is the current stable release on crates.io, and it already satisfies the `"1.33"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rust_decimal` and commit the updated REDACTED.
  • Outdated: self-replace — `self-replace` is locked at 1.5.0 but 1.5.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p self-replace` and commit the updated REDACTED.
  • Outdated: semver — `semver` is locked at 1.0.27 but 1.0.28 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p semver` and commit the updated REDACTED.
  • Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.145 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: tachyonfx — `tachyonfx` is locked at 0.25.0 but 0.25.2 is the current stable release on crates.io, and it already satisfies the `"0.25"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tachyonfx` and commit the updated REDACTED.
  • Outdated: tar — `tar` is locked at 0.4.44 but 0.4.46 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tar` and commit the updated REDACTED.
  • Outdated: tempfile — `tempfile` is locked at 3.23.0 but 3.27.0 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tempfile` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.47.1 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • + 4 more in this group — see findings.md.

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-255d5620f9424cb2bf536652d0d0dfe2/history.json --exit-code 0 --source .1artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-255d5620f9424cb2bf536652d0d0dfe2/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .50artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .33artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a18169-2763-7e7d-a850-6e8a93b3c85f · 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