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

IvanLi-CN/tavily-hikari

Measured 17 November 2026, 14:23 UTC, at code version aad83d0

First survey, so nothing to compare with yet Test reliability: not measured

Test reliability is not measured: The rust executor ran against the .rs half and never executed.

CAI score 53.9out of 100 At risk

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: 262,759 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 2.7 person-years · Weakest lens: Production Readiness, 46.3

Findings by how serious they are

204 critical 1865 serious 113 minor

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

This survey was produced by

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

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

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

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

85of 85 dimensions measured by tools.
2152of 2182 findings point to an exact file and line, so you can open each one in the code. The other 30 concern the repository as a whole, such as missing documentation.
85dimensions across 9 lenses, read from 262,759 lines of product code in 3 projects.
Chapters

Executive summary

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

Production Readiness, at 46.3, 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 5.6 points. Planning backups and recovery would lift Production Readiness itself, worth about 4.9 points. Raising Production Readiness to 62 would lift the score to about 58.8.

Eighty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fifty-five known security holes in the packages the code depends on can be used by attackers, and eight weaknesses in the code could be used by an attacker. Pinning each tool to an exact version, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. Limiting each secret to its own step would fix the four secrets exposed to more of the pipeline than needed, and the four pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions. The four controls that only work with a mouse need to work with the keyboard, or to become a real button.

The product code is 262,759 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 46.3 · counts for 45%Code Health 52.7 · counts for 25%Security and Compliance 60.1 · counts for 14%Accessibility 60.3 · counts for 8%Architecture 76.5 · counts for 4%Event-Driven 78.7 · counts for 2%Maturity 88.1 · counts for 1%Domain Modelling 100.0 · counts for 1%Performance 100.0 · counts for 0%

If Production Readiness rose from 46.3 to 62, the lowest score rated Strong, the score would rise from 53.9 to about 58.8.

Code composition: what the lines of code are
Product code 66%Tests 34%
Rebuild cost: about €390,000 · Estimate
Cost to rebuild€130,000 to €650,000, for 2,168 to 6,879 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 54. 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: 262,759 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 5.6 points · Low effort · Secret Scanning
2
Resolve the 1 finding(s) in DR & Backup.
Raises the score by about 4.9 points · Medium effort · DR & Backup
3
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Raises the score by about 3.4 points · Medium effort · Outbound HTTP resilience

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €390,000 to build again, about 2.7 person-years of work. Its weakest lens is Production Readiness, at 46.3 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5.6 points for low effort, because it clears the 1 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 146,207 lines over the last 90 days, which is about 592,951 lines a year. At that pace, the extra work comes to an estimated 83 to 498.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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

310 modules, with 505 dependencies between them. 3 loops run through 30 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 270 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 tavily_hikari.backend_time2 tavily_hikari.bin.mock_edgeone3 tavily_hikari.linuxdo_credit_recharge4 tavily_hikari.remote_attempt_admission5 web.src.admin.queryLoadState6 web.src.api.accountEntitlements7 web.src.components.StatusBadge8 web.src.requestLogBodySummary9 tavily_hikari.ha10 tavily_hikari.models.alert_models11 tavily_hikari.models.quota_views12 web.src.api.runtime13 tavily_hikari.server.dto14 web.src15 web.src.admin16 web.src.api17 web.src.components18 web.src.lib19 web.src.user-console20 tavily_hikari.models21 tavily_hikari.analysis22 tavily_hikari.bin.billing_ledger_audit23 tavily_hikari.store.key_store_dashboard_quota_recovery24 tavily_hikari.store.sqlite_runtime25 tavily_hikari.store.key_store_ha_defs26 tavily_hikari.store27 tavily_hikari.forward_proxy.storage28 tavily_hikari.forward_proxy.settings_and_endpoints29 tavily_hikari.forward_proxy.manager30 tavily_hikari.forward_proxy.relay_and_xray31 tavily_hikari32 tavily_hikari.forward_proxy.responses_and_validation33 tavily_hikari.server.handlers.admin_resources.versions_and_proxy_helpers34 tavily_hikari.server.schedulers35 tavily_hikari.tavily_proxy36 tavily_hikari.server.handlers.admin_resources.ha37 tavily_hikari.server.state38 tavily_hikari.server.handlers.public39 tavily_hikari.server.handlers.user40 tavily_hikari.server.serve
1 tavily_hikari.backend_time
2 tavily_hikari.bin.mock_edgeone
3 tavily_hikari.linuxdo_credit_recharge
4 tavily_hikari.remote_attempt_admission
5 web.src.admin.queryLoadState
6 web.src.api.accountEntitlements
7 web.src.components.StatusBadge
8 web.src.requestLogBodySummary
9 tavily_hikari.ha2
10 tavily_hikari.models.alert_models2
11 tavily_hikari.models.quota_views14
12 web.src.api.runtime1
13 tavily_hikari.server.dto112931
14 web.src22
15 web.src.admin116743
16 web.src.api5108
17 web.src.components332
18 web.src.lib12
19 web.src.user-console321
20 tavily_hikari.models211
21 tavily_hikari.analysis51
22 tavily_hikari.bin.billing_ledger_audit1
23 tavily_hikari.store.key_store_dashboard_quota_recovery161
24 tavily_hikari.store.sqlite_runtime3
25 tavily_hikari.store.key_store_ha_defs82
26 tavily_hikari.store2373132137114
27 tavily_hikari.forward_proxy.storage1151
28 tavily_hikari.forward_proxy.settings_and_endpoints1111
29 tavily_hikari.forward_proxy.manager21
30 tavily_hikari.forward_proxy.relay_and_xray1121
31 tavily_hikari11154511
32 tavily_hikari.forward_proxy.responses_and_validation1141
33 tavily_hikari.server.handlers.admin_resources.versions_and_proxy_helpers114112
34 tavily_hikari.server.schedulers11112
35 tavily_hikari.tavily_proxy434114401661211
36 tavily_hikari.server.handlers.admin_resources.ha1101211
37 tavily_hikari.server.state111212631
38 tavily_hikari.server.handlers.public18127
39 tavily_hikari.server.handlers.user141754
40 tavily_hikari.server.serve16114
Uses a module listed above itPart of a loopThe module itself
1 tavily_hikari.backend_time2 tavily_hikari.bin.mock_edgeone3 tavily_hikari.linuxdo_credit_recharge4 tavily_hikari.remote_attempt_admission5 web.src.admin.queryLoadState6 web.src.api.accountEntitlements7 web.src.components.StatusBadge8 web.src.requestLogBodySummary9 tavily_hikari.ha10 tavily_hikari.models.alert_models11 tavily_hikari.models.quota_views12 web.src.api.runtime13 tavily_hikari.server.dto14 web.src15 web.src.admin16 web.src.api17 web.src.components18 web.src.lib19 web.src.user-console20 tavily_hikari.models21 tavily_hikari.analysis22 tavily_hikari.bin.billing_ledger_audit23 tavily_hikari.store.key_store_dashboard_quota_recovery24 tavily_hikari.store.sqlite_runtime25 tavily_hikari.store.key_store_ha_defs26 tavily_hikari.store27 tavily_hikari.forward_proxy.storage28 tavily_hikari.forward_proxy.settings_and_endpoints29 tavily_hikari.forward_proxy.manager30 tavily_hikari.forward_proxy.relay_and_xray31 tavily_hikari32 tavily_hikari.forward_proxy.responses_and_validation33 tavily_hikari.server.handlers.admin_resources.versions_and_proxy_helpers34 tavily_hikari.server.schedulers35 tavily_hikari.tavily_proxy36 tavily_hikari.server.handlers.admin_resources.ha37 tavily_hikari.server.state38 tavily_hikari.server.handlers.public39 tavily_hikari.server.handlers.user40 tavily_hikari.server.servetavily_hikari.backend_time1tavily_hikari.bin.mock_edgeone2tavily_hikari.linuxdo_credit_recharge3tavily_hikari.remote_attempt_admission4web.src.admin.queryLoadState5web.src.api.accountEntitlements6web.src.components.StatusBadge7web.src.requestLogBodySummary8tavily_hikari.ha9tavily_hikari.models.alert_models10tavily_hikari.models.quota_views11web.src.api.runtime12tavily_hikari.server.dto13web.src14web.src.admin15web.src.api16web.src.components17web.src.lib18web.src.user-console19tavily_hikari.models20tavily_hikari.analysis21tavily_hikari.bin.billing_ledger_audit22tavily_hikari.store.key_store_dashboard_quota_recovery23tavily_hikari.store.sqlite_runtime24tavily_hikari.store.key_store_ha_defs25tavily_hikari.store26tavily_hikari.forward_proxy.storage27tavily_hikari.forward_proxy.settings_and_endpoints28tavily_hikari.forward_proxy.manager29tavily_hikari.forward_proxy.relay_and_xray30tavily_hikari31tavily_hikari.forward_proxy.responses_and_validation32tavily_hikari.server.handlers.admin_resources.versions_and_proxy_helpers33tavily_hikari.server.schedulers34tavily_hikari.tavily_proxy35tavily_hikari.server.handlers.admin_resources.ha36tavily_hikari.server.state37tavily_hikari.server.handlers.public38tavily_hikari.server.handlers.user39tavily_hikari.server.serve4022141112931221167435108332123212115111613822373132137114115111112111211115451111411141121111243411440166121111012111112126311812714175416114+270 more modules (most-connected shown)

At a glance — Code Health · 52.7 · Adequate · gated by D2, R10, R3 ·

At a glance — Architecture · 76.5 · Adequate · gated by D26 ·

At a glance — Maturity · 88.1 · Exemplary ·

At a glance — Readiness · 46.3 · Adequate · gated by P5, P7 ·

At a glance — Security · 60.1 · Adequate · gated by D29, D36 ·

At a glance — Domain Modelling · 100.0 · Exemplary ·

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

At a glance — Accessibility · 60.3 · Adequate · gated by AC4 ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection107High / Critical
A03:2025 — Software Supply Chain Failures104High / Critical
A02:2025 — Security Misconfiguration2High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Top priorities: Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED; Resolve the 1 finding(s) in DR & Backup; 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.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+5.6 ptsLowSecret Scanning
Resolve the 1 finding(s) in DR & Backup.+4.9 ptsMediumDR & Backup
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.4 ptsMediumOutbound HTTP resilience
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+2.5 ptsMediumDependency Hygiene
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+1.9 ptsMediumLarge Files
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.+1.5 ptsMediumCode Duplication
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+1.4 ptsMediumKeyboard semantics
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml.+0.5 ptsLowPlatform End-of-Life

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedSecret Scanning: Leaked secret: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.3MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
src/server/dto.rs4.8MixedGod Classes: FileTooLong: server/dto.rs
src/server/handlers/public.rs5.0MixedChange Coupling: Boundary-crossing change coupling: public.rs ↔ key_store_request_logs_summary_windows.rs
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
src/tavily_proxy/proxy_quota_sync_and_jobs.rs5.5MixedCyclomatic Complexity: TavilyProxy::run_upstream_reconciliation_once_inner (cyclomatic 181)
src/lib.rs5.5MixedCyclomatic Complexity: tavily_hikari::run_request_statistics_recovery_once_with_time (cyclomatic 49)

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

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

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 113

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

Could not be resolved — 9

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

Methodology & how to trust this report

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

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

What we checked — 85 dimensions across the health lenses
D1D2D3D4D5D6D7D10D12D13D14D15D17D19D20D24D25D26D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX4AX9C1C2C3C4DM4DM6ED1GD1IC1M1M2M3M4P1P10P2P3P4P5P6P7PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X14X16X17X18X2X21X22X23X25X27X29X30X4X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1e9e3-e7ea-747d-8c48-18985594dbe7.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .ts, .tsx, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 62.7% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 540 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 111 test source file(s) (.rs, .py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (bun:test via `npm install --ignore-scripts` (no lockfile) in web/ (549 tests)): measured (5 flaky) suite(s) did re-run, and came back with 5 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (2 contributor(s) across 2598 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 1 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D20 ADR Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D28 Secrets (history) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `gitleaks` TIMED OUT after 75.1s against a 75s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `web/src/ClayDesignSystem.stories.tsx`, `web/src/PublicHome.stories.tsx`, `web/src/UserConsole.stories.tsx`, `web/src/UserConsoleAnnouncementHistory.stories.tsx`, `web/src/admin/AdminDashboardRuntime.tsx`, … (+61 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC1 Text alternatives — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 50 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. web/src/PublicHome.tsx, REDACTED) — that this run could NOT read, and the accessibility cards beside it were measured over the 126 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 50 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. web/src/PublicHome.tsx, REDACTED) — that this run could NOT read, and the accessibility cards beside it were measured over the 126 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC3 Page structure — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 50 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. web/src/PublicHome.tsx, REDACTED) — that this run could NOT read, and the accessibility cards beside it were measured over the 126 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC4 Keyboard semantics — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 50 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. web/src/PublicHome.tsx, REDACTED) — that this run could NOT read, and the accessibility cards beside it were measured over the 126 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC5 ARIA correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 50 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. web/src/PublicHome.tsx, REDACTED) — that this run could NOT read, and the accessibility cards beside it were measured over the 126 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 50 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. web/src/PublicHome.tsx, REDACTED) — that this run could NOT read, and the accessibility cards beside it were measured over the 126 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (ops/observability/compose.yml). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.prometheus.volumes.[]: required variable HIKARI_OBSERVABILITY_FILE_SD_DIR is missing a value: Set HIKARI_OBSERVABILITY_FILE_SD_DIR to a deployment-owned file-SD directory; runtime evidence skipped.
  • C1 Data Protection — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • C2 Access Controls — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • C3 Audit Trail — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • C4 Data Retention — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 374 further occurrence(s) are not listed individually; the score already reflects all 414.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 182 further occurrence(s) are not listed individually; the score already reflects all 222.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 9 further occurrence(s) are not listed individually; the score already reflects all 49.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 129 further occurrence(s) are not listed individually; the score already reflects all 169.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D25 ADR Conformance: ADR conformance checks only decisions stated in a checkable form (a ruled-out element, package or dependency, an adr-rules block, a declared delivery status): a decision written only as prose is unverifiable, and decisions never written down are not checked.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity4.3 / 10Weak✓ Tool-verified

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

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

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

175 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was runtime.UserConsole at 333. A further 9 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 tavily_hikari::analysis::canonical_request_kind_label at 26 — they are counted neither in the figure above nor in this dimension's score. 3 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/observability.rs (tavily_hikari::observability::normalize_reason at 22), src/store/sqlite_runtime.rs (SqliteOperation::as_str at 21), src/server/dto.rs (tavily_hikari::server::dto::get_token_leaderboard at 19). 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.

KeyStore::initialize_schema (cyclomatic 68) · ×34src/store/key_store_bootstrap.rs:928
tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler (cyclomatic 201) · ×27src/server/proxy/proxy_handlers_and_views.rs:1
TavilyProxy::run_upstream_reconciliation_once_inner (cyclomatic 181) · ×18src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719
AdminDashboardRuntime.AdminDashboard::handleManualRefresh (cyclomatic 32) · ×4web/src/admin/AdminDashboardRuntime.tsx:5167
runtime.UserConsole (cyclomatic 333)web/src/user-console/runtime.tsx:1222

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

What to do

  1. Bring the 6 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with runtime.UserConsole (cyclomatic 333), AdminDashboardRuntime.AdminDashboard (cyclomatic 329), tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler (cyclomatic 201). — 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 6 together lifts Cyclomatic Complexity from 4.3 to about 5.5/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

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

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

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

252 method(s) exceeded the cognitive complexity threshold of 15; the worst was tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler at 573.

tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler (cognitive 573) · ×65src/server/proxy/proxy_handlers_and_views.rs:1
KeyStore::ensure_user_token_binding_with_preferred (cognitive 82) · ×48src/store/key_store_users_and_oauth.rs:737
TavilyProxy::run_upstream_reconciliation_once_inner (cognitive 290) · ×23src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719
AdminDashboardRuntime.AdminDashboard::handleManualRefresh (cognitive 32) · ×5web/src/admin/AdminDashboardRuntime.tsx:5167
XraySupervisor::sync_endpoints (cognitive 28) · ×2src/forward_proxy/relay_and_xray.rs:619

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

What to do

  1. Bring the 5 bodies over 240 down to 240 or less in Cognitive Complexity — start with tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler (cognitive 573), runtime.UserConsole (cognitive 373), TavilyProxy::run_upstream_reconciliation_once_inner (cognitive 290). — 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 5 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

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

D3 · God Classes7.1 / 10Strong✓ Tool-verified

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

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

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

402 god class(es) detected.

FunctionTooLong: AdminDashboardRuntime.AdminDashboard · ×139web/src/admin/AdminDashboardRuntime.tsx:1757
MethodTooLong: TavilyProxy.run_upstream_reconciliation_once_inner · ×126src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719
FileTooLong: admin/AdminDashboardRuntime.tsx · ×106web/src/admin/AdminDashboardRuntime.tsx
ClassTooLong: SystemSettingsModule · ×17web/src/admin/SystemSettingsModule.tsx:1
TooManyFields: Cli · ×9src/main.rs:50

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

What to do

  1. Resolve the 139 FunctionTooLong finding(s) in God Classes — start with AdminPagesStoryRuntime.tsx (12), schedulers.rs (6), public.rs (5). — One of this dimension's main actionable groups (139 warning-level).
  2. Resolve the 126 MethodTooLong finding(s) in God Classes — start with key_store_dashboard_rollup_integrity.rs (7), proxy_http_and_logs.rs (6), key_store_token_logs.rs (6). — One of this dimension's main actionable groups (126 warning-level).
  3. Resolve the 106 FileTooLong finding(s) in God Classes — start with mod.rs (2), ha.rs (2), AdminDashboardRuntime.tsx. — One of this dimension's main actionable groups (106 warning-level).

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

D4 · Code Duplication6.7 / 10Adequate✓ Tool-verified

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

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

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

466 duplicated block group(s) detected. 8.1 % of the production lines (21,361 of 262,759) are in a reported copy. A further 204 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 2 of the 670 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .tsx (23% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (10 lines × 2) · ×31src/analysis.rs:2180
Duplicated block (12 lines × 2) · ×30src/bin/mcp_request_log_retry_repair.rs:383
Duplicated block (8 lines × 2) · ×26src/forward_proxy/responses_and_validation.rs:424
Duplicated block (7 lines × 2) · ×21src/models.rs:2327
Duplicated block (13 lines × 2) · ×16src/analysis.rs:368

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

What to do

  1. Resolve the 31 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with proxy_quota_sync_and_jobs.rs (3), key_store_dashboard_rollup_integrity.rs (2), key_store_upstream_reconciliation.rs (2). — One of this dimension's main actionable groups (31 warning-level).
  2. Resolve the 30 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with serve.rs (3), key_store_keys.rs (3), user_tag_and_token_handlers.rs (2). — One of this dimension's main actionable groups (30 warning-level).
  3. Resolve the 26 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with responses_and_validation.rs (4), ha.rs (4), lib.rs (2). — One of this dimension's main actionable groups (26 warning-level).

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

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

2 production modules (Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.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 92 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

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

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

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

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

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

Detailed fixes: d7_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D12 · Dependency Hygiene9.2 / 10Exemplary✓ Tool-verified

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

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

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

17 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: async-compression · ×17

✓ On the Gold path — maintain.

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

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

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

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

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

1 secret(s) detected. 3 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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 449 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. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity 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/tavily_proxy/proxy_quota_sync_and_jobs.rs (60×181=10860); src/server/schedulers.rs (49×40=1960); src/store/key_store_schema_migrations.rs (30×55=1650) Repeated repair below the complexity floor: src/store/sqlite_runtime.rs (60 of 70 changes were fixes); src/tavily_proxy/reconciliation_engine.rs (32 of 34 changes were fixes); src/store/key_store_upstream_reconciliation.rs (28 of 31 changes were fixes)

Hotspot: src/tavily_proxy/proxy_quota_sync_and_jobs.rs · ×30src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719
Repeated repair: src/store/sqlite_runtime.rs · ×27src/store/sqlite_runtime.rs:2180

What to do

  1. Resolve the 30 Hotspot finding(s) in Churn × Complexity Hotspots — start with proxy_quota_sync_and_jobs.rs, schedulers.rs, key_store_schema_migrations.rs. — One of this dimension's main actionable groups (30 warning-level).
  2. Resolve the 27 Repeated repair finding(s) in Churn × Complexity Hotspots — start with sqlite_runtime.rs, reconciliation_engine.rs, key_store_upstream_reconciliation.rs. — One of this dimension's main actionable groups (27 warning-level).

Detailed fixes: d15_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 262759 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. 377 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D24 · Comment Value7.7 7.5 / 10Strong✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 97% · ceiling Documented

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

redundant commentweb/src/admin/AdminDashboardRuntime.tsx:2170

What to do

  1. Resolve the 1 redundant comment finding(s) in Comment Value — start with AdminDashboardRuntime.tsx. — One of this dimension's main actionable groups (1 recommendation-level).

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

D25 · ADR Conformance10.0 / 10Exemplary○ Nothing flagged

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

Method: Each binding ADR read for checkable forms: a backticked element its Decision section rules out, a ruled-out package the manifests declare, a forbidden module dependency, an opt-in adr-rules block, and a declared delivery status the code does not yet carry. A prose decision with no checkable form is unverifiable, neither a finding nor a pass. Deterministic, no model. Advisory.

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

0 of 1 checkable records are broken by the code or by their own declared delivery (1 of 12 binding records state a rule in checkable form or declare their delivery; prose decisions are unverifiable).

✓ On the Gold path — maintain.

Detailed fixes: d25_recommendation.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.

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

2 of 3 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×2REDACTED:1

What to do

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

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

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

107 finding(s): 0 critical, 101 high, 6 medium, 0 low. 81 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 78 file(s) — `.github/scripts/release-intent.sh` (line 236, line 237, line 239), `REDACTED` (lines 125–126, lines 129–130, lines 135–136, …), `scripts/check-version-layer-reuse.sh`, `scripts/perf-local-boundaries.py`, `scripts/test-worktree-bootstrap.sh` (lines 90–297), … (+73 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

100 finding(s): 7 critical, 48 high, 42 medium, 3 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.2 / 10Adequategated by 2 critical 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.2 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: en.ts↔zh.ts 93%; admin_resources.rs↔tests.rs 93%; proxy.rs↔tests.rs 86%

Boundary-crossing change coupling: gc_recovery_load.py ↔ key_store_dashboard_rollup_integrity.rs · ×2scripts/gc_recovery_load.py:1
Change coupling: en.ts ↔ zh.ts · ×8web/src/i18n/translations/en.ts:1
Change-coupling hub: tests.rs → analysis.rs, dto.rs, admin_resources.rs, tavily.rs, user.rs, proxy.rs, TokenDetail.stories.tsx · ×2src/server/tests.rs

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with gc_recovery_load.py, public.rs. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 8 Change coupling finding(s) in Change Coupling — start with dto.rs (2), en.ts, UserConsole.stories.tsx. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with tests.rs, AdminPages.stories.tsx. — 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 & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED

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. — One of this dimension's main actionable groups (1 recommendation-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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

End-of-life runtime: Rust 1.91rust-toolchain.toml:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

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

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

AC2 · Forms & labels7.0 / 10Strong✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — web/src/admin/AdminDashboardRuntime.tsx:8684, web/src/pages/TokenDetail.tsx:1507
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×3) — web/src/admin/SystemSettingsModule.tsx:816, web/src/components/CherryStudioMock.tsx:148, web/src/components/CherryStudioMock.tsx:180
  • This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×4) — web/src/components/CherryStudioMock.tsx:144, web/src/components/CherryStudioMock.tsx:177, web/src/components/ConnectivityChecksPanel.tsx:210, …

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC4 · Keyboard semantics1.6 / 10Critical✓ Tool-verified

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

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

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

  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×4) — web/src/admin/AdminDashboardRuntime.tsx:10391, web/src/admin/AdminDashboardRuntime.tsx:10457, web/src/admin/ForwardProxySettingsModule.tsx:1205, …
  • This <path> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — web/src/admin/ForwardProxySettingsModule.tsx:810
  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×2) — web/src/admin/ForwardProxySettingsModule.tsx:1205, web/src/admin/ForwardProxySettingsModule.tsx:1287

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.8 / 10Strong✓ Tool-verified

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden. (×2) — web/src/components/MarkdownEditor.storybook.tsx:41, web/src/components/MarkdownEditor.storybook.tsx:47
  • This role is not a valid WAI-ARIA role, so assistive tech ignores it. Use a valid role (or the native element). — web/src/components/RollingNumber.tsx:273

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety7.4 / 10Strong✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `.markdown-editor-shell .ProseMirror` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/admin-announcements.css:179
  • `.markdown-editor-storybook-input:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/admin-announcements.css:249
  • `.btn:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/base.css:155
  • `.input:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/base.css:265
  • `.forward-proxy-error-pie-slice:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/dark.css:1826

What to do

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

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

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

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

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

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

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

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.

C1 · Data Protection6.5 / 10Adequate✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

  • No in-app HTTPS enforcement, but the server reads the forwarded scheme (X-Forwarded-Proto, actix's connection_info().scheme(), Rocket's proxy_proto_header) — a TLS-terminating reverse proxy sits in front of it, where serving TLS in the app would be wrong. Verify the reverse proxy enforces TLS. — src/server/state.rs:2669

What to do

  • Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault — not a key read from an environment variable beside the data) and encrypt the most sensitive columns (an AEAD over the field before Diesel/sqlx write it, SQLCipher, pgcrypto) — partial coverage still leaves gaps.
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.
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified

Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.

Method: Roslyn scan: audit-trail mechanism graded (SaveChanges interceptor/immutable AuditLog/[Audited] strong; bare IAuditable/AddAuditing weak). Deterministic.

  • An audit mechanism is present, but the trail is not yet complete — missing: a write-side hook every change flows through (a SeaORM ActiveModelBehavior hook or a database trigger recording each change, or an event-sourced store), per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).

What to do

  • Back the audit convention with a structural mechanism: a SeaORM ActiveModelBehavior before_save/after_save hook or a database trigger writing each sensitive change to an audit-log table, with the acting user and time on every entry.
C4 · Data Retention10.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

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

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

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

  • `mcp_request_log_retry_repair.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/bin/mcp_request_log_retry_repair.rs:393
  • `mcp_search_billing_repair.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/bin/mcp_search_billing_repair.rs:490
  • `mcp_session_delete_neutral_repair.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/bin/mcp_session_delete_neutral_repair.rs:1064
  • `sqlite_sidecar.legacy_request_logs_inline_sidecar_migration_allowed` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/bin/support/sqlite_sidecar.rs:170
  • `ReservedLocalPort.bind` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `TcpListener::bind`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/forward_proxy/relay_and_xray.rs:489
  • `src.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/main.rs:437
  • `observability.start_exporter` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/observability.rs:1360
  • `runtime_logging.read_process_status` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/runtime_logging.rs:182
  • `runtime_logging.sum_child_rss_bytes` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/runtime_logging.rs:210
  • `runtime_logging.read_relative_cgroup_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/runtime_logging.rs:276
  • `runtime_logging.read_u64_from_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/runtime_logging.rs:291
  • `runtime_logging.read_memory_limit_from_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/runtime_logging.rs:299
  • `KeyStore.sqlite_db_stats` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×4) — src/store/key_store_jobs.rs:291, src/store/key_store_jobs.rs:294, src/store/key_store_jobs.rs:301, …
  • `KeyStore.run_observability_sidecar_migrate` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — REDACTED:1818, REDACTED:2053
  • `store.legacy_request_logs_inline_sidecar_migration_allowed` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/store/mod.rs:1106
  • `store.core_database_file_size` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src/store/mod.rs:1118

What to do

  • Use the awaited twin of each blocking call, or move the work off the loop with `tokio::task::spawn_blocking` — a synchronous handler cannot simply `.await` in place.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

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

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

IC1 · Incompleteness & stubs7.6 / 10Strong✓ Tool-verified

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

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

  • `set_request_operation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/observability.rs:424
  • `emit_admin_privacy_status_prewarm_deferred` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/server/state.rs:1537
  • `import_ha_recovery_events` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — REDACTED:1021
  • `emit_shadow_adjustment_written_log` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/store/key_store_upstream_reconciliation.rs:2672
  • `log_db_operation_error` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/store/mod.rs:237
  • `log_sqlite_transient_write_retry_with_fields` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/store/sqlite_contention_logging.rs:13
  • `log_sqlite_transient_write_exhaustion_with_fields` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/store/sqlite_contention_logging.rs:51

What to do

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

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation8.0 / 10Strong✓ Tool-verified

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

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

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

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

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

P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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

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

  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `bun`, `cargo`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:2

What to do

  • Dependabot is configured but does not watch `github-actions`, `bun`, `cargo` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

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

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

P5 · DR & Backup0.0 / 10Critical✓ 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.

  • A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
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::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — src/bin/mock_edgeone_ingress.rs:197, src/bin/mock_mcp_client.rs:57, src/bin/mock_upstream.rs:74
  • `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. (×2) — src/forward_proxy/relay_and_xray.rs:129, src/forward_proxy/relay_and_xray.rs:223
  • `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×7) — src/ha.rs:1556, src/server/handlers/admin_resources/recharges_and_totp.rs:633, src/server/handlers/user.rs:660, …
  • `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — src/server/handlers/user.rs:2305

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF3 · Async & latency 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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety9.8 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication3.9 / 10Weak✓ Tool-verified

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

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

  • 79 duplicated blocks under web/src/ have copies in at least two of the sibling directories admin, api, components, i18n, lib, pages (+1 more sibling(s) not listed) — 35 of them are reported below, and 44 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 79 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 79 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 79 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/admin/DashboardOverview.tsx:90
  • 7 duplicated blocks under web/src/admin/ have copies in at least two of the sibling directories screens, storySupport — 6 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/admin/screens/UnboundTokenUsageScreen.tsx:106
  • web/src/admin/screens/UnboundTokenUsageScreen.tsx:106 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5406 — the two spans are one implementation copied and then locally edited — 1447 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/admin/screens/UnboundTokenUsageScreen.tsx:106
  • web/src/PublicHome.tsx:1047 · REDACTED:146 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — web/src/PublicHome.tsx:1047
  • web/src/admin/AdminDashboardRuntime.tsx:8048 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2702 — the two spans are one implementation copied and then locally edited — 830 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/admin/AdminDashboardRuntime.tsx:8048
  • web/src/admin/AdminDashboardRuntime.tsx:10888 · web/src/admin/AdminDashboardRuntime.tsx:11616 — the two spans are one implementation copied and then locally edited — 578 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/admin/AdminDashboardRuntime.tsx:10888
  • web/src/admin/AdminDashboardRuntime.tsx:12322 · web/src/admin/screens/UsersUsageScreen.tsx:244 — the two spans are one implementation copied and then locally edited — 528 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/admin/AdminDashboardRuntime.tsx:12322
  • web/src/admin/DashboardOverview.tsx:90 · web/src/i18n/types.ts:277 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — web/src/admin/DashboardOverview.tsx:90
  • web/src/api/userConsoleNormalization.ts:301 · web/src/api/userConsoleNormalization.ts:415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/api/userConsoleNormalization.ts:301
  • web/src/admin/AdminDashboardRuntime.tsx:9710 · web/src/admin/AdminDashboardRuntime.tsx:9979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/admin/AdminDashboardRuntime.tsx:9710
  • web/src/lib/haCopy.ts:57 · web/src/lib/haCopy.ts:109 — the two spans are one implementation copied and then locally edited — 258 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/lib/haCopy.ts:57
  • web/src/admin/AdminDashboardRuntime.tsx:3809 · web/src/admin/AdminDashboardRuntime.tsx:13016 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/admin/AdminDashboardRuntime.tsx:3809
  • web/src/admin/AdminDashboardRuntime.tsx:1152 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2650 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/admin/AdminDashboardRuntime.tsx:1152
  • web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:6910 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:7008 — all 2 copies are in the same file, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:6910
  • web/src/user-console/BillingPage.tsx:59 · web/src/user-console/RechargePanel.tsx:39 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — web/src/user-console/BillingPage.tsx:59
  • web/src/admin/AdminDashboardRuntime.tsx:1464 · web/src/admin/screens/shared.tsx:60 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/admin/AdminDashboardRuntime.tsx:1464
  • web/src/admin/ForwardProxySettingsModule.tsx:2841 · web/src/admin/ForwardProxySettingsModule.tsx:2883 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/admin/ForwardProxySettingsModule.tsx:2841
  • web/src/components/requestLogRebalance.tsx:36 · web/src/components/requestLogRebalance.tsx:88 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/components/requestLogRebalance.tsx:36
  • web/src/admin/AdminDashboardRuntime.tsx:4086 · web/src/admin/AdminDashboardRuntime.tsx:5347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/admin/AdminDashboardRuntime.tsx:4086
  • web/src/admin/ApiKeyBulkSyncProgressBubble.tsx:85 · web/src/admin/ForwardProxyProgressBubble.tsx:38 — the two spans are one implementation copied and then locally edited — 165 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/admin/ApiKeyBulkSyncProgressBubble.tsx:85
  • web/src/admin/ForwardProxySettingsModule.tsx:500 · web/src/admin/KeyStickyPanels.tsx:90 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/src/admin/ForwardProxySettingsModule.tsx:500
  • web/src/admin/AdminDashboardRuntime.tsx:3979 · web/src/pages/TokenDetail.tsx:1086 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/admin/AdminDashboardRuntime.tsx:3979
  • web/src/admin/AdminDashboardRuntime.tsx:10207 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4647 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/admin/AdminDashboardRuntime.tsx:10207
  • web/src/admin/AdminDashboardRuntime.tsx:11530 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4283 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/admin/AdminDashboardRuntime.tsx:11530
  • web/src/admin/ForwardProxySettingsModule.tsx:1160 · web/src/admin/ForwardProxySettingsModule.tsx:1244 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/admin/ForwardProxySettingsModule.tsx:1160
  • web/src/components/LanguageSwitcher.tsx:17 · web/src/components/UserConsoleHeader.tsx:139 — the two spans are one implementation copied and then locally edited — 229 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/components/LanguageSwitcher.tsx:17
  • web/src/components/ui/dropdown-menu.tsx:42 · web/src/components/ui/dropdown-menu.tsx:78 — the two spans are one implementation copied and then locally edited — 174 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/components/ui/dropdown-menu.tsx:42
  • web/src/admin/AdminDashboardRuntime.tsx:8566 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2217 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/admin/AdminDashboardRuntime.tsx:8566
  • web/src/admin/AnnouncementsModule.tsx:652 · web/src/admin/AnnouncementsModule.tsx:720 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/admin/AnnouncementsModule.tsx:652
  • web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3367 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3458 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3367
  • web/src/admin/AdminDashboardRuntime.tsx:812 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:183 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/admin/AdminDashboardRuntime.tsx:812
  • web/src/user-console/Announcements.tsx:178 · web/src/user-console/Announcements.tsx:209 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/user-console/Announcements.tsx:178
  • web/src/admin/AdminDashboardRuntime.tsx:9798 · web/src/admin/AdminDashboardRuntime.tsx:9913 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/admin/AdminDashboardRuntime.tsx:9798
  • web/src/admin/KeyStickyPanels.tsx:130 · web/src/admin/KeyStickyPanels.tsx:160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/admin/KeyStickyPanels.tsx:130
  • web/src/admin/SystemSettingsModule.tsx:1419 · web/src/admin/SystemSettingsModule.tsx:1454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/admin/SystemSettingsModule.tsx:1419
  • web/src/admin/UserDetailTokenTable.tsx:98 · web/src/admin/UserDetailTokenTable.tsx:155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/admin/UserDetailTokenTable.tsx:98
  • web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3998 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4037 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4076 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3998
  • web/src/api/userConsoleNormalization.ts:95 · web/src/api/userConsoleNormalization.ts:199 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — web/src/api/userConsoleNormalization.ts:95
  • web/src/admin/AdminDashboardRuntime.tsx:8296 · web/src/admin/AdminDashboardRuntime.tsx:8333 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/admin/AdminDashboardRuntime.tsx:8296
  • web/src/admin/AdminDashboardRuntime.tsx:11184 · web/src/admin/AdminDashboardRuntime.tsx:11224 · web/src/admin/AdminDashboardRuntime.tsx:11263 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/admin/AdminDashboardRuntime.tsx:11184

What to do

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

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

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

  • web/src/admin/AdminUserRankingsPage.tsx:3 imports echarts-for-react/lib/core, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/admin/AdminUserRankingsPage.tsx:3
  • web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4 imports storybook/internal/core-events, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity5.0 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • AdminDashboard has cyclomatic complexity 335 and cognitive complexity 319; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AdminDashboardRuntime.tsx:1757
  • UpstreamPrivacyStatusModule has cyclomatic complexity 126 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/UpstreamPrivacyStatusModule.tsx:189
  • SystemSettingsModule has cyclomatic complexity 121 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/SystemSettingsModule.tsx:282
  • handleDemoRoute has cyclomatic complexity 101 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1972
  • BillingPage has cyclomatic complexity 67 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/user-console/BillingPage.tsx:428
  • play has cyclomatic complexity 67 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:7318
  • ForwardProxySettingsModule has cyclomatic complexity 67 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/ForwardProxySettingsModule.tsx:1780
  • (anonymous) has cyclomatic complexity 65 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/UserConsole.stories.tsx:934
  • AdminSecuritySettingsModule has cyclomatic complexity 64 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AdminSecuritySettingsModule.tsx:167
  • resolveRequestKindBadgeTone has cyclomatic complexity 61 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/RequestKindBadge.tsx:57
  • createDemoLog has cyclomatic complexity 55 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:95
  • ApiKeysValidationDialog has cyclomatic complexity 52 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/ApiKeysValidationDialog.tsx:310
  • PublicHome has cyclomatic complexity 47 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/PublicHome.tsx:110
  • AlertsCenter has cyclomatic complexity 46 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AlertsCenter.tsx:460
  • schemaExampleValue has cyclomatic complexity 44 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/user-console/runtime.tsx:778
  • isSameAdminRoute has cyclomatic complexity 43 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/routes.ts:230
  • HaStatusBanner has cyclomatic complexity 43 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/HaStatusBanner.tsx:225
  • parseAdminPath has cyclomatic complexity 42 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/routes.ts:118
  • UserDetailSharedUsagePanel has cyclomatic complexity 41 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/UserDetailSharedUsagePanel.tsx:296
  • TokenDetail has cyclomatic complexity 39 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/pages/TokenDetail.tsx:405
  • HaSourceSettingsDialog has cyclomatic complexity 39 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/HaSourceSettingsDialog.tsx:100
  • RechargePanel has cyclomatic complexity 39 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/user-console/RechargePanel.tsx:162
  • handleManualRefresh has cyclomatic complexity 38 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AdminDashboardRuntime.tsx:5167
  • ForwardProxyCandidateDialog has cyclomatic complexity 38 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/ForwardProxySettingsModule.tsx:1528
  • KeyDetails has cyclomatic complexity 37 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AdminDashboardRuntime.tsx:12901
  • buildNodeRows has cyclomatic complexity 35 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/HaStatusBanner.tsx:114
  • (anonymous) has cyclomatic complexity 34 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AdminDashboardRuntime.tsx:8072
  • McpSessionBindingsModule has cyclomatic complexity 33 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/McpSessionBindingsModule.tsx:230
  • AdminLogin has cyclomatic complexity 33 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/pages/AdminLogin.tsx:25
  • RecentRequestDetails has cyclomatic complexity 32 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/AdminRecentRequestsPanel.tsx:549
  • isPublicIpv4 has cyclomatic complexity 32 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/lib/api-key-extract.ts:20
  • (anonymous) has cyclomatic complexity 31 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/user-console/runtime.tsx:2398
  • play has cyclomatic complexity 31 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AnnouncementsModule.stories.tsx:234
  • (anonymous) has cyclomatic complexity 30 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/HaNodeDetailPanel.tsx:311
  • syncApiKeyBulkUsageWithProgress has cyclomatic complexity 29 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/api/runtime.ts:1825
  • (anonymous) has cyclomatic complexity 29 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/AdminDashboardRuntime.tsx:8457
  • play has cyclomatic complexity 29 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:7896
  • requestForwardProxyProgress has cyclomatic complexity 28 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/api/runtime.ts:1331
  • (anonymous) has cyclomatic complexity 28 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/pages/TokenDetail.stories.tsx:594
  • failureKindGuidance has cyclomatic complexity 28 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/lib/logOperationalClass.ts:68
R3 · Large Files2.9 / 10Weak✓ Tool-verified

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

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

  • web/src/admin/AdminDashboardRuntime.tsx has 13102 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AdminDashboardRuntime.tsx:1
  • web/src/admin/storySupport/AdminPagesStoryRuntime.tsx has 7648 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:1
  • web/src/api/runtime.ts has 3690 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/api/runtime.ts:1
  • web/src/user-console/runtime.tsx has 3154 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/user-console/runtime.tsx:1
  • web/src/admin/ForwardProxySettingsModule.tsx has 2848 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/ForwardProxySettingsModule.tsx:1
  • REDACTED has 2495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • web/src/UserConsole.stories.tsx has 2225 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/UserConsole.stories.tsx:1
  • web/src/i18n/types.ts has 1945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/types.ts:1
  • web/src/i18n/translations/en.ts has 1629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/translations/en.ts:1
  • web/src/i18n/translations/zh.ts has 1628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/translations/zh.ts:1
  • web/src/pages/TokenDetail.tsx has 1518 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/pages/TokenDetail.tsx:1
  • web/src/admin/SystemSettingsModule.tsx has 1497 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/SystemSettingsModule.tsx:1
  • web/src/admin/AlertsCenter.tsx has 1458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AlertsCenter.tsx:1
  • web/src/components/AdminRecentRequestsPanel.tsx has 1414 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/AdminRecentRequestsPanel.tsx:1
  • web/src/PublicHome.tsx has 1380 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/PublicHome.tsx:1
  • web/src/admin/DashboardOverview.stories.tsx has 1260 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/DashboardOverview.stories.tsx:1
  • web/src/admin/DashboardOverview.tsx has 1158 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/DashboardOverview.tsx:1
  • web/src/admin/UpstreamPrivacyStatusModule.tsx has 1091 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/UpstreamPrivacyStatusModule.tsx:1
  • web/src/components/AdminRecentRequestsPanel.stories.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/AdminRecentRequestsPanel.stories.tsx:1
  • web/src/admin/AnnouncementsModule.tsx has 983 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AnnouncementsModule.tsx:1
  • web/src/admin/UserDetailSharedUsagePanel.tsx has 956 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/UserDetailSharedUsagePanel.tsx:1
  • web/src/admin/AdminUserRankingsPage.tsx has 941 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AdminUserRankingsPage.tsx:1
  • web/src/user-console/BillingPage.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/user-console/BillingPage.tsx:1
  • web/src/pages/TokenDetail.stories.tsx has 865 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/pages/TokenDetail.stories.tsx:1
  • REDACTED has 834 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • web/src/components/ApiKeysValidationDialog.tsx has 831 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/ApiKeysValidationDialog.tsx:1
  • web/src/admin/UpstreamPrivacyStatusModule.stories.tsx has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/UpstreamPrivacyStatusModule.stories.tsx:1
  • web/src/user-console/BillingPage.stories.tsx has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/user-console/BillingPage.stories.tsx:1
  • web/src/admin/AdminSecuritySettingsModule.tsx has 770 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AdminSecuritySettingsModule.tsx:1
  • web/src/components/HaStatusBanner.stories.tsx has 765 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/HaStatusBanner.stories.tsx:1
  • web/src/admin/routes.ts has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/routes.ts:1
  • web/src/admin/ForwardProxyEgressControl.stories.tsx has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/ForwardProxyEgressControl.stories.tsx:1
  • web/src/admin/DashboardTrendPanel.tsx has 638 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/DashboardTrendPanel.tsx:1
  • web/src/admin/McpSessionBindingsModule.tsx has 621 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/McpSessionBindingsModule.tsx:1
  • web/src/user-console/RechargePanel.tsx has 608 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/user-console/RechargePanel.tsx:1
  • web/src/admin/KeyStickyPanels.tsx has 607 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/KeyStickyPanels.tsx:1
  • web/src/admin/AdminUserDetailQuotaWorkspace.tsx has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AdminUserDetailQuotaWorkspace.tsx:1
  • web/src/admin/dashboardHourlyCharts.ts has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/dashboardHourlyCharts.ts:1
  • web/src/admin/AdminRechargeRecordsModule.tsx has 537 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/admin/AdminRechargeRecordsModule.tsx:1
  • web/src/components/HaStatusBanner.tsx has 530 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/HaStatusBanner.tsx:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×8) — web/scripts/generate-icon-data.mjs:1, web/src/components/MarkdownEditor.storybook.tsx:1, docs-site/theme/index.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

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

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

R7 · Dead Code8.5 / 10Strong✓ Tool-verified

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

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

  • 2 file(s) (~172 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — docs-site
  • Unreachable from the 40 application, 13 tooling and 153 test entry point(s) detected in this repo. Gate removals on `bun run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (40 application, 13 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×4) — scripts/capture_admin_pressure_storybook.mjs, web/src/api/admin.ts, web/src/api/appUsers.ts, …
  • Nothing imports this binding — it is safe to review for removal. (×8) — web/src/admin/dashboardCardBackdrops.ts:37, web/src/admin/quotaSlider.ts:47, web/src/admin/quotaSlider.ts:122, …
  • Nothing ultimately consumes this binding: its only referrer is the re-export in web/src/api/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web/src/api/index.ts in the same commit, or the barrel will import a name that no longer exists. — web/src/api/clientIp.ts:8
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×20) — web/src/PublicHome.tsx:81, web/src/admin/AdminDashboardRuntime.tsx:453, web/src/admin/AdminDashboardRuntime.tsx:454, …

What to do

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

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

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

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. — docs-site/theme/index.tsx:1
  • Imported only as a TYPE and declared in no reachable REDACTED. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning REDACTED. — web/src/lib/icon-data.ts:1
  • Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2) — REDACTED:20, REDACTED:23
  • Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — REDACTED:29

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports6.6 / 10Adequate✓ Tool-verified

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

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

  • web/src/api/recharge.ts → web/src/api/runtime.ts → web/src/api/recharge.ts — web/src/api/recharge.ts:1
  • REDACTED → web/src/user-console/runtime.tsx → REDACTED — REDACTED:7

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (`axum::serve(` (src/observability.rs:1405)), 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.

  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — src/server/handlers/user.rs:1783
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — examples/forwardauth-caddy/Caddyfile:4

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
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 branch8.0 / 10Strong✓ Tool-verified

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

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

  • `match self.key_store.get_research_request_affinity(request_id, now).await { O…` follows `{ return Ok(owner == token_id); }` (line 1250) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — src/tavily_proxy/proxy_affinity.rs:1254

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document2.3 / 10Critical✓ Tool-verified

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

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

  • `getMcpProbeResultError` is exported, takes a document from its caller (line 180) and hands it to `extractProbeErrorText`, which calls itself at line 169 (`extractProbeErrorText`) with a piece of `payload` — and nowhere in `extractProbeErrorText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `extractProbeErrorText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/src/lib/mcpProbe.ts:169
  • `getMcpProbeResultError` is exported, takes a document from its caller (line 180) and hands it to `extractProbeStatusCode`, which calls itself at line 177 (`extractProbeStatusCode`) with a piece of `payload` — and nowhere in `extractProbeStatusCode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `extractProbeStatusCode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/src/lib/mcpProbe.ts:177
  • `normalize_alert_group_record_for_projection` is public and takes `group: AlertGroupRecord` from its caller, and it calls itself at line 779 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `normalize_alert_group_record_for_projection` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/store/key_store_alert_event_projection.rs:779

What to do

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

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

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

  • `tx` (line 673) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 987; the `return` on line 869 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — REDACTED:673

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X2 · Cancellation propagation9.3 / 10Exemplary✓ Tool-verified

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

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

  • Only 14/16 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `deleteToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/api/tokens.ts:87
  • `setTokenEnabled` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/api/tokens.ts:92

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

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

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`. In Rust, where a guard or permit releases when it is dropped, whether a release written BY HAND — `add_permits` after a forgotten permit, `force_unlock` after a leaked guard, a raw lock's `unlock` — matches the state the function's own acquisitions put the primitive in: not after a try or timed acquire whose failure does not leave, not from a cleanup set up before an acquire that can fail, not skipped by a `?`, `return`, `break` or `continue`, and not on top of a guard that still releases itself.

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

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

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

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

X25 · Inert configuration knob6.7 / 10Strong✓ Tool-verified

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

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

  • `Cli.xray_binary` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/main.rs:81
  • `Cli.admin_auth_passkey_enabled` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `passkey_auth_enabled`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/main.rs:130
  • `Cli.admin_passkey_challenge_ttl_secs` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `passkey_challenge_ttl_secs`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/main.rs:142
  • `Cli.admin_passkey_session_max_age_secs` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `passkey_session_max_age_secs`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/main.rs:150
  • `AdminUserIpUsage.recent_ip_addresses_24h` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/models.rs:1092
  • `AdminUserIpUsage.recent_ip_addresses_7d` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/models.rs:1093
  • `RecentAlertsSummary.window_hours` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/models.rs:1248
  • `SystemSettingsUpdatePayload.rebalance_mcp_session_percent` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:724
  • `ReconciliationRunObservation.projection_state` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:75
  • `ReconciliationRunObservation.projection_scanned_rows` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:76
  • `ReconciliationRunObservation.projection_batch_size` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:77
  • `ReconciliationRunObservation.projection_transaction_p95_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:78
  • `ReconciliationRunObservation.last_transport_kind_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:104
  • `ReconciliationResearchProgressWindow.window_ended_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:119
  • `ReconciliationResearchProgressWindow.window_seconds` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:120
  • `ReconciliationResearchProgressWindow.terminal_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:121
  • `ReconciliationResearchProgressWindow.pending_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:122
  • `ReconciliationResearchProgressWindow.unavailable_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:124
  • `ReconciliationResearchProgressWindow.pollable_pending_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:126
  • `ReconciliationResearchProgressWindow.terminal_rate_positive` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:127
  • `ReconciliationResearchProgressWindow.poll_resolution_rate_positive` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:129
  • `ReconciliationResearchProgressWindow.pending_non_growing` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:130
  • `ReconciliationResearchPollDiagnostics.pollable_pending` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:138
  • `ReconciliationResearchPollDiagnostics.credentials_cooling_keys` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:139
  • `ReconciliationResearchPollDiagnostics.earliest_credentials_retry_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:140
  • `ReconciliationResearchPollDiagnostics.last_poll_outcome` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:141
  • `ReconciliationResearchPollDiagnostics.last_poll_observed_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:142
  • `ReconciliationResearchPollDiagnostics.remote_lease_waits` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:152
  • `ReconciliationResearchPollDiagnostics.remote_lease_wait_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:154
  • `ReconciliationResearchPollDiagnostics.longest_eligible_wait_secs` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:156
  • `ReconciliationControllerStatus.activation_period_code` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:163
  • `ReconciliationControllerStatus.paused_reason` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:166
  • `ReconciliationControllerStatus.transitioned_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src/upstream_privacy_status.rs:167

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging7.6 / 10Strong✓ Tool-verified

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

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

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

What to do

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

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

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

  • `env::var("CARGO_PKG_VERSION")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — build.rs:23
  • `env::var_os("OUT_DIR")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — build.rs:34
  • `file.strip_prefix(&dist_dir)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — build.rs:65, build.rs:76
  • `today.and_hms_opt(6,20,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `duration_until_next_local_daily_run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/backend_time.rs:195
  • `tomorrow.and_hms_opt(6,20,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `duration_until_next_local_daily_run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/backend_time.rs:214
  • `Utc.with_ymd_and_hms(now.year(),now.month(),1,0,0,0).single()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_month` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2307
  • `chrono::NaiveDate::from_ymd_opt(now.year(),now.month(),1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_local_month_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2312
  • `first_day.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_local_month_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2315
  • `chrono::NaiveDate::from_ymd_opt(year,month,1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `previous_local_month_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2333
  • `first_day.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `previous_local_month_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2336
  • `Utc.with_ymd_and_hms(year,month,1,0,0,0).single()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_next_month` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2357
  • `Utc.with_ymd_and_hms(year,month0+1,1,0,0,0).single()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `shift_month_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2370
  • `date.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_date_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2902
  • `now.date_naive().and_hms_opt(now.hour(),0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_local_hour_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:2928
  • `keep_from_date.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `configured_request_logs_retention_threshold_utc_ts_at` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/models.rs:3069
  • `self.gather()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `gather_test_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/observability.rs:1237
  • `String::from_utf8(self.gather().expect("gather test metrics"))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `gather_test_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/observability.rs:1237
  • `Metrics::new_with_recording(route_allowlist_from_env(),env_flag("OBSERVABILITY_ENABLED")&&observability_identity_is_valid(),)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `global_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/observability.rs:1297
  • `date.and_hms_opt(start_hour,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `business_period_for_local` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/upstream_privacy.rs:64
  • `end_date.and_hms_opt(normalized_end_hour,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `business_period_for_local` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/upstream_privacy.rs:78
  • `Url::parse(FORWARD_PROXY_TRACE_URL)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `default_forward_proxy_trace_url` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tavily_proxy/mod.rs:1166
  • `queue.pop_front()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `age_queue_into_buckets` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tavily_proxy/user_business_calls_memory.rs:413
  • `transaction.conn.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `begin` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — src/store/immediate_transaction.rs:26, src/store/immediate_transaction.rs:140
  • `self.conn.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `commit_connection` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×4) — src/store/immediate_transaction.rs:48, src/store/immediate_transaction.rs:52, src/store/immediate_transaction.rs:156, …
  • `self.conn.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `rollback_connection` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×5) — src/store/immediate_transaction.rs:64, src/store/immediate_transaction.rs:66, src/store/immediate_transaction.rs:173, …
  • `self.conn.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `deref` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — src/store/immediate_transaction.rs:97, src/store/immediate_transaction.rs:192
  • `self.conn.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `deref_mut` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — src/store/immediate_transaction.rs:106, src/store/immediate_transaction.rs:201
  • `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `list_access_tokens_filtered_paged` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/store/key_store_admin_tokens.rs:92
  • `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `list_access_tokens_for_filters` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/store/key_store_admin_tokens.rs:137

What to do

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

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

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

Reference — by lens

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

LensScoreRatingImpact
Code Health52.7Adequate — gated by D2, R10, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture76.5Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity88.1ExemplarySolid.
Readiness46.3Adequate — gated by P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security60.1Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100.0ExemplaryStrongest area.
Event-Driven78.7StrongSolid.
Accessibility60.3Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplarySolid.
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 — 35 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 — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 47 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • 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 — AX6 reached only 34% of this repository's production lines — rust (172,530 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.prometheus.volumes.[]: required variable HIKARI_OBSERVABILITY_FILE_SD_DIR is missing a value: Set HIKARI_OBSERVABILITY_FILE_SD_DIR to a deployment-owned file-SD directory; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 14 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D28 Secrets (history) — gitleaks killed before it finished — this repository's working tree not scanned
  • D32 Data Compliance (PII/GDPR) — 66 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM5 Encapsulated state — this Rust crate declares no type implementing a hand-rolled Hash/PartialEq, so DM5's value-identity encapsulation read has no population to be taken over
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • 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 — sqlx is declared, but this repository defines no table or model of its own, so there is no database schema here for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 219 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R5 Dependency Freshness — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X24 Document value interpolated into markup unescaped — X24 reached only 34% of this repository's production lines — rust (172,530 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 34% of this repository's production lines — rust (172,530 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

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 — 204 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
  • + 56 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×47
  • 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
  • + 22 more in this group — see findings.md.
ED1 · Handler temporal coupling · Blocking call on the event loop · ×20
  • Blocking call on the event loop: mcp_request_log_retry_repair.main calls `std::fs::create_dir_all` src/bin/mcp_request_log_retry_repair.rs:393 — `mcp_request_log_retry_repair.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: mcp_search_billing_repair.main calls `std::fs::create_dir_all` src/bin/mcp_search_billing_repair.rs:490 — `mcp_search_billing_repair.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: mcp_session_delete_neutral_repair.main calls `std::fs::create_dir_all` src/bin/mcp_session_delete_neutral_repair.rs:1064 — `mcp_session_delete_neutral_repair.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: sqlite_sidecar.legacy_request_logs_inline_sidecar_migration_allowed calls `std::fs::metadata` src/bin/support/sqlite_sidecar.rs:170 — `sqlite_sidecar.legacy_request_logs_inline_sidecar_migration_allowed` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: ReservedLocalPort.bind calls `TcpListener::bind` src/forward_proxy/relay_and_xray.rs:489 — `ReservedLocalPort.bind` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `TcpListener::bind`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: src.main calls `std::fs::create_dir_all` src/main.rs:437 — `src.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: observability.start_exporter calls `std::fs::read_to_string` src/observability.rs:1360 — `observability.start_exporter` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_logging.read_process_status calls `std::fs::read_to_string` src/runtime_logging.rs:182 — `runtime_logging.read_process_status` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_logging.sum_child_rss_bytes calls `std::fs::read_to_string` src/runtime_logging.rs:210 — `runtime_logging.sum_child_rss_bytes` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_logging.read_relative_cgroup_path calls `std::fs::read_to_string` src/runtime_logging.rs:276 — `runtime_logging.read_relative_cgroup_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_logging.read_u64_from_file calls `std::fs::read_to_string` src/runtime_logging.rs:291 — `runtime_logging.read_u64_from_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_logging.read_memory_limit_from_file calls `std::fs::read_to_string` src/runtime_logging.rs:299 — `runtime_logging.read_memory_limit_from_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: KeyStore.sqlite_db_stats calls `std::fs::metadata` src/store/key_store_jobs.rs:291 — `KeyStore.sqlite_db_stats` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: KeyStore.sqlite_db_stats calls `std::fs::metadata` src/store/key_store_jobs.rs:294 — `KeyStore.sqlite_db_stats` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: KeyStore.sqlite_db_stats calls `std::fs::metadata` src/store/key_store_jobs.rs:301 — `KeyStore.sqlite_db_stats` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: KeyStore.sqlite_db_stats calls `std::fs::metadata` src/store/key_store_jobs.rs:306 — `KeyStore.sqlite_db_stats` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: KeyStore.run_observability_sidecar_migrate calls `std::fs::metadata` REDACTED:1818 — `KeyStore.run_observability_sidecar_migrate` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: KeyStore.run_observability_sidecar_migrate calls `std::fs::metadata` REDACTED:2053 — `KeyStore.run_observability_sidecar_migrate` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: store.legacy_request_logs_inline_sidecar_migration_allowed calls `std::fs::metadata` src/store/mod.rs:1106 — `store.legacy_request_logs_inline_sidecar_migration_allowed` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: store.core_database_file_size calls `std::fs::metadata` src/store/mod.rs:1118 — `store.core_database_file_size` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Flaky test · ×5
  • Flaky test: web/::src/admin/AdminDashboardRuntime.route-switch.test.tsx AdminDashboard route switches keeps admin runtime stable when switching rankings analysis alias preserves alias path and demo params — Passed 2×, failed 1× across repeated runs.
  • Flaky test: web/::src/admin/AdminDashboardRuntime.route-switch.test.tsx AdminDashboard route switches keeps admin runtime stable when switching tokens overview -> token detail — Passed 2×, failed 1× across repeated runs.
  • Flaky test: web/::src/admin/AdminDashboardRuntime.route-switch.test.tsx AdminDashboard route switches keeps admin runtime stable when switching users overview -> user tag editor — Passed 2×, failed 1× across repeated runs.
  • Flaky test: web/::src/admin/AdminDashboardRuntime.route-switch.test.tsx AdminDashboard route switches keeps admin runtime stable when switching users overview -> user tags — Passed 2×, failed 1× across repeated runs.
  • Flaky test: web/::src/admin/AdminDashboardRuntime.route-switch.test.tsx AdminDashboard route switches updates dashboard recent alerts from the shared SSE snapshot — Passed 2×, failed 1× across repeated runs.
AC2 · Forms & labels · <label> that labels no control · ×4
  • <label> that labels no control web/src/components/CherryStudioMock.tsx:144 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/CherryStudioMock.tsx:177 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/ConnectivityChecksPanel.tsx:210 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/ManualCopyBubble.tsx:127 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×4
  • Hover-only interaction on <div> web/src/admin/AdminDashboardRuntime.tsx:10391 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> web/src/admin/AdminDashboardRuntime.tsx:10457 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> web/src/admin/ForwardProxySettingsModule.tsx:1205 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> web/src/admin/ForwardProxySettingsModule.tsx:1287 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×2
  • <input> without a programmatic label web/src/components/CherryStudioMock.tsx:148 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/src/components/CherryStudioMock.tsx:180 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC5 · ARIA correctness · aria-hidden hides a focusable element · ×2
  • aria-hidden hides a focusable element web/src/components/MarkdownEditor.storybook.tsx:41 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/MarkdownEditor.storybook.tsx:47 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: gc_recovery_load.py ↔ key_store_dashboard_rollup_integrity.rs scripts/gc_recovery_load.py:1 — `scripts/gc_recovery_load.py` (context scripts) and `src/store/key_store_dashboard_rollup_integrity.rs` (context store) sit in DIFFERENT parts of the tree yet change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `b67f65c3` fix(recovery): close bounded GC integrity gaps; `8d004fb1` fix(recovery): harden resumable target recovery; `0cc854c3` feat(recovery): add bounded request statistics recovery — run `git show` on any of them.
  • Boundary-crossing change coupling: public.rs ↔ key_store_request_logs_summary_windows.rs src/server/handlers/public.rs:1 — `src/server/handlers/public.rs` (context handlers) and `src/store/key_store_request_logs_summary_windows.rs` (context store) sit in DIFFERENT parts of the tree yet change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `b568d761` feat(admin): add credit trend charts; `e327d67a` fix(admin): preserve stale stats snapshot boundaries; `541d1f39` fix(admin): decouple dashboard quota and alerts hot paths — run `git show` on any of them.
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) web/src/api/recharge.ts:1 — web/src/api/recharge.ts → web/src/api/runtime.ts → web/src/api/recharge.ts
  • Import cycle (2 files) REDACTED:7 — REDACTED → web/src/user-console/runtime.tsx → REDACTED
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label web/src/admin/SystemSettingsModule.tsx:816 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Focusable <path> isn't keyboard-operable · ×1
  • Focusable <path> isn't keyboard-operable web/src/admin/ForwardProxySettingsModule.tsx:810 — This <path> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC5 · ARIA correctness · Invalid ARIA role "text" · ×1
  • Invalid ARIA role "text" web/src/components/RollingNumber.tsx:273 — This role is not a valid WAI-ARIA role, so assistive tech ignores it. Use a valid role (or the native element).
D13 · Secret Scanning · Leaked secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '@rspress/runtime' · ×1
  • Unlisted import '@rspress/runtime' docs-site/theme/index.tsx:1 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Serious — 1865 finding(s)
D3 · God Classes · FunctionTooLong · ×139
  • FunctionTooLong: AdminDashboardRuntime.AdminDashboard web/src/admin/AdminDashboardRuntime.tsx:1757 — FunctionTooLong — AdminDashboard runs 9161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9061 over it, 91.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.
  • FunctionTooLong: runtime.UserConsole web/src/user-console/runtime.tsx:1222 — FunctionTooLong — UserConsole runs 1785 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1685 over it, 17.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler src/server/proxy/proxy_handlers_and_views.rs:1 — FunctionTooLong — tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler runs 1487 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 1387 over it, 14.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SystemSettingsModule.SystemSettingsModule web/src/admin/SystemSettingsModule.tsx:282 — FunctionTooLong — SystemSettingsModule runs 1127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1027 over it, 11.27× 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: ForwardProxySettingsModule.ForwardProxySettingsModule web/src/admin/ForwardProxySettingsModule.tsx:1780 — FunctionTooLong — ForwardProxySettingsModule runs 1042 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 942 over it, 10.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: TokenDetail.TokenDetail web/src/pages/TokenDetail.tsx:405 — FunctionTooLong — TokenDetail runs 964 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 864 over it, 9.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AlertsCenter.AlertsCenter web/src/admin/AlertsCenter.tsx:460 — FunctionTooLong — AlertsCenter runs 937 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 837 over it, 9.37× 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: AdminDashboardRuntime.KeyDetails web/src/admin/AdminDashboardRuntime.tsx:12901 — FunctionTooLong — KeyDetails runs 770 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 670 over it, 7.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule web/src/admin/UpstreamPrivacyStatusModule.tsx:189 — FunctionTooLong — UpstreamPrivacyStatusModule runs 758 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 658 over it, 7.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: PublicHome.PublicHome web/src/PublicHome.tsx:110 — FunctionTooLong — PublicHome runs 749 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 649 over it, 7.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.
  • FunctionTooLong: tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint src/server/handlers/tavily.rs:706 — FunctionTooLong — tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint runs 734 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 634 over it, 7.34× 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: AdminRecentRequestsPanel.AdminRecentRequestsPanel web/src/components/AdminRecentRequestsPanel.tsx:741 — FunctionTooLong — AdminRecentRequestsPanel runs 622 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 522 over it, 6.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: UserDetailSharedUsagePanel.UserDetailSharedUsagePanel web/src/admin/UserDetailSharedUsagePanel.tsx:296 — FunctionTooLong — UserDetailSharedUsagePanel runs 589 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 489 over it, 5.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: AdminSecuritySettingsModule.AdminSecuritySettingsModule web/src/admin/AdminSecuritySettingsModule.tsx:167 — FunctionTooLong — AdminSecuritySettingsModule runs 571 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 471 over it, 5.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: DashboardOverview.DashboardOverview web/src/admin/DashboardOverview.tsx:546 — FunctionTooLong — DashboardOverview runs 565 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 465 over it, 5.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: tavily_hikari::server::serve::serve src/server/serve.rs:2 — FunctionTooLong — tavily_hikari::server::serve::serve runs 560 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 460 over it, 5.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: AdminPagesStoryRuntime.KeysPageCanvas web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3836 — FunctionTooLong — KeysPageCanvas runs 547 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 447 over it, 5.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ApiKeysValidationDialog.ApiKeysValidationDialog web/src/components/ApiKeysValidationDialog.tsx:310 — FunctionTooLong — ApiKeysValidationDialog runs 501 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 401 over it, 5.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: BillingPage.BillingPage web/src/user-console/BillingPage.tsx:428 — FunctionTooLong — BillingPage runs 494 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 394 over it, 4.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: tavily_hikari::server::handlers::admin_resources::ha::post_admin_ha_planned_cutover src/server/handlers/admin_resources/ha.rs:1810 — FunctionTooLong — tavily_hikari::server::handlers::admin_resources::ha::post_admin_ha_planned_cutover runs 456 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 356 over it, 4.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: tavily_hikari::server::handlers::admin_resources::user_tag_and_token_handlers::list_users src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:155 — FunctionTooLong — tavily_hikari::server::handlers::admin_resources::user_tag_and_token_handlers::list_users runs 396 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 296 over it, 3.96× 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: AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5280 — FunctionTooLong — UnboundTokenUsagePageCanvas runs 373 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 273 over it, 3.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: DashboardTrendPanel.DashboardTrendPanel web/src/admin/DashboardTrendPanel.tsx:221 — FunctionTooLong — DashboardTrendPanel runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: tavily_hikari::server::proxy::rebalance_handlers::handle_rebalance_mcp_single_message src/server/proxy/rebalance_handlers.rs:2 — FunctionTooLong — tavily_hikari::server::proxy::rebalance_handlers::handle_rebalance_mcp_single_message runs 358 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 258 over it, 3.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: demo.demoRecentAlerts REDACTED:1219 — FunctionTooLong — demoRecentAlerts runs 354 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 254 over it, 3.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.
  • + 114 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×126
  • MethodTooLong: TavilyProxy.run_upstream_reconciliation_once_inner src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719 — MethodTooLong — run_upstream_reconciliation_once_inner runs 1339 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 1239 over it, 13.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: KeyStore.upstream_privacy_status_from_snapshot src/store/key_store_admin_privacy_read.rs:165 — MethodTooLong — upstream_privacy_status_from_snapshot runs 598 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 498 over it, 5.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.gc_ha_outbox_online_with_options src/store/key_store_ha_gc_online.rs:300 — MethodTooLong — gc_ha_outbox_online_with_options runs 512 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 412 over it, 5.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.push_alert_grouping_cte_tail src/store/key_store_alerts.rs:1395 — MethodTooLong — push_alert_grouping_cte_tail runs 414 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 314 over it, 4.14× 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: KeyStore.rebuild_account_usage_rollup_buckets_v1 src/store/key_store_account_usage_rollups.rs:372 — MethodTooLong — rebuild_account_usage_rollup_buckets_v1 runs 408 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 308 over it, 4.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.reclaim_admin_alert_canonical_groups_generations src/store/key_store_alert_canonical_groups.rs:1374 — MethodTooLong — reclaim_admin_alert_canonical_groups_generations runs 392 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 292 over it, 3.92× 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: KeyStore.process_dashboard_rollup_integrity_work_item_inner src/store/key_store_dashboard_rollup_integrity.rs:1571 — MethodTooLong — process_dashboard_rollup_integrity_work_item_inner runs 388 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 288 over it, 3.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.
  • MethodTooLong: KeyStore.apply_pending_billing_log_once src/store/key_store_users_and_oauth.rs:1954 — MethodTooLong — apply_pending_billing_log_once runs 335 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 235 over it, 3.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.
  • MethodTooLong: ReconciliationProjectionController.advance_slice_inner src/store/reconciliation_projection_controller.rs:164 — MethodTooLong — advance_slice_inner runs 333 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 233 over it, 3.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.rebuild_request_logs_table_with_foreign_keys_disabled src/store/key_store_migrations_b.rs:30 — MethodTooLong — rebuild_request_logs_table_with_foreign_keys_disabled runs 317 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 217 over it, 3.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.
  • MethodTooLong: KeyStore.validate_convergence_schema_migration_objects src/store/key_store_schema_migrations_convergence.rs:324 — MethodTooLong — validate_convergence_schema_migration_objects runs 313 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 213 over it, 3.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.validate_applied_migration_objects src/store/key_store_schema_migrations.rs:914 — MethodTooLong — validate_applied_migration_objects runs 312 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 212 over it, 3.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TavilyProxy.run_research_terminal_sweep src/tavily_proxy/proxy_quota_sync_and_jobs.rs:224 — MethodTooLong — run_research_terminal_sweep runs 300 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 200 over it, 3.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: KeyStore.fetch_request_logs_page src/store/key_store_request_logs_and_dashboard.rs:1548 — MethodTooLong — fetch_request_logs_page runs 274 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 174 over it, 2.74× 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: KeyStore.alert_projection_source_keys src/store/key_store_alert_projection.rs:281 — MethodTooLong — alert_projection_source_keys runs 271 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 171 over it, 2.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.push_alert_events_cte_for_selected_source src/store/key_store_alert_events_cte.rs:198 — MethodTooLong — push_alert_events_cte_for_selected_source runs 268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.validate_schema_baseline src/store/key_store_schema_migrations.rs:280 — MethodTooLong — validate_schema_baseline runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.next_upstream_reconciliation_research_candidates src/store/key_store_upstream_reconciliation_research.rs:99 — MethodTooLong — next_upstream_reconciliation_research_candidates runs 264 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 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TavilyProxy.proxy_http_json_endpoint src/tavily_proxy/proxy_http_and_logs.rs:356 — MethodTooLong — proxy_http_json_endpoint runs 259 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 159 over it, 2.59× 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: KeyStore.rebuild_dashboard_request_rollup_buckets_window REDACTED:667 — MethodTooLong — rebuild_dashboard_request_rollup_buckets_window runs 257 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 157 over it, 2.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.
  • MethodTooLong: TavilyProxy.proxy_http_research src/tavily_proxy/proxy_http_and_logs.rs:1288 — MethodTooLong — proxy_http_research runs 254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TavilyProxy.run_upstream_reconciliation_research_drain_claimed_with_turn src/tavily_proxy/reconciliation_research_drain.rs:220 — MethodTooLong — run_upstream_reconciliation_research_drain_claimed_with_turn runs 253 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.list_admin_users_sorted_paged src/store/key_store_admin_user_listing.rs:3 — MethodTooLong — list_admin_users_sorted_paged runs 251 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 151 over it, 2.51× 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: TavilyProxy.validate_forward_proxy_subscription_with_progress src/tavily_proxy/proxy_core.rs:2497 — MethodTooLong — validate_forward_proxy_subscription_with_progress runs 247 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 147 over it, 2.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KeyStore.fetch_request_logs_cursor_page src/store/key_store_request_logs_and_dashboard.rs:1261 — MethodTooLong — fetch_request_logs_cursor_page runs 246 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 101 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×106
  • FileTooLong: admin/AdminDashboardRuntime.tsx web/src/admin/AdminDashboardRuntime.tsx — FileTooLong — 11553 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: AdminDashboard (1757-12677). The bar is 500 significant lines; this is 11053 over it, 23.11× 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: storySupport/AdminPagesStoryRuntime.tsx web/src/admin/storySupport/AdminPagesStoryRuntime.tsx — FileTooLong — 6618 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6118 over it, 13.24× 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: store/sqlite_runtime.rs src/store/sqlite_runtime.rs — FileTooLong — 3187 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 2687 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: api/runtime.ts web/src/api/runtime.ts — FileTooLong — 3104 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2604 over it, 6.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/key_store_dashboard_rollup_integrity.rs src/store/key_store_dashboard_rollup_integrity.rs — FileTooLong — 2814 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: KeyStore (143-3460). The bar is 500 significant lines; this is 2314 over it, 5.63× 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: user-console/runtime.tsx web/src/user-console/runtime.tsx — FileTooLong — 2727 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: UserConsole (1222-3358). The bar is 500 significant lines; this is 2227 over it, 5.45× 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 — 2709 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 2209 over it, 5.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tavily_proxy/proxy_quota_sync_and_jobs.rs src/tavily_proxy/proxy_quota_sync_and_jobs.rs — FileTooLong — 2538 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: TavilyProxy (10-3239). The bar is 500 significant lines; this is 2038 over it, 5.08× 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: store/key_store_sessions.rs src/store/key_store_sessions.rs — FileTooLong — 2517 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: KeyStore (1-3085). The bar is 500 significant lines; this is 2017 over it, 5.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: store/key_store_bootstrap.rs src/store/key_store_bootstrap.rs — FileTooLong — 2512 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 2012 over it, 5.02× 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: store/key_store_upstream_reconciliation.rs src/store/key_store_upstream_reconciliation.rs — FileTooLong — 2466 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: KeyStore (147-3039). The bar is 500 significant lines; this is 1966 over it, 4.93× 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: admin/ForwardProxySettingsModule.tsx web/src/admin/ForwardProxySettingsModule.tsx — FileTooLong — 2462 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1962 over it, 4.92× 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: store/key_store_alerts.rs src/store/key_store_alerts.rs — FileTooLong — 2443 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: KeyStore (760-2944). The bar is 500 significant lines; this is 1943 over it, 4.89× 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: store/key_store_keys.rs src/store/key_store_keys.rs — FileTooLong — 2367 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: KeyStore (7-2944). The bar is 500 significant lines; this is 1867 over it, 4.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: store/key_store_schema_migrations.rs src/store/key_store_schema_migrations.rs — FileTooLong — 2359 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: KeyStore (132-3046). The bar is 500 significant lines; this is 1859 over it, 4.72× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: store/key_store_token_logs.rs src/store/key_store_token_logs.rs — FileTooLong — 2325 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: KeyStore (45-2810). The bar is 500 significant lines; this is 1825 over it, 4.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/lib.rs src/lib.rs — FileTooLong — 2314 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 1814 over it, 4.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: handlers/user.rs src/server/handlers/user.rs — FileTooLong — 2262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 1762 over it, 4.52× 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: store/key_store_alert_canonical_groups.rs src/store/key_store_alert_canonical_groups.rs — FileTooLong — 2249 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: KeyStore (158-2671). The bar is 500 significant lines; this is 1749 over it, 4.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2224 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: KeyStore (2-2782). The bar is 500 significant lines; this is 1724 over it, 4.45× 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: store/key_store_request_logs_and_dashboard.rs src/store/key_store_request_logs_and_dashboard.rs — FileTooLong — 2195 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: KeyStore (37-2782). The bar is 500 significant lines; this is 1695 over it, 4.39× 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: server/schedulers.rs src/server/schedulers.rs — FileTooLong — 2178 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 1678 over it, 4.36× 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: store/mod.rs src/store/mod.rs — FileTooLong — 2163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 82 free functions. The bar is 500 significant lines; this is 1663 over it, 4.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2143 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1643 over it, 4.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: server/dto.rs src/server/dto.rs — FileTooLong — 2086 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 1586 over it, 4.17× 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.
  • + 81 more in this group — see findings.md.
D2 · Cognitive Complexity · tavily_hikari · ×65
  • tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler (cognitive 573) src/server/proxy/proxy_handlers_and_views.rs:1 — tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler has cognitive complexity 573 (threshold 15). Drivers by points: if/else 171 (466 pts), match/switch 18 (56 pts), boolean chains 41, loops 2 (10 pts) (nesting depth added 341). 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.
  • tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint (cognitive 148) src/server/handlers/tavily.rs:706 — tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint has cognitive complexity 148 (threshold 15). Drivers by points: if/else 52 (104 pts), match/switch 13 (36 pts), boolean chains 8 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::run_request_statistics_recovery_once_with_time (cognitive 88) src/lib.rs:771 — tavily_hikari::run_request_statistics_recovery_once_with_time has cognitive complexity 88 (threshold 15). Drivers by points: if/else 22 (52 pts), match/switch 12 (26 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::state::prewarm_admin_alerts (cognitive 62) src/server/state.rs:756 — tavily_hikari::server::state::prewarm_admin_alerts has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 7, match/switch 2 (4 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_api_key_bulk_actions (cognitive 59) src/server/handlers/admin_resources/api_keys_and_logs.rs:420 — tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_api_key_bulk_actions has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 12 (27 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::handlers::admin_resources::user_tag_and_token_handlers::list_users (cognitive 53) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:155 — tavily_hikari::server::handlers::admin_resources::user_tag_and_token_handlers::list_users has cognitive complexity 53 (threshold 15). Drivers by points: if/else 30 (40 pts), boolean chains 12, 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.
  • tavily_hikari::server::handlers::public::refresh_dashboard_overview_snapshot_with_reason (cognitive 53) src/server/handlers/public.rs:2210 — tavily_hikari::server::handlers::public::refresh_dashboard_overview_snapshot_with_reason has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (45 pts), match/switch 2 (6 pts), boolean chains 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.
  • tavily_hikari::store::backfill_request_log_request_kinds_with_pool (cognitive 53) src/store/mod.rs:2049 — tavily_hikari::store::backfill_request_log_request_kinds_with_pool has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 3 (13 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (tavily_hikari::store::backfill_auth_token_log_request_kinds_with_pool) 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.
  • tavily_hikari::store::backfill_auth_token_log_request_kinds_with_pool (cognitive 53) src/store/mod.rs:2224 — tavily_hikari::store::backfill_auth_token_log_request_kinds_with_pool has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 3 (13 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (tavily_hikari::store::backfill_request_log_request_kinds_with_pool) 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.
  • tavily_hikari::server::handlers::admin_resources::ha::refresh_admin_ha_status_live (cognitive 45) src/server/handlers/admin_resources/ha.rs:494 — tavily_hikari::server::handlers::admin_resources::ha::refresh_admin_ha_status_live has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::handlers::admin_resources::ha::post_admin_ha_planned_cutover (cognitive 43) src/server/handlers/admin_resources/ha.rs:1810 — tavily_hikari::server::handlers::admin_resources::ha::post_admin_ha_planned_cutover has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (27 pts), match/switch 5 (11 pts), boolean chains 3, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::handlers::tavily::tavily_http_research_result (cognitive 42) src/server/handlers/tavily.rs:381 — tavily_hikari::server::handlers::tavily::tavily_http_research_result has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (33 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::schedulers::run_manual_claimed_job (cognitive 39) src/server/schedulers.rs:2444 — tavily_hikari::server::schedulers::run_manual_claimed_job has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 11 (23 pts), if/else 10 (13 pts), boolean chains 3 (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • tavily_hikari::server::schedulers_reconciliation_research_drain::select_next_scheduled_candidate (cognitive 39) src/server/schedulers_reconciliation_research_drain.rs:16 — tavily_hikari::server::schedulers_reconciliation_research_drain::select_next_scheduled_candidate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 4 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::resolve_registration_regions_with_remote_attempt_admission (cognitive 36) src/lib.rs:2800 — tavily_hikari::resolve_registration_regions_with_remote_attempt_admission has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 5 (13 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::serve::run_ha_sync_once_for_peer (cognitive 32) src/server/serve.rs:1413 — tavily_hikari::server::serve::run_ha_sync_once_for_peer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::schedulers::run_linuxdo_user_status_sync_claimed_job (cognitive 31) src/server/schedulers.rs:1535 — tavily_hikari::server::schedulers::run_linuxdo_user_status_sync_claimed_job has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::store::key_store_alert_event_projection::redact_sensitive_labeled_values (cognitive 31) src/store/key_store_alert_event_projection.rs:148 — tavily_hikari::store::key_store_alert_event_projection::redact_sensitive_labeled_values has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::models::audit_business_quota_ledger_with_pool (cognitive 30) src/models.rs:2669 — tavily_hikari::models::audit_business_quota_ledger_with_pool has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 12, match/switch 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.
  • tavily_hikari::store::key_store_alert_event_projection::bound_alert_event_record_for_projection (cognitive 30) src/store/key_store_alert_event_projection.rs:599 — tavily_hikari::store::key_store_alert_event_projection::bound_alert_event_record_for_projection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 4 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::analysis::classify_failure_kind (cognitive 28) src/analysis.rs:214 — tavily_hikari::analysis::classify_failure_kind has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, boolean chains 13. 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.
  • tavily_hikari::forward_proxy::responses_and_validation::build_stream_settings_from_url (cognitive 28) src/forward_proxy/responses_and_validation.rs:1621 — tavily_hikari::forward_proxy::responses_and_validation::build_stream_settings_from_url has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::handlers::public::load_dashboard_overview_snapshot (cognitive 27) src/server/handlers/public.rs:1965 — tavily_hikari::server::handlers::public::load_dashboard_overview_snapshot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, 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.
  • tavily_hikari::models::resolve_client_ip_info (cognitive 25) src/models.rs:310 — tavily_hikari::models::resolve_client_ip_info has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (9 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_validate_api_keys (cognitive 25) src/server/handlers/admin_resources/api_keys_and_logs.rs:1 — tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_validate_api_keys has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 40 more in this group — see findings.md.
D2 · Cognitive Complexity · KeyStore · ×48
  • KeyStore::ensure_user_token_binding_with_preferred (cognitive 82) src/store/key_store_users_and_oauth.rs:737 — KeyStore::ensure_user_token_binding_with_preferred has cognitive complexity 82 (threshold 15). Drivers by points: if/else 15 (55 pts), match/switch 7 (21 pts), loops 3 (5 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.
  • KeyStore::initialize_schema (cognitive 79) src/store/key_store_bootstrap.rs:928 — KeyStore::initialize_schema has cognitive complexity 79 (threshold 15). Drivers by points: if/else 52 (64 pts), boolean chains 10, loops 3, match/switch 1 (2 pts) (nesting depth added 13). 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.
  • KeyStore::gc_ha_outbox_online_with_options (cognitive 70) src/store/key_store_ha_gc_online.rs:300 — KeyStore::gc_ha_outbox_online_with_options has cognitive complexity 70 (threshold 15). Drivers by points: if/else 40 (50 pts), boolean chains 10, match/switch 5 (9 pts), loops 1 (nesting depth added 14). 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.
  • KeyStore::read_admin_alert_canonical_group_payload_chunks (cognitive 65) src/store/key_store_alert_canonical_groups.rs:2331 — KeyStore::read_admin_alert_canonical_group_payload_chunks has cognitive complexity 65 (threshold 15). Drivers by points: if/else 26 (50 pts), boolean chains 10, loops 2 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::stream_admin_alert_canonical_semantic_output (cognitive 58) src/store/key_store_alert_canonical_semantic_reduction.rs:830 — KeyStore::stream_admin_alert_canonical_semantic_output has cognitive complexity 58 (threshold 15). Drivers by points: if/else 26 (55 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::process_dashboard_rollup_integrity_work_item_inner (cognitive 56) src/store/key_store_dashboard_rollup_integrity.rs:1571 — KeyStore::process_dashboard_rollup_integrity_work_item_inner has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (39 pts), match/switch 8 (10 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • KeyStore::validate_applied_migration_objects (cognitive 54) src/store/key_store_schema_migrations.rs:914 — KeyStore::validate_applied_migration_objects has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 33, if/else 21. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • KeyStore::validate_convergence_schema_migration_objects (cognitive 54) src/store/key_store_schema_migrations_convergence.rs:324 — KeyStore::validate_convergence_schema_migration_objects has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 27, if/else 19 (23 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • KeyStore::delete_old_request_logs_bounded_with_deadline_scoped (cognitive 44) src/store/key_store_request_logs_gc.rs:1159 — KeyStore::delete_old_request_logs_bounded_with_deadline_scoped has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 5 (13 pts), boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::rebuild_dashboard_request_rollup_buckets_window (cognitive 43) REDACTED:667 — KeyStore::rebuild_dashboard_request_rollup_buckets_window has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (36 pts), loops 3 (6 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.
  • KeyStore::clear_request_log_body_batch (cognitive 42) src/store/key_store_request_logs_gc.rs:900 — KeyStore::clear_request_log_body_batch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (6 pts), boolean chains 5, match/switch 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::prepare_versioned_schema (cognitive 40) src/store/key_store_schema_migrations.rs:2730 — KeyStore::prepare_versioned_schema has cognitive complexity 40 (threshold 15). Drivers by points: if/else 38 (39 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • KeyStore::create_next_dashboard_rollup_integrity_work_item (cognitive 32) src/store/key_store_dashboard_rollup_integrity.rs:1218 — KeyStore::create_next_dashboard_rollup_integrity_work_item has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 9, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • KeyStore::run_observability_sidecar_migrate (cognitive 32) REDACTED:1786 — KeyStore::run_observability_sidecar_migrate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 11 (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.
  • KeyStore::push_request_logs_filters (cognitive 32) src/store/key_store_request_logs_and_dashboard.rs:477 — KeyStore::push_request_logs_filters has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24 (32 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.
  • KeyStore::ha_peer_channel_health (cognitive 30) REDACTED:333 — KeyStore::ha_peer_channel_health has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 10 (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.
  • KeyStore::gc_ha_outbox_with_options (cognitive 30) REDACTED:3043 — KeyStore::gc_ha_outbox_with_options has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::dashboard_rollup_integrity_request_log_gc_decision_for_day_inner (cognitive 29) src/store/key_store_dashboard_rollup_integrity.rs:3158 — KeyStore::dashboard_rollup_integrity_request_log_gc_decision_for_day_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), match/switch 5 (6 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • KeyStore::fetch_dashboard_quota_recovery_round (cognitive 27) src/store/key_store_dashboard_quota_recovery.rs:293 — KeyStore::fetch_dashboard_quota_recovery_round has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::add_or_undelete_key_with_status_in_group_once (cognitive 27) src/store/key_store_token_logs.rs:1690 — KeyStore::add_or_undelete_key_with_status_in_group_once has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::upsert_oauth_account_with_options (cognitive 27) src/store/key_store_users_and_oauth.rs:125 — KeyStore::upsert_oauth_account_with_options has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (7 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::rebuild_server_pressure_buckets_with_cancel (cognitive 26) src/store/key_store_analysis_pressure.rs:218 — KeyStore::rebuild_server_pressure_buckets_with_cancel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::fetch_dashboard_quota_charge_read_model_internal (cognitive 26) src/store/key_store_dashboard_quota_recovery.rs:183 — KeyStore::fetch_dashboard_quota_charge_read_model_internal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KeyStore::request_logs_exist_for_filters (cognitive 26) src/store/key_store_request_logs_and_dashboard.rs:805 — KeyStore::request_logs_exist_for_filters has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (26 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.
  • KeyStore::upstream_privacy_status_from_snapshot (cognitive 25) src/store/key_store_admin_privacy_read.rs:165 — KeyStore::upstream_privacy_status_from_snapshot has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, loops 6, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 23 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded build.rs:23 — `env::var("CARGO_PKG_VERSION")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded build.rs:34 — `env::var_os("OUT_DIR")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded build.rs:65 — `file.strip_prefix(&dist_dir)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded build.rs:76 — `file.strip_prefix(&dist_dir)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/backend_time.rs:195 — `today.and_hms_opt(6,20,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `duration_until_next_local_daily_run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/backend_time.rs:214 — `tomorrow.and_hms_opt(6,20,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `duration_until_next_local_daily_run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2307 — `Utc.with_ymd_and_hms(now.year(),now.month(),1,0,0,0).single()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_month` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2312 — `chrono::NaiveDate::from_ymd_opt(now.year(),now.month(),1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_local_month_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2315 — `first_day.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_local_month_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2333 — `chrono::NaiveDate::from_ymd_opt(year,month,1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `previous_local_month_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2336 — `first_day.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `previous_local_month_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2357 — `Utc.with_ymd_and_hms(year,month,1,0,0,0).single()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_next_month` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2370 — `Utc.with_ymd_and_hms(year,month0+1,1,0,0,0).single()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `shift_month_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2902 — `date.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `local_date_start_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:2928 — `now.date_naive().and_hms_opt(now.hour(),0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `start_of_local_hour_utc_ts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/models.rs:3069 — `keep_from_date.and_hms_opt(0,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `configured_request_logs_retention_threshold_utc_ts_at` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/observability.rs:1237 — `self.gather()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `gather_test_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/observability.rs:1237 — `String::from_utf8(self.gather().expect("gather test metrics"))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `gather_test_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/observability.rs:1297 — `Metrics::new_with_recording(route_allowlist_from_env(),env_flag("OBSERVABILITY_ENABLED")&&observability_identity_is_valid(),)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `global_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/upstream_privacy.rs:64 — `date.and_hms_opt(start_hour,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `business_period_for_local` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/upstream_privacy.rs:78 — `end_date.and_hms_opt(normalized_end_hour,0,0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `business_period_for_local` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tavily_proxy/mod.rs:1166 — `Url::parse(FORWARD_PROXY_TRACE_URL)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `default_forward_proxy_trace_url` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tavily_proxy/user_business_calls_memory.rs:413 — `queue.pop_front()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `age_queue_into_buckets` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/store/immediate_transaction.rs:26 — `transaction.conn.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `begin` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/store/immediate_transaction.rs:48 — `self.conn.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `commit_connection` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • + 15 more in this group — see findings.md.
D1 · Cyclomatic Complexity · KeyStore · ×34
  • KeyStore::initialize_schema (cyclomatic 68) src/store/key_store_bootstrap.rs:928 — KeyStore::initialize_schema has cyclomatic complexity 68 (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.
  • KeyStore::validate_applied_migration_objects (cyclomatic 55) src/store/key_store_schema_migrations.rs:914 — KeyStore::validate_applied_migration_objects has cyclomatic complexity 55 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • KeyStore::gc_ha_outbox_online_with_options (cyclomatic 49) src/store/key_store_ha_gc_online.rs:300 — KeyStore::gc_ha_outbox_online_with_options has cyclomatic complexity 49 (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.
  • KeyStore::validate_convergence_schema_migration_objects (cyclomatic 49) src/store/key_store_schema_migrations_convergence.rs:324 — KeyStore::validate_convergence_schema_migration_objects has cyclomatic complexity 49 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • KeyStore::process_dashboard_rollup_integrity_work_item_inner (cyclomatic 46) src/store/key_store_dashboard_rollup_integrity.rs:1571 — KeyStore::process_dashboard_rollup_integrity_work_item_inner has cyclomatic complexity 46 (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.
  • KeyStore::prepare_versioned_schema (cyclomatic 39) src/store/key_store_schema_migrations.rs:2730 — KeyStore::prepare_versioned_schema has cyclomatic complexity 39 (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.
  • KeyStore::ensure_user_token_binding_with_preferred (cyclomatic 34) src/store/key_store_users_and_oauth.rs:737 — KeyStore::ensure_user_token_binding_with_preferred has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • KeyStore::read_admin_alert_canonical_group_payload_chunks (cyclomatic 33) src/store/key_store_alert_canonical_groups.rs:2331 — KeyStore::read_admin_alert_canonical_group_payload_chunks has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • KeyStore::stream_admin_alert_canonical_semantic_output (cyclomatic 28) src/store/key_store_alert_canonical_semantic_reduction.rs:830 — KeyStore::stream_admin_alert_canonical_semantic_output 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.
  • KeyStore::dashboard_rollup_integrity_request_log_gc_decision_for_day_inner (cyclomatic 27) src/store/key_store_dashboard_rollup_integrity.rs:3158 — KeyStore::dashboard_rollup_integrity_request_log_gc_decision_for_day_inner has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • KeyStore::delete_old_request_logs_bounded_with_deadline_scoped (cyclomatic 27) src/store/key_store_request_logs_gc.rs:1159 — KeyStore::delete_old_request_logs_bounded_with_deadline_scoped 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.
  • KeyStore::create_next_dashboard_rollup_integrity_work_item (cyclomatic 26) src/store/key_store_dashboard_rollup_integrity.rs:1218 — KeyStore::create_next_dashboard_rollup_integrity_work_item has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • KeyStore::ha_peer_channel_health (cyclomatic 23) REDACTED:333 — KeyStore::ha_peer_channel_health 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.
  • KeyStore::advance_admitted_alert_projection_slice (cyclomatic 22) src/store/key_store_alert_projection.rs:783 — KeyStore::advance_admitted_alert_projection_slice has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • KeyStore::fetch_dashboard_quota_recovery_round (cyclomatic 22) src/store/key_store_dashboard_quota_recovery.rs:293 — KeyStore::fetch_dashboard_quota_recovery_round 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.
  • KeyStore::run_observability_sidecar_migrate (cyclomatic 22) REDACTED:1786 — KeyStore::run_observability_sidecar_migrate has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • KeyStore::add_or_undelete_key_with_status_in_group_once (cyclomatic 22) src/store/key_store_token_logs.rs:1690 — KeyStore::add_or_undelete_key_with_status_in_group_once 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.
  • KeyStore::upstream_privacy_status_from_snapshot (cyclomatic 21) src/store/key_store_admin_privacy_read.rs:165 — KeyStore::upstream_privacy_status_from_snapshot has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • KeyStore::clear_request_log_body_batch (cyclomatic 20) src/store/key_store_request_logs_gc.rs:900 — KeyStore::clear_request_log_body_batch 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.
  • KeyStore::scheduled_job_enqueue_at_with_operation (cyclomatic 19) src/store/key_store_jobs.rs:647 — KeyStore::scheduled_job_enqueue_at_with_operation 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.
  • KeyStore::fetch_dashboard_quota_recovery_baseline_step (cyclomatic 18) src/store/key_store_dashboard_quota_recovery.rs:754 — KeyStore::fetch_dashboard_quota_recovery_baseline_step has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • KeyStore::rebuild_dashboard_request_rollup_buckets_window (cyclomatic 18) REDACTED:667 — KeyStore::rebuild_dashboard_request_rollup_buckets_window 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.
  • KeyStore::next_upstream_reconciliation_research_candidates (cyclomatic 18) src/store/key_store_upstream_reconciliation_research.rs:99 — KeyStore::next_upstream_reconciliation_research_candidates has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • KeyStore::apply_pending_billing_log_once (cyclomatic 18) src/store/key_store_users_and_oauth.rs:1954 — KeyStore::apply_pending_billing_log_once 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.
  • KeyStore::alert_projection_source_keys (cyclomatic 17) src/store/key_store_alert_projection.rs:281 — KeyStore::alert_projection_source_keys has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • + 9 more in this group — see findings.md.
X25 · Inert configuration knob · Configuration option is read nowhere · ×33
  • Configuration option is read nowhere src/main.rs:81 — `Cli.xray_binary` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/main.rs:130 — `Cli.admin_auth_passkey_enabled` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `passkey_auth_enabled`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/main.rs:142 — `Cli.admin_passkey_challenge_ttl_secs` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `passkey_challenge_ttl_secs`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/main.rs:150 — `Cli.admin_passkey_session_max_age_secs` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `passkey_session_max_age_secs`, and nothing reads that either. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/models.rs:1092 — `AdminUserIpUsage.recent_ip_addresses_24h` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/models.rs:1093 — `AdminUserIpUsage.recent_ip_addresses_7d` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/models.rs:1248 — `RecentAlertsSummary.window_hours` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:724 — `SystemSettingsUpdatePayload.rebalance_mcp_session_percent` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:75 — `ReconciliationRunObservation.projection_state` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:76 — `ReconciliationRunObservation.projection_scanned_rows` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:77 — `ReconciliationRunObservation.projection_batch_size` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:78 — `ReconciliationRunObservation.projection_transaction_p95_ms` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:104 — `ReconciliationRunObservation.last_transport_kind_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:119 — `ReconciliationResearchProgressWindow.window_ended_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:120 — `ReconciliationResearchProgressWindow.window_seconds` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:121 — `ReconciliationResearchProgressWindow.terminal_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:122 — `ReconciliationResearchProgressWindow.pending_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:124 — `ReconciliationResearchProgressWindow.unavailable_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:126 — `ReconciliationResearchProgressWindow.pollable_pending_delta` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:127 — `ReconciliationResearchProgressWindow.terminal_rate_positive` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:129 — `ReconciliationResearchProgressWindow.poll_resolution_rate_positive` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:130 — `ReconciliationResearchProgressWindow.pending_non_growing` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:138 — `ReconciliationResearchPollDiagnostics.pollable_pending` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:139 — `ReconciliationResearchPollDiagnostics.credentials_cooling_keys` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere src/upstream_privacy_status.rs:140 — `ReconciliationResearchPollDiagnostics.earliest_credentials_retry_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×31
  • Duplicated block (10 lines × 2) src/analysis.rs:2180 — src/analysis.rs:2180-2189 | src/analysis.rs:2238-2247 — both copies are in the same file, so extract the 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 `src/analysis.rs:2180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `out` to `&mut HashMap<String, i64>` in one and `&mut HashMap<String, bool>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) src/bin/ha_outbox_cleanup_once.rs:283 — src/bin/ha_outbox_cleanup_once.rs:283-292 | src/bin/ha_outbox_cleanup_once.rs:318-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/forward_proxy/responses_and_validation.rs:1680 — src/forward_proxy/responses_and_validation.rs:1680-1689 | src/forward_proxy/responses_and_validation.rs:1713-1722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/forward_proxy/responses_and_validation.rs:1690` calls `query_flag_true`, `insert`, `to_string` and `src/forward_proxy/responses_and_validation.rs:1723` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) src/remote_attempt_admission.rs:180 — src/remote_attempt_admission.rs:180-193 | src/remote_attempt_admission.rs:213-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) src/server/handlers/admin_auth.rs:1719 — src/server/handlers/admin_auth.rs:1719-1728 | src/server/handlers/admin_auth.rs:1746-1755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/server/handlers/admin_auth.rs:1717` calls `Json` and `src/server/handlers/admin_auth.rs:1744` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) src/server/handlers/admin_resources/api_keys_and_logs.rs:521 — src/server/handlers/admin_resources/api_keys_and_logs.rs:521-530 | src/server/handlers/admin_resources/api_keys_and_logs.rs:666-675 — both copies are in the same file, so extract the block into 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/server/handlers/public.rs:1797 — src/server/handlers/public.rs:1797-1806 | src/server/handlers/user.rs:1638-1647 — before extracting anything, compare `src/server/handlers/public.rs` and `src/server/handlers/user.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) src/server/spa.rs:304 — src/server/spa.rs:304-313 | src/server/spa.rs:318-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:773 — src/store/key_store_dashboard_quota_recovery.rs:773-782 | src/store/key_store_dashboard_quota_recovery.rs:833-842 — both copies are in the same file, so extract the block into 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/store/key_store_dashboard_rollup_integrity.rs:2193 — src/store/key_store_dashboard_rollup_integrity.rs:2193-2202 | src/store/key_store_dashboard_rollup_integrity.rs:2507-2517 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_rollup_integrity.rs:2193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/store/key_store_keys.rs:1966 — src/store/key_store_keys.rs:1966-1975 | src/store/key_store_keys.rs:1994-2003 — both copies are in the same file, so extract the 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 `src/store/key_store_keys.rs:1966` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:575 — src/store/key_store_request_logs_and_dashboard.rs:575-584 | src/store/key_store_token_logs.rs:116-125 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) src/store/key_store_upstream_reconciliation.rs:2275 — src/store/key_store_upstream_reconciliation.rs:2275-2284 | src/store/key_store_upstream_reconciliation.rs:2423-2432 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/store/key_store_upstream_reconciliation.rs:2514 — src/store/key_store_upstream_reconciliation.rs:2514-2523 | src/store/key_store_upstream_reconciliation.rs:2625-2634 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2514` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/store/key_store_users_and_oauth.rs:629 — src/store/key_store_users_and_oauth.rs:629-638 | src/store/key_store_users_and_oauth.rs:1032-1041 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:629` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) src/store/key_store_users_and_oauth.rs:885 — src/store/key_store_users_and_oauth.rs:885-894 | src/store/key_store_users_and_oauth.rs:1038-1047 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:885` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:1013 — src/tavily_proxy/proxy_quota_sync_and_jobs.rs:1013-1022 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:1044-1053 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_quota_sync_and_jobs.rs:1013` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2622 — src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2622-2631 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2634-2643 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2622` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2716 — src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2716-2725 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2749-2760 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2716` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/store/key_store_alert_event_projection.rs:634 — src/store/key_store_alert_event_projection.rs:634-643 | src/store/key_store_alert_event_projection.rs:758-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_alert_event_projection.rs:769` calls `bounded_alert_event_identifier_value` and `src/store/key_store_alert_event_projection.rs:645` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) src/lib.rs:2593 — src/lib.rs:2593-2602 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:667-676 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/admin_user_views_and_sort.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/server/handlers/admin_resources/ha.rs:1354 — src/server/handlers/admin_resources/ha.rs:1354-1363 | src/server/handlers/admin_resources/ha.rs:1851-1862 — both copies are in the same file, so extract the block into 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/store/sqlite_runtime.rs:2799 — src/store/sqlite_runtime.rs:2799-2808 | src/store/sqlite_runtime.rs:2813-2823 — both copies are in the same file, so extract the 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 `src/store/sqlite_runtime.rs:2799` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) src/store/key_store_alerts.rs:1211 — src/store/key_store_alerts.rs:1211-1220 | src/store/key_store_alerts.rs:1950-1959 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:1211` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/store/reconciliation_projection_controller.rs:637 — src/store/reconciliation_projection_controller.rs:637-646 | src/store/reconciliation_projection_controller.rs:662-671 — both copies are in the same file, so extract the 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 `src/store/reconciliation_projection_controller.rs:637` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 6 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×30
  • Hotspot: src/tavily_proxy/proxy_quota_sync_and_jobs.rs src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719 — src/tavily_proxy/proxy_quota_sync_and_jobs.rs changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 181 in TavilyProxy::run_upstream_reconciliation_once_inner at line 719. 52 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_quota_sync_and_jobs.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/server/schedulers.rs src/server/schedulers.rs:2444 — src/server/schedulers.rs changed 49 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in tavily_hikari::server::schedulers::run_manual_claimed_job at line 2444. 41 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/schedulers.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/store/key_store_schema_migrations.rs src/store/key_store_schema_migrations.rs:914 — src/store/key_store_schema_migrations.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in KeyStore::validate_applied_migration_objects at line 914. 28 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_schema_migrations.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: scripts/perf-local-boundaries.py scripts/perf-local-boundaries.py:4864 — scripts/perf-local-boundaries.py changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in perf-local-boundaries.measurement_reasons at line 4864. 21 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- scripts/perf-local-boundaries.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/src/admin/UpstreamPrivacyStatusModule.tsx web/src/admin/UpstreamPrivacyStatusModule.tsx:189 — web/src/admin/UpstreamPrivacyStatusModule.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule at line 189. 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-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- web/src/admin/UpstreamPrivacyStatusModule.tsx`: 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/server/state.rs src/server/state.rs:756 — src/server/state.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in tavily_hikari::server::state::prewarm_admin_alerts at line 756. 25 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/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/store/key_store_dashboard_rollup_integrity.rs src/store/key_store_dashboard_rollup_integrity.rs:1571 — src/store/key_store_dashboard_rollup_integrity.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in KeyStore::process_dashboard_rollup_integrity_work_item_inner at line 1571. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_dashboard_rollup_integrity.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/server/proxy/proxy_handlers_and_views.rs src/server/proxy/proxy_handlers_and_views.rs:1 — src/server/proxy/proxy_handlers_and_views.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 201 in tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler at line 1. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/proxy/proxy_handlers_and_views.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/store/key_store_bootstrap.rs src/store/key_store_bootstrap.rs:928 — src/store/key_store_bootstrap.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in KeyStore::initialize_schema at line 928. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_bootstrap.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/lib.rs src/lib.rs:771 — src/lib.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in tavily_hikari::run_request_statistics_recovery_once_with_time at line 771. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/tavily_proxy/proxy_core.rs src/tavily_proxy/proxy_core.rs:1570 — src/tavily_proxy/proxy_core.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in TavilyProxy::start_server_pressure_buckets_rebuild_once at line 1570. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_core.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/server/serve.rs src/server/serve.rs:36 — src/server/serve.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in tavily_hikari::server::serve::serve_with_shutdown at line 36. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/serve.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/store/key_store_alert_projection.rs src/store/key_store_alert_projection.rs:783 — src/store/key_store_alert_projection.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in KeyStore::advance_admitted_alert_projection_slice at line 783. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_alert_projection.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/server/handlers/public.rs src/server/handlers/public.rs:1965 — src/server/handlers/public.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in tavily_hikari::server::handlers::public::load_dashboard_overview_snapshot at line 1965. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/handlers/public.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/store/reconciliation_projection_controller.rs src/store/reconciliation_projection_controller.rs:164 — src/store/reconciliation_projection_controller.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in ReconciliationProjectionController::advance_slice_inner at line 164. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/reconciliation_projection_controller.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/server/handlers/tavily.rs src/server/handlers/tavily.rs:706 — src/server/handlers/tavily.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint at line 706. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/handlers/tavily.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:327 — REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in KeyStore::ensure_observability_sidecar_derived_schema_in_pool at line 327. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/tavily_proxy/proxy_ha.rs src/tavily_proxy/proxy_ha.rs:2 — src/tavily_proxy/proxy_ha.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in TavilyProxy::spawn_request_stats_coalescer at line 2. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_ha.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/store/key_store_ha_gc_online.rs src/store/key_store_ha_gc_online.rs:300 — src/store/key_store_ha_gc_online.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in KeyStore::gc_ha_outbox_online_with_options at line 300. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_ha_gc_online.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/tavily_proxy/proxy_forward_proxy_maintenance.rs src/tavily_proxy/proxy_forward_proxy_maintenance.rs:1013 — src/tavily_proxy/proxy_forward_proxy_maintenance.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in TavilyProxy::resolve_forward_proxy_geo_candidates_with_remote_attempt_admission at line 1013. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_forward_proxy_maintenance.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/store/key_store_request_logs_gc.rs src/store/key_store_request_logs_gc.rs:1159 — src/store/key_store_request_logs_gc.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in KeyStore::delete_old_request_logs_bounded_with_deadline_scoped at line 1159. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_request_logs_gc.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: scripts/gc_recovery_load.py scripts/gc_recovery_load.py:269 — scripts/gc_recovery_load.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in gc_recovery_load.main at line 269. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- scripts/gc_recovery_load.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/store/key_store_admin_privacy_read.rs src/store/key_store_admin_privacy_read.rs:165 — src/store/key_store_admin_privacy_read.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in KeyStore::upstream_privacy_status_from_snapshot at line 165. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_admin_privacy_read.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/server/schedulers_reconciliation_research_drain.rs src/server/schedulers_reconciliation_research_drain.rs:16 — src/server/schedulers_reconciliation_research_drain.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in tavily_hikari::server::schedulers_reconciliation_research_drain::select_next_scheduled_candidate at line 16. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/schedulers_reconciliation_research_drain.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/tavily_proxy/reconciliation_research_drain.rs src/tavily_proxy/reconciliation_research_drain.rs:220 — src/tavily_proxy/reconciliation_research_drain.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in TavilyProxy::run_upstream_reconciliation_research_drain_claimed_with_turn at line 220. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/reconciliation_research_drain.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×30
  • Duplicated block (12 lines × 2) src/bin/mcp_request_log_retry_repair.rs:383 — src/bin/mcp_request_log_retry_repair.rs:383-394 | src/bin/mcp_search_billing_repair.rs:480-491 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) src/forward_proxy/storage.rs:394 — src/forward_proxy/storage.rs:394-405 | src/forward_proxy/storage.rs:471-482 — both copies are in the same file, so extract the 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 `src/forward_proxy/storage.rs:394` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) src/lib.rs:3000 — src/lib.rs:3000-3011 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:612-623 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/admin_user_views_and_sort.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lib.rs:3000` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `tag` to `&UserTagRecord` in one and `&tavily_hikari::AdminUserTag` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) src/server/handlers/admin_resources/api_keys_and_logs.rs:44 — src/server/handlers/admin_resources/api_keys_and_logs.rs:44-55 | src/server/handlers/admin_resources/api_keys_and_logs.rs:313-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/api_keys_and_logs.rs:44` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/admin_resources/api_keys_and_logs.rs:326` calls `with_capacity` and `src/server/handlers/admin_resources/api_keys_and_logs.rs:57` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:24 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:24-35 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:58-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:55` calls `Path` and `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:21` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1602 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1602-1613 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1631-1642 — both copies are in the same file, so extract the block into 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/server/handlers/tavily.rs:1445 — src/server/handlers/tavily.rs:1445-1456 | src/server/proxy/proxy_handlers_and_views.rs:1716-1727 — before extracting anything, compare `src/server/handlers/tavily.rs` and `src/server/proxy/proxy_handlers_and_views.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:1445` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/server/handlers/user.rs:2806 — src/server/handlers/user.rs:2806-2817 | src/server/handlers/user.rs:2861-2872 — both copies are in the same file, so extract the 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 `src/server/handlers/user.rs:2806` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/server/serve.rs:1013 — src/server/serve.rs:1013-1024 | src/server/serve.rs:1046-1057 — both copies are in the same file, so extract the block into 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/server/serve.rs:1121 — src/server/serve.rs:1121-1132 | src/server/serve.rs:1440-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/serve.rs:1121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/server/serve.rs:1319 — src/server/serve.rs:1319-1330 | src/server/serve.rs:1634-1645 — both copies are in the same file, so extract the 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 `src/server/serve.rs:1319` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/server/state.rs:2054 — src/server/state.rs:2054-2065 | src/server/state.rs:2119-2130 — both copies are in the same file, so extract the block into 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/store/key_store_alert_canonical_groups.rs:437 — src/store/key_store_alert_canonical_groups.rs:437-448 | src/store/key_store_alert_canonical_groups.rs:1358-1369 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:822 — REDACTED:822-833 | REDACTED:948-959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:822` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:1636 — REDACTED:1636-1647 | REDACTED:1778-1789 — both copies are in the same file, so extract the block into 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/store/key_store_ha_gc_online.rs:406 — src/store/key_store_ha_gc_online.rs:406-417 | src/store/key_store_ha_gc_online.rs:444-455 — both copies are in the same file, so extract the 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 `src/store/key_store_ha_gc_online.rs:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/store/key_store_keys.rs:436 — src/store/key_store_keys.rs:436-447 | src/store/key_store_keys.rs:470-481 — both copies are in the same file, so extract the 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 `src/store/key_store_keys.rs:436` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/store/key_store_keys.rs:2411 — src/store/key_store_keys.rs:2411-2422 | src/store/key_store_keys.rs:2468-2479 — both copies are in the same file, so extract the 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 `src/store/key_store_keys.rs:2411` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1173 — src/store/key_store_request_logs_and_dashboard.rs:1173-1184 | src/store/key_store_request_logs_and_dashboard.rs:1241-1252 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_and_dashboard.rs:1173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_request_logs_and_dashboard.rs:1171` calls `Some` and `src/store/key_store_request_logs_and_dashboard.rs:1239` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/store/key_store_request_stats_coalescer.rs:185 — src/store/key_store_request_stats_coalescer.rs:185-196 | src/tavily_proxy/proxy_request_limits.rs:449-460 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/store/key_store_upstream_reconciliation.rs:2286 — src/store/key_store_upstream_reconciliation.rs:2286-2297 | src/store/key_store_upstream_reconciliation.rs:2435-2446 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_upstream_reconciliation.rs:2434` calls `bind` and `src/store/key_store_upstream_reconciliation.rs:2285` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) src/store/sqlite_runtime.rs:4152 — src/store/sqlite_runtime.rs:4152-4163 | src/store/sqlite_runtime.rs:4197-4208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn rollback(mut` in one and `crate) async fn finish( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) src/store/key_store_keys.rs:1768 — src/store/key_store_keys.rs:1768-1779 | src/store/key_store_keys.rs:2208-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_keys.rs:2208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/store/key_store_users_and_oauth.rs:1774 — src/store/key_store_users_and_oauth.rs:1774-1786 | src/store/key_store_users_and_oauth.rs:1928-1939 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:1774` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) src/server/ha_peer_lookup.rs:43 — src/server/ha_peer_lookup.rs:43-54 | src/server/ha_peer_lookup.rs:117-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/ha_peer_lookup.rs:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 5 more in this group — see findings.md.
D1 · Cyclomatic Complexity · tavily_hikari · ×27
  • tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler (cyclomatic 201) src/server/proxy/proxy_handlers_and_views.rs:1 — tavily_hikari::server::proxy::proxy_handlers_and_views::proxy_handler has cyclomatic complexity 201 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint (cyclomatic 66) src/server/handlers/tavily.rs:706 — tavily_hikari::server::handlers::tavily::proxy_tavily_http_endpoint has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • tavily_hikari::run_request_statistics_recovery_once_with_time (cyclomatic 49) src/lib.rs:771 — tavily_hikari::run_request_statistics_recovery_once_with_time 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.
  • tavily_hikari::server::schedulers::run_manual_claimed_job (cyclomatic 40) src/server/schedulers.rs:2444 — tavily_hikari::server::schedulers::run_manual_claimed_job has cyclomatic complexity 40 (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.
  • tavily_hikari::server::state::prewarm_admin_alerts (cyclomatic 39) src/server/state.rs:756 — tavily_hikari::server::state::prewarm_admin_alerts 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.
  • tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_api_key_bulk_actions (cyclomatic 34) src/server/handlers/admin_resources/api_keys_and_logs.rs:420 — tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_api_key_bulk_actions has cyclomatic complexity 34 (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.
  • tavily_hikari::server::handlers::admin_resources::user_tag_and_token_handlers::list_users (cyclomatic 30) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:155 — tavily_hikari::server::handlers::admin_resources::user_tag_and_token_handlers::list_users 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.
  • tavily_hikari::analysis::classify_failure_kind (cyclomatic 29) src/analysis.rs:214 — tavily_hikari::analysis::classify_failure_kind has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • tavily_hikari::server::handlers::admin_resources::ha::post_admin_ha_planned_cutover (cyclomatic 27) src/server/handlers/admin_resources/ha.rs:1810 — tavily_hikari::server::handlers::admin_resources::ha::post_admin_ha_planned_cutover 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.
  • tavily_hikari::server::schedulers_reconciliation_research_drain::select_next_scheduled_candidate (cyclomatic 26) src/server/schedulers_reconciliation_research_drain.rs:16 — tavily_hikari::server::schedulers_reconciliation_research_drain::select_next_scheduled_candidate 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.
  • tavily_hikari::server::handlers::tavily::tavily_http_research_result (cyclomatic 24) src/server/handlers/tavily.rs:381 — tavily_hikari::server::handlers::tavily::tavily_http_research_result 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.
  • tavily_hikari::models::audit_business_quota_ledger_with_pool (cyclomatic 23) src/models.rs:2669 — tavily_hikari::models::audit_business_quota_ledger_with_pool has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • tavily_hikari::forward_proxy::responses_and_validation::build_stream_settings_from_url (cyclomatic 22) src/forward_proxy/responses_and_validation.rs:1621 — tavily_hikari::forward_proxy::responses_and_validation::build_stream_settings_from_url 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.
  • tavily_hikari::server::handlers::admin_resources::ha::refresh_admin_ha_status_live (cyclomatic 21) src/server/handlers/admin_resources/ha.rs:494 — tavily_hikari::server::handlers::admin_resources::ha::refresh_admin_ha_status_live 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.
  • tavily_hikari::store::key_store_alert_event_projection::bound_alert_event_record_for_projection (cyclomatic 21) src/store/key_store_alert_event_projection.rs:599 — tavily_hikari::store::key_store_alert_event_projection::bound_alert_event_record_for_projection 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.
  • tavily_hikari::server::schedulers::run_linuxdo_user_status_sync_claimed_job (cyclomatic 20) src/server/schedulers.rs:1535 — tavily_hikari::server::schedulers::run_linuxdo_user_status_sync_claimed_job 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.
  • tavily_hikari::main (cyclomatic 19) src/main.rs:426 — tavily_hikari::main 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.
  • tavily_hikari::server::proxy::rebalance_handlers::handle_rebalance_mcp_single_message (cyclomatic 19) src/server/proxy/rebalance_handlers.rs:2 — tavily_hikari::server::proxy::rebalance_handlers::handle_rebalance_mcp_single_message has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • tavily_hikari::resolve_registration_regions_with_remote_attempt_admission (cyclomatic 18) src/lib.rs:2800 — tavily_hikari::resolve_registration_regions_with_remote_attempt_admission 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.
  • tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_validate_api_keys (cyclomatic 18) src/server/handlers/admin_resources/api_keys_and_logs.rs:1 — tavily_hikari::server::handlers::admin_resources::api_keys_and_logs::post_validate_api_keys 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.
  • tavily_hikari::server::handlers::public::load_dashboard_overview_snapshot (cyclomatic 18) src/server/handlers/public.rs:1965 — tavily_hikari::server::handlers::public::load_dashboard_overview_snapshot 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.
  • tavily_hikari::server::handlers::public::refresh_dashboard_overview_snapshot_with_reason (cyclomatic 18) src/server/handlers/public.rs:2210 — tavily_hikari::server::handlers::public::refresh_dashboard_overview_snapshot_with_reason 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.
  • tavily_hikari::server::serve::serve_with_shutdown (cyclomatic 17) src/server/serve.rs:36 — tavily_hikari::server::serve::serve_with_shutdown has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • tavily_hikari::store::backfill_request_log_request_kinds_with_pool (cyclomatic 17) src/store/mod.rs:2049 — tavily_hikari::store::backfill_request_log_request_kinds_with_pool has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (tavily_hikari::store::backfill_auth_token_log_request_kinds_with_pool) 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.
  • tavily_hikari::store::backfill_auth_token_log_request_kinds_with_pool (cyclomatic 17) src/store/mod.rs:2224 — tavily_hikari::store::backfill_auth_token_log_request_kinds_with_pool has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (tavily_hikari::store::backfill_request_log_request_kinds_with_pool) 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.
  • + 2 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×27
  • Repeated repair: src/store/sqlite_runtime.rs src/store/sqlite_runtime.rs:2180 — src/store/sqlite_runtime.rs changed 70 times in last 90 days and 60 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 SqliteRuntime::begin_read_snapshot at line 2180), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ci): keep sqlite runtime within source budget”; “fix(test): scope owned finish pause to sqlite runtime”; “fix(integrity): reuse healthy decision connections”; “fix(sqlite): preserve generic snapshot completion semantics”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/sqlite_runtime.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/tavily_proxy/reconciliation_engine.rs src/tavily_proxy/reconciliation_engine.rs:1181 — src/tavily_proxy/reconciliation_engine.rs changed 34 times in last 90 days and 32 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 TavilyProxy::fetch_upstream_research_poll at line 1181), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reconciliation): preserve projection progress through defers”; “fix(reconciliation): retry maintenance admission promptly”; “fix(sqlite): cancel stale reconciliation tickets”; “fix(sqlite): revisit reconciliation admission fairly”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/reconciliation_engine.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/store/key_store_upstream_reconciliation.rs src/store/key_store_upstream_reconciliation.rs:2210 — src/store/key_store_upstream_reconciliation.rs changed 31 times in last 90 days and 28 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is KeyStore::settle_upstream_reconciliation at line 2210), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(perf): complete request timing attribution”; “fix(sqlite): cancel stale reconciliation tickets”; “fix(reconciliation): fence geo turns and persist cleanup markers”; “fix(reconciliation): isolate maintenance lease cleanup”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_upstream_reconciliation.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/tavily_proxy/mod.rs src/tavily_proxy/mod.rs:183 — src/tavily_proxy/mod.rs changed 18 times in last 90 days and 15 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 ObservabilityDeferredWriter::take_next_batch at line 183), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(gc): retain productive cleanup turns”; “fix(reconciliation): isolate maintenance lease cleanup”; “fix(reconciliation): fence request reservations”; “fix(alerts): make canonical reductions resumable (#620)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/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.
  • Repeated repair: src/tavily_proxy/proxy_alerts.rs src/tavily_proxy/proxy_alerts.rs:183 — src/tavily_proxy/proxy_alerts.rs changed 15 times in last 90 days and 14 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 TavilyProxy::advance_dashboard_alert_projection_slice at line 183), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(alerts): restore canonical warm liveness (#622)”; “fix(alerts): make canonical reductions resumable (#620)”; “fix: stabilize runtime recovery and reconciliation”; “fix(alerts): recover canonical warm cache (#572)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_alerts.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/store/reconciliation_observation_store.rs src/store/reconciliation_observation_store.rs:317 — src/store/reconciliation_observation_store.rs changed 13 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is KeyStore::finalize_deferred_upstream_reconciliation_claim_with_progress at line 317), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reconciliation): honor projection backoff gate”; “fix(reconciliation): preserve projection progress through defers”; “fix(reconciliation): gate projection no-progress retries”; “fix: stabilize runtime recovery and reconciliation”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/reconciliation_observation_store.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/remote_attempt_admission.rs src/remote_attempt_admission.rs:303 — src/remote_attempt_admission.rs changed 13 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is RemoteAttemptAdmissionController::reserve_turn_with_followup at line 303), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reconciliation): preserve follow-up after deferred turn”; “fix(reconciliation): fence main follow-up generations”; “fix(reconciliation): defer remote lease until request start”; “fix(reconciliation): fence request reservations”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/remote_attempt_admission.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/store/key_store_alerts.rs src/store/key_store_alerts.rs:253 — src/store/key_store_alerts.rs changed 13 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is tavily_hikari::store::key_store_alerts::build_semantic_child_windows at line 253), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(alerts): make canonical reductions resumable (#620)”; “fix(alerts): bound canonical Events reads (#616)”; “fix: stabilize runtime recovery and reconciliation”; “fix(alerts): recover canonical warm cache (#572)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_alerts.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/tavily_proxy/proxy_request_limits.rs src/tavily_proxy/proxy_request_limits.rs:68 — src/tavily_proxy/proxy_request_limits.rs changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is TavilyProxy::dashboard_quota_charge_snapshot_for_token at line 68), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(dashboard): preserve bounded recovery for historical windows”; “fix: stabilize runtime recovery and reconciliation”; “fix(runtime): converge SQLite maintenance paths (#561)”; “fix(dashboard): retain last-good alert projection”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_request_limits.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/observability.rs src/observability.rs:1022 — src/observability.rs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is Metrics::apply_event at line 1022), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(perf): bypass timing scope for terminal requests”; “fix(observability): lazily initialize request timing phases”; “fix(perf): prevent overlapping request phase timing”; “fix(perf): share timing lifecycle and harden evidence”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/observability.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/store/key_store_dashboard_rollup_integrity_blocked.rs src/store/key_store_dashboard_rollup_integrity_blocked.rs:2 — src/store/key_store_dashboard_rollup_integrity_blocked.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is KeyStore::run_dashboard_rollup_integrity_slice at line 2), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(storage): preserve migration drift and bound gc reads”; “fix(integrity): reset baseline probe deadlines”; “fix(integrity): persist source baseline eligibility”; “fix(integrity): skip blocked ranges before work selection”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_dashboard_rollup_integrity_blocked.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/server/handlers/admin_resources/alerts.rs src/server/handlers/admin_resources/alerts.rs:120 — src/server/handlers/admin_resources/alerts.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is tavily_hikari::server::handlers::admin_resources::alerts::get_alert_events at line 120), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(alerts): unblock canonical warm recovery (#574)”; “fix(admin): self-heal canonical Alerts warm reads”; “fix(runtime): converge SQLite maintenance paths (#561)”; “fix: contain admin reads and observability pressure (#534)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/handlers/admin_resources/alerts.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/server/handlers/admin_resources/forward_proxy_and_key_validation.rs src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:443 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is tavily_hikari::server::handlers::admin_resources::forward_proxy_and_key_validation::post_forward_proxy_candidate_validation at line 443), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(admin): defer passkey status auth safely”; “fix(admin): atomically claim privacy refresh”; “fix(admin): isolate privacy status refresh”; “fix: harden reconciliation admin observability (#539)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/store/key_store_request_stats_coalescer.rs src/store/key_store_request_stats_coalescer.rs:348 — src/store/key_store_request_stats_coalescer.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 6 (its worst body is RequestStatsCoalescer::enqueue_dashboard_rollup_delta_locked at line 348), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(recovery): harden resumable target recovery”; “fix(gc): resume blocked request log cleanup”; “fix(sqlite): bound privacy diagnostic shaping”; “fix(ci): stabilize deferred maintenance tests”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_request_stats_coalescer.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/store/key_store_sessions.rs src/store/key_store_sessions.rs:2394 — src/store/key_store_sessions.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is KeyStore::update_user_tag at line 2394), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sqlite): preserve maintenance and persistence recovery”; “fix(sqlite): skip redundant warm maintenance writes”; “fix(reconciliation): classify Research poll outcomes (#559)”; “fix(reconciliation): bound preparation reads (#547)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_sessions.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/store/key_store_request_log_body_retention.rs src/store/key_store_request_log_body_retention.rs:489 — src/store/key_store_request_log_body_retention.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 8 (its worst body is KeyStore::log_rebalance_audit_entries at line 489), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): converge SQLite maintenance paths (#561)”; “fix(rollup): restore rebalance request statistics”; “fix(stats): harden business call event bridge (#535)”; “fix: contain reconciliation and observability writes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_request_log_body_retention.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/tavily_proxy/proxy_usage_and_metrics.rs src/tavily_proxy/proxy_usage_and_metrics.rs:152 — src/tavily_proxy/proxy_usage_and_metrics.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 8 (its worst body is TavilyProxy::requeue_rebalance_audits at line 152), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): converge SQLite maintenance paths (#561)”; “fix(ci): synchronize observability test writers”; “fix(stats): harden business call event bridge (#535)”; “fix: contain reconciliation and observability writes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/tavily_proxy/proxy_usage_and_metrics.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: web/scripts/generate_pwa_assets.py web/scripts/generate_pwa_assets.py:118 — web/scripts/generate_pwa_assets.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is generate_pwa_assets.make_manifest at line 118), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(release): stabilize production image layers (#637)”; “fix(pwa): bypass cached install metadata”; “fix(pwa): refresh installed app icons (#560)”; “fix: preserve image layers across releases (#528)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- web/scripts/generate_pwa_assets.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/store/key_store_keys.rs src/store/key_store_keys.rs:1347 — src/store/key_store_keys.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 KeyStore::create_access_token at line 1347), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sqlite): keep HTTP key cooldown checks in query”; “fix(sqlite): bound admin token creation contention”; “fix(api): preserve historical blog key membership”; “fix(sqlite): prioritize foreground workloads (#525)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_keys.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/server/handlers/blog_runtime.rs src/server/handlers/blog_runtime.rs:169 — src/server/handlers/blog_runtime.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 12 (its worst body is tavily_hikari::server::handlers::blog_runtime::public_blog_runtime_body at line 169), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(api): align public metrics route prefix”; “fix(api): reject overflowed public metrics”; “fix(api): align public runtime metric semantics”; “fix(ci): address backend shard failures”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/handlers/blog_runtime.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/store/key_store_blog_runtime.rs src/store/key_store_blog_runtime.rs:2 — src/store/key_store_blog_runtime.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 7 (its worst body is KeyStore::fetch_public_blog_runtime_data at line 2), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(api): group public metrics by Shanghai date”; “fix(api): align public runtime metric semantics”; “fix(api): isolate quota history by membership interval”; “fix(api): preserve historical blog key membership”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_blog_runtime.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/store/key_store_analysis_pressure.rs src/store/key_store_analysis_pressure.rs:218 — src/store/key_store_analysis_pressure.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 15 (its worst body is KeyStore::rebuild_server_pressure_buckets_with_cancel at line 218), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: harden reconciliation admin observability (#539)”; “fix: contain reconciliation and observability writes”; “fix(sqlite): prioritize foreground workloads (#525)”; “fix(sqlite): keep pressure scans outside writer”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_analysis_pressure.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/server/spa.rs src/server/spa.rs:13 — src/server/spa.rs changed 3 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 tavily_hikari::server::spa::is_content_hashed_pwa_asset at line 13), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(release): stabilize production image layers (#637)”; “fix(pwa): bypass cached install metadata”; “fix(pwa): refresh installed app icons (#560)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/spa.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/server/schedulers_remote_attempt.rs src/server/schedulers_remote_attempt.rs:9 — src/server/schedulers_remote_attempt.rs changed 3 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 3 (its worst body is tavily_hikari::server::schedulers_remote_attempt::sync_key_quota_with_db_job_gate at line 9), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reconciliation): defer remote lease until request start”; “fix(reconciliation): preserve fairness across pre-request failures”; “fix(reconciliation): restore aged research drain liveness”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/server/schedulers_remote_attempt.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/store/key_store_alert_events_cte.rs src/store/key_store_alert_events_cte.rs:72 — src/store/key_store_alert_events_cte.rs changed 3 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 12 (its worst body is KeyStore::push_auth_alert_filters at line 72), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(alerts): make canonical reductions resumable (#620)”; “fix(alerts): separate dashboard tail from history”; “fix(alerts): contain complete projection reads”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-10..2026-11-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-10 14:26:05 +08:00' --until='2026-11-08 14:26:05 +08:00' --full-history --no-merges -- src/store/key_store_alert_events_cte.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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×26
  • Duplicated block (8 lines × 2) src/forward_proxy/responses_and_validation.rs:424 — src/forward_proxy/responses_and_validation.rs:424-431 | src/forward_proxy/responses_and_validation.rs:448-455 — both copies are in the same file, so extract the 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 `src/forward_proxy/responses_and_validation.rs:424` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) src/forward_proxy/responses_and_validation.rs:549 — src/forward_proxy/responses_and_validation.rs:549-556 | src/forward_proxy/responses_and_validation.rs:564-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/forward_proxy/responses_and_validation.rs:549` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/forward_proxy/responses_and_validation.rs:974 — src/forward_proxy/responses_and_validation.rs:974-981 | src/forward_proxy/responses_and_validation.rs:998-1005 — both copies are in the same file, so extract the block into 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/lib.rs:2769 — src/lib.rs:2769-2776 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:463-470 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) src/server/dto.rs:1811 — src/server/dto.rs:1811-1818 | src/server/dto.rs:2161-2168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/server/dto.rs:2158` calls `RawQuery` and `src/server/dto.rs:1808` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) src/server/handlers/admin_resources/alerts.rs:153 — src/server/handlers/admin_resources/alerts.rs:153-160 | src/server/handlers/admin_resources/alerts.rs:258-265 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/alerts.rs:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/server/handlers/admin_resources/ha.rs:780 — src/server/handlers/admin_resources/ha.rs:780-787 | src/server/handlers/admin_resources/ha.rs:871-878 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:780` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/server/handlers/admin_resources/ha.rs:2011 — src/server/handlers/admin_resources/ha.rs:2011-2018 | src/server/handlers/admin_resources/ha.rs:2360-2367 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:2011` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/server/handlers/tavily.rs:1092 — src/server/handlers/tavily.rs:1092-1100 | src/server/handlers/tavily.rs:1368-1375 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:1092` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/store/key_store_admin_privacy_read.rs:732 — src/store/key_store_admin_privacy_read.rs:732-739 | src/store/key_store_admin_privacy_read.rs:740-748 — both copies are in the same file, so extract the block into 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/store/key_store_alerts.rs:2075 — src/store/key_store_alerts.rs:2075-2082 | src/store/key_store_alerts.rs:2188-2195 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:2075` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/store/key_store_keys.rs:2628 — src/store/key_store_keys.rs:2628-2635 | src/store/key_store_keys.rs:2693-2700 — both copies are in the same file, so extract the 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 `src/store/key_store_keys.rs:2628` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/store/key_store_linuxdo_credit_recharge.rs:728 — src/store/key_store_linuxdo_credit_recharge.rs:728-735 | src/store/key_store_linuxdo_credit_recharge.rs:773-780 — both copies are in the same file, so extract the 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 `src/store/key_store_linuxdo_credit_recharge.rs:728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:393 — src/store/key_store_request_logs_and_dashboard.rs:393-400 | src/store/key_store_request_logs_and_dashboard.rs:415-422 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_and_dashboard.rs:393` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_request_logs_and_dashboard.rs:412` calls `bind` and `src/store/key_store_request_logs_and_dashboard.rs:392` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) src/store/reconciliation_projection_controller.rs:702 — src/store/reconciliation_projection_controller.rs:702-709 | src/store/sqlite_runtime_maintenance_metrics.rs:353-360 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/reconciliation_projection_controller.rs:702` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/store/sqlite_runtime.rs:3664 — src/store/sqlite_runtime.rs:3664-3671 | src/store/sqlite_runtime.rs:3731-3738 — both copies are in the same file, so extract the 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 `src/store/sqlite_runtime.rs:3664` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/server/handlers/admin_resources/announcements.rs:105 — src/server/handlers/admin_resources/announcements.rs:105-112 | src/server/handlers/admin_resources/announcements.rs:132-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/server/handlers/admin_resources/ha.rs:951 — src/server/handlers/admin_resources/ha.rs:951-958 | src/server/handlers/admin_resources/ha.rs:1202-1209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/ha.rs:951` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) src/bin/support/sqlite_sidecar.rs:178 — src/bin/support/sqlite_sidecar.rs:178-185 | src/store/mod.rs:1200-1207 — before extracting anything, compare `src/bin/support/sqlite_sidecar.rs` and `src/store/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/support/sqlite_sidecar.rs:178` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/lib.rs:2750 — src/lib.rs:2750-2760 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:494-501 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/server/handlers/admin_auth.rs:2222 — src/server/handlers/admin_auth.rs:2222-2229 | src/server/state.rs:2519-2526 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/server/handlers/tavily.rs:864 — src/server/handlers/tavily.rs:864-871 | src/server/proxy/proxy_handlers_and_views.rs:877-884 — before extracting anything, compare `src/server/handlers/tavily.rs` and `src/server/proxy/proxy_handlers_and_views.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:864` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/forward_proxy/responses_and_validation.rs:694 — src/forward_proxy/responses_and_validation.rs:694-701 | src/forward_proxy/responses_and_validation.rs:723-730 — both copies are in the same file, so extract the 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 `src/forward_proxy/responses_and_validation.rs:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/server/handlers/admin_resources/ha.rs:2094 — src/server/handlers/admin_resources/ha.rs:2094-2101 | src/server/handlers/admin_resources/ha.rs:2125-2132 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:2094` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:2376 — src/store/key_store_dashboard_rollup_integrity.rs:2376-2383 | src/store/key_store_dashboard_rollup_integrity.rs:2971-2978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 1 more in this group — see findings.md.
D2 · Cognitive Complexity · TavilyProxy · ×23
  • TavilyProxy::run_upstream_reconciliation_once_inner (cognitive 290) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719 — TavilyProxy::run_upstream_reconciliation_once_inner has cognitive complexity 290 (threshold 15). Drivers by points: if/else 101 (193 pts), match/switch 21 (49 pts), boolean chains 43, loops 3 (5 pts) (nesting depth added 122). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::run_research_terminal_sweep (cognitive 74) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:224 — TavilyProxy::run_research_terminal_sweep has cognitive complexity 74 (threshold 15). Drivers by points: if/else 23 (56 pts), match/switch 8 (14 pts), boolean chains 3, loops 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.
  • TavilyProxy::start_server_pressure_buckets_rebuild_once (cognitive 64) src/tavily_proxy/proxy_core.rs:1570 — TavilyProxy::start_server_pressure_buckets_rebuild_once has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (56 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::validate_forward_proxy_subscription_with_progress (cognitive 58) src/tavily_proxy/proxy_core.rs:2497 — TavilyProxy::validate_forward_proxy_subscription_with_progress has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (47 pts), loops 4 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::acquire_key_for_api_route (cognitive 38) src/tavily_proxy/proxy_affinity.rs:760 — TavilyProxy::acquire_key_for_api_route has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 3 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::proxy_http_json_endpoint (cognitive 38) src/tavily_proxy/proxy_http_and_logs.rs:356 — TavilyProxy::proxy_http_json_endpoint has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 7, loops 2 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::proxy_http_research (cognitive 36) src/tavily_proxy/proxy_http_and_logs.rs:1288 — TavilyProxy::proxy_http_research has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::proxy_http_get_endpoint (cognitive 31) src/tavily_proxy/proxy_http_and_logs.rs:1593 — TavilyProxy::proxy_http_get_endpoint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::spawn_ha_state_coalescer (cognitive 29) src/tavily_proxy/proxy_ha.rs:251 — TavilyProxy::spawn_ha_state_coalescer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::send_with_forward_proxy_plan (cognitive 28) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:1728 — TavilyProxy::send_with_forward_proxy_plan has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 4 (8 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::acquire_key_for (cognitive 27) src/tavily_proxy/proxy_affinity.rs:1021 — TavilyProxy::acquire_key_for has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::resolve_forward_proxy_geo_candidates_with_remote_attempt_admission (cognitive 25) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:1013 — TavilyProxy::resolve_forward_proxy_geo_candidates_with_remote_attempt_admission has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • TavilyProxy::proxy_request (cognitive 25) src/tavily_proxy/proxy_http_and_logs.rs:103 — TavilyProxy::proxy_request has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (3 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.
  • TavilyProxy::rank_registration_aware_candidates (cognitive 24) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:559 — TavilyProxy::rank_registration_aware_candidates has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5, 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.
  • TavilyProxy::reconcile_proxy_affinity_record_with_state (cognitive 24) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:685 — TavilyProxy::reconcile_proxy_affinity_record_with_state has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 7 (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.
  • TavilyProxy::spawn_request_stats_coalescer (cognitive 24) src/tavily_proxy/proxy_ha.rs:2 — TavilyProxy::spawn_request_stats_coalescer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::run_upstream_reconciliation_research_drain_claimed_with_turn (cognitive 24) src/tavily_proxy/reconciliation_research_drain.rs:220 — TavilyProxy::run_upstream_reconciliation_research_drain_claimed_with_turn has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::proxy_rebalance_mcp_http_research (cognitive 23) src/tavily_proxy/proxy_http_and_logs.rs:1007 — TavilyProxy::proxy_rebalance_mcp_http_research has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::dashboard_quota_charge_snapshot_for_token (cognitive 23) src/tavily_proxy/proxy_request_limits.rs:68 — TavilyProxy::dashboard_quota_charge_snapshot_for_token has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::acquire_key_for_http_project (cognitive 22) src/tavily_proxy/proxy_affinity.rs:630 — TavilyProxy::acquire_key_for_http_project has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::populate_token_quota (cognitive 20) src/tavily_proxy/proxy_auth_and_oauth.rs:399 — TavilyProxy::populate_token_quota has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::proxy_rebalance_mcp_http_json_endpoint (cognitive 20) src/tavily_proxy/proxy_http_and_logs.rs:736 — TavilyProxy::proxy_rebalance_mcp_http_json_endpoint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TavilyProxy::fetch_upstream_research_poll (cognitive 20) src/tavily_proxy/reconciliation_engine.rs:1181 — TavilyProxy::fetch_upstream_research_poll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×21
  • Duplicated block (7 lines × 2) src/models.rs:2327 — src/models.rs:2327-2333 | src/server/handlers/public.rs:1786-1792 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) src/server/dto.rs:947 — src/server/dto.rs:947-953 | src/server/dto.rs:1025-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `tavily_hikari::AlertEventRecord` in one and `tavily_hikari::AlertGroupRecord` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) src/server/handlers/admin_resources/ha.rs:286 — src/server/handlers/admin_resources/ha.rs:286-292 | src/server/handlers/admin_resources/ha.rs:479-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `status` to `&tavily_hikari::HaStatusView` in one and `&mut tavily_hikari::HaStatusView` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) src/server/handlers/blog_runtime.rs:197 — src/server/handlers/blog_runtime.rs:197-203 | src/server/handlers/blog_runtime.rs:209-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/blog_runtime.rs:197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/server/handlers/tavily.rs:1021 — src/server/handlers/tavily.rs:1021-1027 | src/server/proxy/proxy_handlers_and_views.rs:1019-1025 — before extracting anything, compare `src/server/handlers/tavily.rs` and `src/server/proxy/proxy_handlers_and_views.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:1021` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/store/key_store_alert_event_projection.rs:627 — src/store/key_store_alert_event_projection.rs:627-633 | src/store/key_store_alert_event_projection.rs:747-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/store/key_store_alerts.rs:2029 — src/store/key_store_alerts.rs:2029-2035 | src/store/key_store_alerts.rs:2143-2149 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:2029` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_alerts.rs:2142` calls `iter`, `cloned`, `is_empty` and `src/store/key_store_alerts.rs:2029` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) REDACTED:2398 — REDACTED:2398-2404 | REDACTED:2414-2420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) REDACTED:2734 — REDACTED:2734-2740 | REDACTED:2903-2909 — both copies are in the same file, so extract the block into 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) REDACTED:2974 — REDACTED:2974-2980 | REDACTED:3025-3031 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2974` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/store/sqlite_runtime.rs:3660 — src/store/sqlite_runtime.rs:3660-3666 | src/store/sqlite_runtime_cooperative.rs:228-234 — before extracting anything, compare `src/store/sqlite_runtime.rs` and `src/store/sqlite_runtime_cooperative.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:3660` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) src/tavily_proxy/mod.rs:1450 — src/tavily_proxy/mod.rs:1450-1456 | src/tavily_proxy/mod.rs:1516-1522 — both copies are in the same file, so extract the block into 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/lib.rs:2742 — src/lib.rs:2742-2748 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:401-407 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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/models.rs:2932 — src/models.rs:2932-2938 | src/server/handlers/public.rs:1759-1765 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:1223 — src/store/key_store_dashboard_rollup_integrity.rs:1223-1233 | src/store/key_store_dashboard_rollup_integrity.rs:3047-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 (7 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:629 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:629-639 | src/server/handlers/user.rs:2592-2598 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1765 — src/store/key_store_request_logs_and_dashboard.rs:1765-1771 | src/store/key_store_token_logs.rs:858-865 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) src/store/key_store_linuxdo_credit_recharge.rs:1392 — src/store/key_store_linuxdo_credit_recharge.rs:1392-1398 | src/store/key_store_users_and_oauth.rs:84-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_linuxdo_credit_recharge.rs:1392` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) src/server/handlers/public.rs:1230 — src/server/handlers/public.rs:1230-1236 | src/server/handlers/public.rs:1663-1669 — both copies are in the same file, so extract the 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 `src/server/handlers/public.rs:1230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/store/mod.rs:96 — src/store/mod.rs:96-102 | src/store/mod.rs:128-134 — both copies are in the same file, so extract the 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 `src/store/mod.rs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) REDACTED:2369 — REDACTED:2369-2375 | REDACTED:2383-2389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2369` 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.
D1 · Cyclomatic Complexity · TavilyProxy · ×18
  • TavilyProxy::run_upstream_reconciliation_once_inner (cyclomatic 181) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:719 — TavilyProxy::run_upstream_reconciliation_once_inner has cyclomatic complexity 181 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TavilyProxy::run_research_terminal_sweep (cyclomatic 44) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:224 — TavilyProxy::run_research_terminal_sweep 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.
  • TavilyProxy::start_server_pressure_buckets_rebuild_once (cyclomatic 26) src/tavily_proxy/proxy_core.rs:1570 — TavilyProxy::start_server_pressure_buckets_rebuild_once 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.
  • TavilyProxy::run_upstream_reconciliation_research_drain_claimed_with_turn (cyclomatic 26) src/tavily_proxy/reconciliation_research_drain.rs:220 — TavilyProxy::run_upstream_reconciliation_research_drain_claimed_with_turn 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.
  • TavilyProxy::proxy_http_json_endpoint (cyclomatic 25) src/tavily_proxy/proxy_http_and_logs.rs:356 — TavilyProxy::proxy_http_json_endpoint 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.
  • TavilyProxy::validate_forward_proxy_subscription_with_progress (cyclomatic 23) src/tavily_proxy/proxy_core.rs:2497 — TavilyProxy::validate_forward_proxy_subscription_with_progress 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.
  • TavilyProxy::proxy_http_research (cyclomatic 23) src/tavily_proxy/proxy_http_and_logs.rs:1288 — TavilyProxy::proxy_http_research 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.
  • TavilyProxy::proxy_http_get_endpoint (cyclomatic 23) src/tavily_proxy/proxy_http_and_logs.rs:1593 — TavilyProxy::proxy_http_get_endpoint 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.
  • TavilyProxy::reconcile_proxy_affinity_record_with_state (cyclomatic 21) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:685 — TavilyProxy::reconcile_proxy_affinity_record_with_state has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • TavilyProxy::resolve_forward_proxy_geo_candidates_with_remote_attempt_admission (cyclomatic 19) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:1013 — TavilyProxy::resolve_forward_proxy_geo_candidates_with_remote_attempt_admission 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.
  • TavilyProxy::rank_registration_aware_candidates (cyclomatic 18) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:559 — TavilyProxy::rank_registration_aware_candidates 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.
  • TavilyProxy::acquire_key_for_api_route (cyclomatic 17) src/tavily_proxy/proxy_affinity.rs:760 — TavilyProxy::acquire_key_for_api_route 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.
  • TavilyProxy::acquire_key_for (cyclomatic 17) src/tavily_proxy/proxy_affinity.rs:1021 — TavilyProxy::acquire_key_for 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.
  • TavilyProxy::send_with_forward_proxy_plan (cyclomatic 16) src/tavily_proxy/proxy_forward_proxy_maintenance.rs:1728 — TavilyProxy::send_with_forward_proxy_plan 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.
  • TavilyProxy::spawn_request_stats_coalescer (cyclomatic 16) src/tavily_proxy/proxy_ha.rs:2 — TavilyProxy::spawn_request_stats_coalescer 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.
  • TavilyProxy::spawn_ha_state_coalescer (cyclomatic 16) src/tavily_proxy/proxy_ha.rs:251 — TavilyProxy::spawn_ha_state_coalescer 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.
  • TavilyProxy::proxy_request (cyclomatic 16) src/tavily_proxy/proxy_http_and_logs.rs:103 — TavilyProxy::proxy_request 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.
  • TavilyProxy::proxy_rebalance_mcp_http_research (cyclomatic 16) src/tavily_proxy/proxy_http_and_logs.rs:1007 — TavilyProxy::proxy_rebalance_mcp_http_research has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D3 · God Classes · ClassTooLong · ×17
  • ClassTooLong: SystemSettingsModule web/src/admin/SystemSettingsModule.tsx:1 — ClassTooLong — 1127 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 727 over it, 2.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ForwardProxySettingsModule web/src/admin/ForwardProxySettingsModule.tsx:1 — ClassTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 642 over it, 2.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TokenDetail web/src/pages/TokenDetail.tsx:1 — ClassTooLong — 964 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 564 over it, 2.41× 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: AlertsCenter web/src/admin/AlertsCenter.tsx:1 — ClassTooLong — 937 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 537 over it, 2.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UpstreamPrivacyStatusModule web/src/admin/UpstreamPrivacyStatusModule.tsx:1 — ClassTooLong — 758 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 358 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: PublicHome web/src/PublicHome.tsx:1 — ClassTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 349 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AdminRecentRequestsPanel web/src/components/AdminRecentRequestsPanel.tsx:1 — ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 222 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Metrics src/observability.rs:465 — ClassTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 465-1239. The bar is 400 significant lines; this is 213 over it, 1.53× 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: HaRuntime src/ha.rs:714 — ClassTooLong — 603 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 2 blocks, lines 714-1495. The bar is 400 significant lines; this is 203 over it, 1.51× 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: UserDetailSharedUsagePanel web/src/admin/UserDetailSharedUsagePanel.tsx:1 — ClassTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 189 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AdminSecuritySettingsModule web/src/admin/AdminSecuritySettingsModule.tsx:1 — ClassTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 171 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: DashboardOverview web/src/admin/DashboardOverview.tsx:1 — ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 165 over it, 1.41× 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: XraySupervisor src/forward_proxy/relay_and_xray.rs:588 — ClassTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 2 blocks, lines 588-1286. The bar is 400 significant lines; this is 116 over it, 1.29× 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: ApiKeysValidationDialog web/src/components/ApiKeysValidationDialog.tsx:1 — ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 101 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: ReconciliationProjectionController src/store/reconciliation_projection_controller.rs:58 — ClassTooLong — 495 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 2 blocks, lines 58-682. The bar is 400 significant lines; this is 95 over it, 1.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BillingPage web/src/user-console/BillingPage.tsx:1 — ClassTooLong — 494 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 94 over it, 1.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RemoteAttemptAdmissionController src/remote_attempt_admission.rs:18 — ClassTooLong — 419 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 3 blocks, lines 18-763. The bar is 400 significant lines; this is 19 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium CVE · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×16
  • Duplicated block (13 lines × 2) src/analysis.rs:368 — src/analysis.rs:368-380 | src/analysis.rs:401-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/analysis.rs:368` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/bin/mcp_session_delete_neutral_repair.rs:602 — src/bin/mcp_session_delete_neutral_repair.rs:602-614 | src/bin/mcp_session_delete_neutral_repair.rs:764-776 — both copies are in the same file, so extract the 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 `src/bin/mcp_session_delete_neutral_repair.rs:602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/forward_proxy/responses_and_validation.rs:1377 — src/forward_proxy/responses_and_validation.rs:1377-1389 | src/forward_proxy/responses_and_validation.rs:1411-1423 — both copies are in the same file, so extract the 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 `src/forward_proxy/responses_and_validation.rs:1377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/ha.rs:743 — src/ha.rs:743-755 | src/server/handlers/admin_resources/ha.rs:553-565 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/ha.rs:743` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/lib.rs:2728 — src/lib.rs:2728-2740 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:442-454 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) src/remote_attempt_admission.rs:464 — src/remote_attempt_admission.rs:464-476 | src/remote_attempt_admission.rs:598-610 — both copies are in the same file, so extract the 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 `src/remote_attempt_admission.rs:464` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/server/handlers/admin_resources/ha.rs:1496 — src/server/handlers/admin_resources/ha.rs:1496-1508 | src/server/handlers/admin_resources/ha.rs:1536-1548 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:1496` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/admin_resources/ha.rs:1509` calls `clone` and `src/server/handlers/admin_resources/ha.rs:1549` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:304 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:304-316 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:374-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/store/key_store_alert_canonical_groups.rs:1954 — src/store/key_store_alert_canonical_groups.rs:1954-1966 | src/store/key_store_alert_canonical_groups.rs:2240-2252 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:1954` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_alert_canonical_groups.rs:1953` calls `bind` and `src/store/key_store_alert_canonical_groups.rs:2239` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) src/store/key_store_alert_canonical_groups.rs:2204 — src/store/key_store_alert_canonical_groups.rs:2204-2216 | src/store/key_store_alert_canonical_groups.rs:2305-2317 — both copies are in the same file, so extract the block into 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/store/key_store_alert_canonical_semantic_reduction.rs:717 — src/store/key_store_alert_canonical_semantic_reduction.rs:717-729 | src/store/key_store_alert_canonical_semantic_reduction.rs:755-767 — both copies are in the same file, so extract the block into 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/store/key_store_alert_event_projection.rs:149 — src/store/key_store_alert_event_projection.rs:149-161 | src/store/key_store_alert_event_projection.rs:387-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_event_projection.rs:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:576 — src/store/key_store_dashboard_quota_recovery.rs:576-588 | src/store/key_store_dashboard_quota_recovery.rs:726-738 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_quota_recovery.rs:576` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/store/key_store_users_and_oauth.rs:2043 — src/store/key_store_users_and_oauth.rs:2043-2055 | src/store/key_store_users_and_oauth.rs:2326-2338 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:2043` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:794 — src/tavily_proxy/proxy_http_and_logs.rs:794-806 | src/tavily_proxy/proxy_http_and_logs.rs:1062-1074 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:794` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tavily_proxy/proxy_http_and_logs.rs:793` calls `insert`, `to_string`, `Bool` and `src/tavily_proxy/proxy_http_and_logs.rs:1061` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) src/store/key_store_linuxdo_credit_recharge.rs:634 — src/store/key_store_linuxdo_credit_recharge.rs:634-646 | src/store/key_store_linuxdo_credit_recharge.rs:677-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_linuxdo_credit_recharge.rs:634` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_linuxdo_credit_recharge.rs:648` calls `linuxdo_credit_recharge_order_from_row` and `src/store/key_store_linuxdo_credit_recharge.rs:691` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×16
  • Duplicated block (11 lines × 2) src/bin/mcp_session_delete_neutral_repair.rs:584 — src/bin/mcp_session_delete_neutral_repair.rs:584-594 | src/bin/mcp_session_delete_neutral_repair.rs:740-750 — both copies are in the same file, so extract the 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 `src/bin/mcp_session_delete_neutral_repair.rs:584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/lib.rs:3032 — src/lib.rs:3032-3042 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:646-656 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/admin_user_views_and_sort.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lib.rs:3032` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `&AccountQuotaBreakdownRecord` in one and `&tavily_hikari::AdminUserQuotaBreakdownEntry` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:280 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:280-290 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:350-360 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) src/server/handlers/tavily.rs:397 — src/server/handlers/tavily.rs:397-407 | src/server/handlers/tavily.rs:736-746 — both copies are in the same file, so extract the block into 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/store/key_store_alert_canonical_semantic_reduction.rs:596 — src/store/key_store_alert_canonical_semantic_reduction.rs:596-606 | src/store/key_store_alert_canonical_semantic_reduction.rs:650-660 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_semantic_reduction.rs:596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/store/key_store_alert_projection.rs:301 — src/store/key_store_alert_projection.rs:301-311 | src/store/key_store_alert_projection.rs:495-505 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_projection.rs:301` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:801 — src/store/key_store_dashboard_quota_recovery.rs:801-811 | src/store/key_store_dashboard_quota_recovery.rs:861-871 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_quota_recovery.rs:801` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:687 — src/store/key_store_dashboard_rollup_integrity.rs:687-697 | src/store/key_store_dashboard_rollup_integrity.rs:2782-2792 — both copies are in the same file, so extract the block into 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/store/key_store_dashboard_rollup_integrity.rs:1162 — src/store/key_store_dashboard_rollup_integrity.rs:1162-1172 | src/store/key_store_dashboard_rollup_integrity.rs:1393-1403 — both copies are in the same file, so extract the block into 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) REDACTED:85 — REDACTED:85-95 | REDACTED:744-755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/store/mod.rs:2100 — src/store/mod.rs:2100-2110 | src/store/mod.rs:2277-2287 — both copies are in the same file, so extract the 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 `src/store/mod.rs:2100` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) src/store/key_store_users_and_oauth.rs:307 — src/store/key_store_users_and_oauth.rs:307-325 | src/store/key_store_users_and_oauth.rs:334-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_users_and_oauth.rs:327` calls `bind` and `src/store/key_store_users_and_oauth.rs:346` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) src/store/sqlite_contention_logging.rs:30 — src/store/sqlite_contention_logging.rs:30-40 | src/store/sqlite_contention_logging.rs:66-76 — both copies are in the same file, so extract the block into 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/server/handlers/tavily.rs:904 — src/server/handlers/tavily.rs:904-914 | src/server/handlers/tavily.rs:988-998 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:904` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/store/key_store_upstream_reconciliation.rs:1770 — src/store/key_store_upstream_reconciliation.rs:1770-1780 | src/store/reconciliation_projection_controller.rs:439-449 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_upstream_reconciliation.rs:1770` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:284 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:284-294 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:451-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:284` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×14
  • Duplicated block (15 lines × 2) src/lib.rs:702 — src/lib.rs:702-716 | src/lib.rs:726-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lib.rs:702` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/server/handlers/admin_resources/admin_user_views_and_sort.rs:383 — src/server/handlers/admin_resources/admin_user_views_and_sort.rs:383-397 | src/server/handlers/user.rs:1323-1337 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) src/server/handlers/tavily.rs:905 — src/server/handlers/tavily.rs:905-919 | src/server/handlers/tavily.rs:1048-1062 — both copies are in the same file, so extract the block into 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/server/proxy/proxy_handlers_and_views.rs:897 — src/server/proxy/proxy_handlers_and_views.rs:897-911 | src/server/proxy/proxy_handlers_and_views.rs:1026-1040 — both copies are in the same file, so extract the block into 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/store/key_store_alert_canonical_groups.rs:1023 — src/store/key_store_alert_canonical_groups.rs:1023-1037 | src/store/key_store_alert_canonical_groups.rs:1179-1193 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:1023` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/store/key_store_alert_canonical_semantic_reduction.rs:564 — src/store/key_store_alert_canonical_semantic_reduction.rs:564-578 | src/store/key_store_alert_canonical_semantic_reduction.rs:1217-1231 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_semantic_reduction.rs:564` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/store/key_store_alert_event_projection.rs:272 — src/store/key_store_alert_event_projection.rs:272-286 | src/store/key_store_alert_event_projection.rs:312-326 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_event_projection.rs:272` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/store/key_store_token_logs.rs:148 — src/store/key_store_token_logs.rs:148-162 | src/store/key_store_token_logs.rs:171-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) src/store/key_store_users_and_oauth.rs:809 — src/store/key_store_users_and_oauth.rs:809-824 | src/store/key_store_users_and_oauth.rs:870-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_users_and_oauth.rs:809` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) src/server/ha_peer_lookup.rs:19 — src/server/ha_peer_lookup.rs:19-33 | src/server/ha_peer_lookup.rs:92-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/store/key_store_token_logs.rs:2394 — src/store/key_store_token_logs.rs:2394-2408 | src/store/key_store_token_logs.rs:2420-2435 — both copies are in the same file, so extract the block into 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/store/key_store_dashboard_rollup_integrity.rs:1860 — src/store/key_store_dashboard_rollup_integrity.rs:1860-1875 | src/store/key_store_dashboard_rollup_integrity.rs:2003-2017 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_rollup_integrity.rs:1860` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1509 — src/store/key_store_request_logs_and_dashboard.rs:1509-1523 | src/store/key_store_token_logs.rs:639-653 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:1509` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) src/store/key_store_linuxdo_credit_recharge.rs:577 — src/store/key_store_linuxdo_credit_recharge.rs:577-591 | src/store/key_store_linuxdo_credit_recharge.rs:598-612 — both copies are in the same file, so extract the 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 `src/store/key_store_linuxdo_credit_recharge.rs:577` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×14
  • Duplicated block (9 lines × 2) src/forward_proxy/responses_and_validation.rs:1693 — src/forward_proxy/responses_and_validation.rs:1693-1701 | src/forward_proxy/responses_and_validation.rs:1723-1731 — both copies are in the same file, so extract the block into 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/linuxdo_credit_recharge.rs:329 — src/linuxdo_credit_recharge.rs:329-337 | src/server/handlers/admin_resources/recharges_and_totp.rs:676-684 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/server/handlers/admin_resources/api_keys_and_logs.rs:503 — src/server/handlers/admin_resources/api_keys_and_logs.rs:503-511 | src/server/handlers/admin_resources/api_keys_and_logs.rs:555-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/api_keys_and_logs.rs:503` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/server/handlers/admin_resources/ha.rs:1865 — src/server/handlers/admin_resources/ha.rs:1865-1873 | src/server/handlers/admin_resources/ha.rs:2085-2093 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:1865` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/server/handlers/public.rs:1238 — src/server/handlers/public.rs:1238-1246 | src/server/handlers/public.rs:1671-1679 — both copies are in the same file, so extract the 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 `src/server/handlers/public.rs:1238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/server/handlers/user.rs:2111 — src/server/handlers/user.rs:2111-2119 | src/server/handlers/user.rs:2189-2197 — both copies are in the same file, so extract the 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 `src/server/handlers/user.rs:2111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/user.rs:2198` calls `from_value`, `map_err`, `to_string` and `src/server/handlers/user.rs:2120` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) src/store/key_store_request_stats_coalescer.rs:634 — src/store/key_store_request_stats_coalescer.rs:634-642 | src/store/key_store_request_stats_coalescer.rs:659-667 — both copies are in the same file, so extract the 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 `src/store/key_store_request_stats_coalescer.rs:634` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn commit(mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_request_stats_coalescer.rs:643` calls `drop` and `src/store/key_store_request_stats_coalescer.rs:668` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) src/store/key_store_upstream_reconciliation.rs:357 — src/store/key_store_upstream_reconciliation.rs:357-365 | src/store/key_store_upstream_reconciliation_research.rs:559-567 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_upstream_reconciliation.rs:357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/store/key_store_upstream_reconciliation.rs:1967 — src/store/key_store_upstream_reconciliation.rs:1967-1975 | src/store/key_store_upstream_reconciliation.rs:2011-2019 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:1967` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/tavily_proxy/mod.rs:1563 — src/tavily_proxy/mod.rs:1563-1571 | src/tavily_proxy/mod.rs:1623-1631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/mod.rs:1563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:268 — src/tavily_proxy/proxy_http_and_logs.rs:268-276 | src/tavily_proxy/proxy_http_and_logs.rs:338-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:268` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:443 — src/tavily_proxy/proxy_http_and_logs.rs:443-451 | src/tavily_proxy/proxy_http_and_logs.rs:1361-1369 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:365 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:365-374 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:594-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/server/handlers/admin_resources/ha.rs:2222 — src/server/handlers/admin_resources/ha.rs:2222-2230 | src/server/handlers/admin_resources/ha.rs:2315-2323 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:2222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×14
  • Duplicated block (6 lines × 2) src/server/handlers/admin_resources/api_keys_and_logs.rs:578 — src/server/handlers/admin_resources/api_keys_and_logs.rs:578-583 | src/server/handlers/admin_resources/api_keys_and_logs.rs:596-601 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/api_keys_and_logs.rs:578` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) src/server/serve.rs:1798 — src/server/serve.rs:1798-1803 | src/server/serve.rs:1872-1877 — both copies are in the same file, so extract the block into 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/store/key_store_alerts.rs:828 — src/store/key_store_alerts.rs:828-833 | src/store/key_store_alerts.rs:848-853 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:828` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/store/key_store_alerts.rs:1056 — src/store/key_store_alerts.rs:1056-1061 | src/store/key_store_alerts.rs:2607-2613 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:2607` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:592 — src/store/key_store_dashboard_quota_recovery.rs:592-597 | src/store/key_store_request_logs_and_dashboard.rs:2291-2297 — before extracting anything, compare `src/store/key_store_dashboard_quota_recovery.rs` and `src/store/key_store_request_logs_and_dashboard.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_dashboard_quota_recovery.rs:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:550 — REDACTED:550-555 | REDACTED:572-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) src/backend_time.rs:193 — src/backend_time.rs:193-198 | src/backend_time.rs:212-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/backend_time.rs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/analysis.rs:2033 — src/analysis.rs:2033-2038 | src/store/mod.rs:1677-1682 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/server/handlers/admin_resources/ha.rs:963 — src/server/handlers/admin_resources/ha.rs:963-970 | src/server/handlers/admin_resources/ha.rs:1216-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/ha.rs:963` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) src/server/schedulers.rs:2685 — src/server/schedulers.rs:2685-2690 | src/server/schedulers.rs:2692-2697 — both copies are in the same file, so extract the 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 `src/server/schedulers.rs:2685` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) REDACTED:610 — REDACTED:610-615 | REDACTED:1732-1737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:610` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/store/key_store_keys.rs:2078 — src/store/key_store_keys.rs:2078-2083 | src/store/key_store_keys.rs:2130-2135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_keys.rs:2075` calls `max`, `clamp` and `src/store/key_store_keys.rs:2129` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) src/store/key_store_token_logs.rs:189 — src/store/key_store_token_logs.rs:189-194 | src/store/key_store_token_logs.rs:2532-2537 — both copies are in the same file, so extract the block into 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) .codex/skills/ui-ux-pro-max/scripts/design_system.py:321 — .codex/skills/ui-ux-pro-max/scripts/design_system.py:321-326 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:346-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×13
  • Duplicated block (18 lines × 2) src/forward_proxy/storage.rs:1011 — src/forward_proxy/storage.rs:1011-1028 | src/forward_proxy/storage.rs:1123-1140 — both copies are in the same file, so extract the 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 `src/forward_proxy/storage.rs:1011` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/server/handlers/blog_runtime.rs:220 — src/server/handlers/blog_runtime.rs:220-237 | src/server/handlers/blog_runtime.rs:238-255 — both copies are in the same file, so extract the block into 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/server/handlers/tavily.rs:1164 — src/server/handlers/tavily.rs:1164-1181 | src/server/handlers/tavily.rs:1447-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:1164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:2105 — src/server/proxy/proxy_handlers_and_views.rs:2105-2122 | src/server/proxy/proxy_handlers_and_views.rs:2177-2194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `record` to `RequestLogRecord` in one and `TokenLogRecord` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18 lines × 2) src/server/state.rs:846 — src/server/state.rs:846-863 | src/server/state.rs:878-895 — both copies are in the same file, so extract the block into 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/server/state.rs:1000 — src/server/state.rs:1000-1017 | src/server/state.rs:1021-1038 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) src/store/key_store_alerts.rs:999 — src/store/key_store_alerts.rs:999-1016 | src/store/key_store_alerts.rs:2552-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alerts.rs:999` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/store/key_store_request_logs_gc.rs:178 — src/store/key_store_request_logs_gc.rs:178-195 | src/store/key_store_request_logs_gc.rs:417-434 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_gc.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:394 — src/tavily_proxy/proxy_http_and_logs.rs:394-411 | src/tavily_proxy/proxy_http_and_logs.rs:1624-1641 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:394` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:1571 — src/tavily_proxy/proxy_http_and_logs.rs:1571-1588 | src/tavily_proxy/proxy_http_and_logs.rs:1837-1854 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:1571` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/store/key_store_request_logs_gc.rs:577 — src/store/key_store_request_logs_gc.rs:577-595 | src/store/key_store_request_logs_gc.rs:1062-1079 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_gc.rs:577` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/server/proxy/rebalance_handlers.rs:227 — src/server/proxy/rebalance_handlers.rs:227-244 | src/server/proxy/rebalance_handlers.rs:250-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/rebalance_handlers.rs:250` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18 lines × 2) src/store/key_store_users_and_oauth.rs:757 — src/store/key_store_users_and_oauth.rs:757-774 | src/store/key_store_users_and_oauth.rs:929-946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×13
  • Outbound HTTP without resilience src/bin/mock_edgeone_ingress.rs:197 — `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/bin/mock_mcp_client.rs:57 — `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/bin/mock_upstream.rs:74 — `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/forward_proxy/relay_and_xray.rs:129 — `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/forward_proxy/relay_and_xray.rs:223 — `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/ha.rs:1556 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/handlers/admin_resources/recharges_and_totp.rs:633 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/handlers/user.rs:660 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/handlers/user.rs:2305 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/schedulers.rs:1616 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/schedulers.rs:2034 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/serve.rs:894 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/server/serve.rs:941 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×10
  • Edited copy of a member (11 corresponding lines) src/server/state.rs:1802 — src/server/state.rs:1802-1812 | src/server/state.rs:1814-1824 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/server/state.rs:568 — src/server/state.rs:568-581 | src/server/state.rs:586-596 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/server/dto.rs:1302 — src/server/dto.rs:1302-1312 | src/server/dto.rs:1334-1348 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) web/scripts/verify_relay_mesh_lockup_geometry.py:79 — web/scripts/verify_relay_mesh_lockup_geometry.py:79-97 | web/scripts/verify_relay_mesh_mark_geometry.py:77-87 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/bin/db_compaction_once.rs:66 — src/bin/db_compaction_once.rs:66-76 | src/bin/ha_trigger_repair_once.rs:52-63 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/lib.rs:3233 — src/lib.rs:3233-3243 | src/models.rs:2424-2434 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/forward_proxy/storage.rs:362 — src/forward_proxy/storage.rs:362-372 | src/forward_proxy/storage.rs:377-387 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/store/key_store_keys.rs:1818 — src/store/key_store_keys.rs:1818-1829 | src/store/key_store_keys.rs:2020-2030 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) REDACTED:2929 — REDACTED:2929-2939 | REDACTED:2946-2967 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/store/key_store_reconciliation_key_observations.rs:315 — src/store/key_store_reconciliation_key_observations.rs:315-325 | src/store/mod.rs:1719-1732 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×10
  • Duplicated block (14 lines × 2) src/server/serve.rs:1106 — src/server/serve.rs:1106-1119 | src/server/serve.rs:1426-1439 — both copies are in the same file, so extract the 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 `src/server/serve.rs:1106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/serve.rs:1120` calls `now` and `src/server/serve.rs:1440` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) src/store/key_store_alert_canonical_groups.rs:1820 — src/store/key_store_alert_canonical_groups.rs:1820-1833 | src/store/key_store_alert_canonical_groups.rs:2204-2217 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:1820` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/store/key_store_alert_projection.rs:376 — src/store/key_store_alert_projection.rs:376-389 | src/store/key_store_alert_projection.rs:567-580 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_projection.rs:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/store/key_store_alerts.rs:2874 — src/store/key_store_alerts.rs:2874-2887 | src/store/key_store_alerts.rs:2895-2908 — both copies are in the same file, so extract the block into 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) REDACTED:374 — REDACTED:374-387 | REDACTED:1147-1160 — both copies are in the same file, so extract the block into 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/store/key_store_upstream_reconciliation.rs:2318 — src/store/key_store_upstream_reconciliation.rs:2318-2331 | src/store/key_store_upstream_reconciliation.rs:2581-2594 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/store/key_store_upstream_reconciliation.rs:2938 — src/store/key_store_upstream_reconciliation.rs:2938-2951 | src/store/key_store_upstream_reconciliation.rs:3008-3021 — both copies are in the same file, so extract the block into 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/store/key_store_alerts.rs:2707 — src/store/key_store_alerts.rs:2707-2725 | src/store/key_store_alerts.rs:2836-2849 — both copies are in the same file, so extract the block into 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/store/key_store_request_logs_gc.rs:616 — src/store/key_store_request_logs_gc.rs:616-629 | src/store/key_store_request_logs_gc.rs:659-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_gc.rs:616` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/store/key_store_admin_passkeys.rs:672 — src/store/key_store_admin_passkeys.rs:672-685 | src/store/key_store_admin_passkeys.rs:793-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_admin_passkeys.rs:672` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_admin_passkeys.rs:687` calls `bind`, `as_str` and `src/store/key_store_admin_passkeys.rs:808` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D3 · God Classes · TooManyFields · ×9
  • TooManyFields: Cli src/main.rs:50 — TooManyFields — 68 stored fields. The bar is 30 stored fields; this is 38 over it, 2.27× 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: UpstreamPrivacyStatus src/upstream_privacy_status.rs:180 — TooManyFields — 51 stored fields. The bar is 30 stored fields; this is 21 over it, 1.70× 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: ObservabilitySidecarMigrationReport src/lib.rs:572 — TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: RequestLogView src/server/dto.rs:202 — TooManyFields — 46 stored fields beside 3 methods. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: TavilyProxy src/tavily_proxy/mod.rs:876 — TooManyFields — 43 stored fields beside 705 methods. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DashboardOverviewCacheState src/server/state.rs:85 — TooManyFields — 36 stored fields beside 15 methods. The bar is 30 stored fields; this is 6 over it, 1.20× 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: AlertEventProjectionRow src/store/key_store_alert_models.rs:31 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AdminUserDetailView src/server/handlers/admin_resources/admin_user_views_and_sort.rs:247 — TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: HaStatusView src/ha.rs:580 — 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×9
  • Edited copy of a member (13 corresponding lines) web/scripts/verify_relay_mesh_lockup_geometry.py:126 — web/scripts/verify_relay_mesh_lockup_geometry.py:126-140 | web/scripts/verify_relay_mesh_mark_geometry.py:97-109 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) .github/scripts/check_quality_gates.py:282 — .github/scripts/check_quality_gates.py:282-296 | .github/scripts/check_quality_gates.py:300-312 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/analysis.rs:643 — src/analysis.rs:643-655 | src/analysis.rs:716-728 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/store/immediate_transaction.rs:17 — src/store/immediate_transaction.rs:17-36 | src/store/immediate_transaction.rs:133-145 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/store/sqlite_runtime.rs:1797 — src/store/sqlite_runtime.rs:1797-1813 | src/store/sqlite_runtime.rs:1815-1827 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/tavily_proxy/proxy_request_limits.rs:1620 — src/tavily_proxy/proxy_request_limits.rs:1620-1632 | src/tavily_proxy/proxy_request_limits.rs:1639-1652 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/server/proxy/proxy_handlers_and_views.rs:2055 — src/server/proxy/proxy_handlers_and_views.rs:2055-2069 | src/server/dto.rs:896-908 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/store/key_store_upstream_reconciliation.rs:979 — src/store/key_store_upstream_reconciliation.rs:979-997 | src/store/reconciliation_projection_controller.rs:563-575 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/store/key_store_keys.rs:1750 — src/store/key_store_keys.rs:1750-1762 | src/store/key_store_users_and_oauth.rs:408-420 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×9
  • Duplicated block (17 lines × 2) src/lib.rs:2893 — src/lib.rs:2893-2909 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:568-584 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lib.rs:2893` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lib.rs:2891` calls `drop` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:566` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) src/server/handlers/tavily.rs:1275 — src/server/handlers/tavily.rs:1275-1291 | src/server/handlers/tavily.rs:1558-1574 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:1275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:147 — src/server/proxy/proxy_handlers_and_views.rs:147-163 | src/server/proxy/proxy_handlers_and_views.rs:174-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/proxy_handlers_and_views.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:752 — src/tavily_proxy/proxy_http_and_logs.rs:752-768 | src/tavily_proxy/proxy_http_and_logs.rs:1022-1038 — both copies are in the same file, so extract the block into 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/tavily_proxy/proxy_quota_sync_and_jobs.rs:378 — src/tavily_proxy/proxy_quota_sync_and_jobs.rs:378-394 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:420-436 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_quota_sync_and_jobs.rs:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/store/key_store_token_logs.rs:979 — src/store/key_store_token_logs.rs:979-995 | src/store/key_store_token_logs.rs:1047-1071 — both copies are in the same file, so extract the block into 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/store/key_store_users_and_oauth.rs:2176 — src/store/key_store_users_and_oauth.rs:2176-2192 | src/store/key_store_users_and_oauth.rs:2278-2301 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:2176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/forward_proxy/storage.rs:1234 — src/forward_proxy/storage.rs:1234-1255 | src/forward_proxy/storage.rs:1271-1287 — both copies are in the same file, so extract the 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 `src/forward_proxy/storage.rs:1234` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) src/server/schedulers.rs:775 — src/server/schedulers.rs:775-791 | src/server/schedulers.rs:826-842 — both copies are in the same file, so extract the 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 `src/server/schedulers.rs:775` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×9
  • Duplicated block (8 lines × 3) src/bin/mcp_request_log_retry_repair.rs:389 — src/bin/mcp_request_log_retry_repair.rs:389-396 | src/bin/mcp_search_billing_repair.rs:486-493 | src/bin/mcp_session_delete_neutral_repair.rs:1060-1067 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) src/lib.rs:3001 — src/lib.rs:3001-3008 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:613-620 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:630-637 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/admin_user_views_and_sort.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `tag` to `&UserTagRecord` in one and `&tavily_hikari::AdminUserTag` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) src/server/handlers/admin_resources/api_keys_and_logs.rs:482 — src/server/handlers/admin_resources/api_keys_and_logs.rs:482-489 | src/server/handlers/admin_resources/api_keys_and_logs.rs:504-511 | src/server/handlers/admin_resources/api_keys_and_logs.rs:579-586 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/api_keys_and_logs.rs:482` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:193 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:193-200 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:255-262 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:325-332 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:193` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 3) src/server/handlers/public.rs:609 — src/server/handlers/public.rs:609-616 | src/server/handlers/tavily.rs:399-406 | src/server/handlers/tavily.rs:738-745 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/public.rs:609` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/server/schedulers.rs:2548 — src/server/schedulers.rs:2548-2555 | src/server/schedulers.rs:2750-2757 | src/server/schedulers.rs:2909-2916 — 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/server/handlers/admin_resources/ha.rs:2225 — src/server/handlers/admin_resources/ha.rs:2225-2232 | src/server/handlers/admin_resources/ha.rs:2267-2274 | src/server/handlers/admin_resources/ha.rs:2318-2325 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/ha.rs:2225` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) .codex/skills/ui-ux-pro-max/scripts/design_system.py:268 — .codex/skills/ui-ux-pro-max/scripts/design_system.py:268-275 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:393-400 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:575-582 — 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) web/scripts/generate_relay_mesh_brand_assets.py:126 — web/scripts/generate_relay_mesh_brand_assets.py:126-133 | web/scripts/generate_relay_mesh_brand_assets.py:147-154 | web/scripts/generate_relay_mesh_brand_assets.py:161-168 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `web/scripts/generate_relay_mesh_brand_assets.py:155` calls `blend` and `web/scripts/generate_relay_mesh_brand_assets.py:169` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×9
  • Duplicated block (5 lines × 2) src/analysis.rs:434 — src/analysis.rs:434-438 | src/analysis.rs:456-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/analysis.rs:434` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) src/store/sqlite_runtime.rs:3654 — src/store/sqlite_runtime.rs:3654-3658 | src/store/sqlite_runtime_cooperative.rs:212-216 — before extracting anything, compare `src/store/sqlite_runtime.rs` and `src/store/sqlite_runtime_cooperative.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:3654` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) src/models.rs:2304 — src/models.rs:2304-2308 | src/server/state.rs:2943-2947 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/store/key_store_request_stats_coalescer.rs:178 — src/store/key_store_request_stats_coalescer.rs:178-182 | src/tavily_proxy/mod.rs:621-625 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `state` to `&mut RequestStatsCoalescerState` in one and `&mut HaStateCoalescerState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) REDACTED:889 — REDACTED:889-903 | REDACTED:3260-3264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:889` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) src/forward_proxy/responses_and_validation.rs:1555 — src/forward_proxy/responses_and_validation.rs:1555-1559 | src/forward_proxy/responses_and_validation.rs:1592-1596 — both copies are in the same file, so extract the 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 `src/forward_proxy/responses_and_validation.rs:1555` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) src/server/handlers/admin_resources/api_keys_and_logs.rs:790 — src/server/handlers/admin_resources/api_keys_and_logs.rs:790-794 | src/server/handlers/admin_resources/api_keys_and_logs.rs:906-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/admin_resources/api_keys_and_logs.rs:795` calls `unwrap_or` and `src/server/handlers/admin_resources/api_keys_and_logs.rs:911` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) .codex/skills/ui-ux-pro-max/scripts/design_system.py:440 — .codex/skills/ui-ux-pro-max/scripts/design_system.py:440-446 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:625-629 — both copies are in the same file, so extract the block into 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) examples/forwardauth-caddy/auth-mock/server.py:61 — examples/forwardauth-caddy/auth-mock/server.py:61-65 | examples/forwardauth-caddy/upstream-mock/server.py:64-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: en.ts ↔ zh.ts web/src/i18n/translations/en.ts:1 — `web/src/i18n/translations/en.ts` and `web/src/i18n/translations/zh.ts` change together 93% of the time (52 of the 56 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 52 shared commits counted here, the most recent 3 are `c65f8a40` feat(admin): clarify system settings limit fields (#554); `4e5368fa` fix(ha): normalize topology diagnostics across admin views (#536); `8a2adaad` fix(alerts): contain complete projection reads — run `git show` on any of them.
  • Change coupling: UserConsole.stories.tsx ↔ text.ts web/src/UserConsole.stories.tsx:1 — `web/src/UserConsole.stories.tsx` and `web/src/user-console/text.ts` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `15a0877f` feat(console): improve announcement history handling; `f01edc81` feat(console): add token setup guide (#440); `eba8254d` fix(console): compact token list and hide notes — run `git show` on any of them.
  • Change coupling: dto.rs ↔ proxy.rs src/server/dto.rs:1 — `src/server/dto.rs` and `src/server/proxy.rs` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `52f40a47` feat: add rebalance MCP gateway; `6f2616d2` feat: move raw request limiting into memory; `0727911d` feat(admin): split request log effect buckets — run `git show` on any of them.
  • Change coupling: AdminPagesStoryRuntime.tsx ↔ REDACTED web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:1 — `web/src/admin/storySupport/AdminPagesStoryRuntime.tsx` and `REDACTED` change together 52% of the time (17 of the 33 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 17 shared commits counted here, the most recent 3 are `24640cb0` feat(auth): scope passkeys to local nodes; `0b33d569` fix(admin): project hybrid shadow daily usage; `9bed1a75` feat(admin): move risk signals into alerts — run `git show` on any of them.
  • Change coupling: dto.rs ↔ TokenDetail.stories.tsx src/server/dto.rs:1 — `src/server/dto.rs` and `web/src/pages/TokenDetail.stories.tsx` change together 50% of the time (8 of the 16 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `0727911d` feat(admin): split request log effect buckets; `86e16497` fix(admin): split recent request logs loading; `9b902cb1` feat(logs): canonicalize request kinds (#181) — run `git show` on any of them.
  • Change coupling: lib.rs ↔ vite.config.ts src/lib.rs:1 — `src/lib.rs` and `web/vite.config.ts` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `640b122d` feat(proxy): add global socks5 relay egress; `bedd49e4` feat(admin): persist registration-aware proxy assignment; `219c9368` feat: improve forward proxy validation UX — run `git show` on any of them.
  • Change coupling: key_store_upstream_reconciliation.rs ↔ UpstreamPrivacyStatusModule.tsx src/store/key_store_upstream_reconciliation.rs:1 — `src/store/key_store_upstream_reconciliation.rs` and `web/src/admin/UpstreamPrivacyStatusModule.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `5e0d812e` fix(reconciliation): classify Research poll outcomes (#559); `0ec27b1d` fix(reconciliation): resume multi-key observations; `89fd4b3e` fix(reconciliation): persist research timeout retries — run `git show` on any of them.
  • Change coupling: proxy_quota_sync_and_jobs.rs ↔ UpstreamPrivacyStatusModule.tsx src/tavily_proxy/proxy_quota_sync_and_jobs.rs:1 — `src/tavily_proxy/proxy_quota_sync_and_jobs.rs` and `web/src/admin/UpstreamPrivacyStatusModule.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `5e0d812e` fix(reconciliation): classify Research poll outcomes (#559); `0ec27b1d` fix(reconciliation): resume multi-key observations; `89fd4b3e` fix(reconciliation): persist research timeout retries — run `git show` on any of them.
R4 · Test Coverage · No test reaches this file · ×8
  • No test reaches this file web/scripts/generate-icon-data.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/MarkdownEditor.storybook.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file docs-site/theme/index.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/public-main.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/admin-main.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/console-main.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/login-main.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/registration-paused-main.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) src/server/handlers/admin_resources/ha.rs:1286 — src/server/handlers/admin_resources/ha.rs:1286-1302 | src/server/handlers/admin_resources/ha.rs:1308-1328 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/store/sqlite_runtime.rs:1844 — src/store/sqlite_runtime.rs:1844-1861 | src/store/sqlite_runtime.rs:1863-1879 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/remote_attempt_admission.rs:179 — src/remote_attempt_admission.rs:179-196 | src/remote_attempt_admission.rs:212-228 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/models.rs:561 — src/models.rs:561-578 | src/models.rs:580-596 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/store/key_store_linuxdo_credit_recharge.rs:575 — src/store/key_store_linuxdo_credit_recharge.rs:575-591 | src/store/key_store_linuxdo_credit_recharge.rs:596-612 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/store/key_store_request_stats_coalescer.rs:262 — src/store/key_store_request_stats_coalescer.rs:262-278 | src/store/key_store_request_stats_coalescer.rs:321-346 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/server/handlers/tavily.rs:258 — src/server/handlers/tavily.rs:258-276 | src/server/proxy/mcp_helpers.rs:948-964 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×7
  • Duplicated block (21 lines × 2) src/bin/support/sqlite_sidecar.rs:202 — src/bin/support/sqlite_sidecar.rs:202-222 | REDACTED:17-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/support/sqlite_sidecar.rs:202` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/lib.rs:3133 — src/lib.rs:3133-3153 | src/lib.rs:3162-3182 — both copies are in the same file, so extract the 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 `src/lib.rs:3133` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/server/handlers/tavily.rs:448 — src/server/handlers/tavily.rs:448-468 | src/server/handlers/tavily.rs:885-905 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:1145 — src/server/proxy/proxy_handlers_and_views.rs:1145-1165 | src/server/proxy/proxy_handlers_and_views.rs:1177-1197 — both copies are in the same file, so extract the 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 `src/server/proxy/proxy_handlers_and_views.rs:1145` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) src/store/key_store_announcements.rs:502 — src/store/key_store_announcements.rs:502-522 | src/store/key_store_announcements.rs:658-678 — both copies are in the same file, so extract the 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 `src/store/key_store_announcements.rs:502` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:308 — src/store/key_store_dashboard_quota_recovery.rs:308-328 | src/store/key_store_dashboard_quota_recovery.rs:464-484 — both copies are in the same file, so extract the block into 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/store/key_store_schema_migrations_convergence.rs:914 — src/store/key_store_schema_migrations_convergence.rs:914-934 | src/store/key_store_schema_migrations_convergence.rs:1042-1070 — both copies are in the same file, so extract the 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 `src/store/key_store_schema_migrations_convergence.rs:914` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×7
  • Duplicated block (20 lines × 2) src/lib.rs:2779 — src/lib.rs:2779-2798 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:473-492 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) src/server/handlers/admin_resources/ha.rs:1831 — src/server/handlers/admin_resources/ha.rs:1831-1850 | src/server/handlers/admin_resources/ha.rs:2055-2074 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) src/store/key_store_announcements.rs:461 — src/store/key_store_announcements.rs:461-480 | src/store/key_store_announcements.rs:599-618 — both copies are in the same file, so extract the 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 `src/store/key_store_announcements.rs:461` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) src/store/mod.rs:1997 — src/store/mod.rs:1997-2016 | src/store/mod.rs:2028-2047 — both copies are in the same file, so extract the 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 `src/store/mod.rs:1997` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `row` to `RequestKindBackfillRequestLogRow` in one and `RequestKindBackfillTokenLogRow` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) src/store/sqlite_runtime.rs:3625 — src/store/sqlite_runtime.rs:3625-3644 | src/store/sqlite_runtime.rs:3687-3706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:1486 — src/tavily_proxy/proxy_http_and_logs.rs:1486-1505 | src/tavily_proxy/proxy_http_and_logs.rs:1751-1770 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:1486` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:2444 — src/store/key_store_dashboard_rollup_integrity.rs:2444-2463 | src/store/key_store_request_logs_and_dashboard.rs:191-231 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_dashboard_rollup_integrity.rs:2444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×7
  • Duplicated block (12 lines × 3) src/bin/observability_lock_holder.rs:22 — src/bin/observability_lock_holder.rs:22-33 | src/bin/support/sqlite_sidecar.rs:236-247 | src/store/mod.rs:1276-1287 — before extracting anything, compare `src/bin/support/sqlite_sidecar.rs` and `src/store/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/observability_lock_holder.rs:22` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) src/store/key_store_announcements.rs:508 — src/store/key_store_announcements.rs:508-519 | src/store/key_store_announcements.rs:548-559 | src/store/key_store_announcements.rs:664-675 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_announcements.rs:508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_announcements.rs:506` calls `bind` and `src/store/key_store_announcements.rs:546` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) src/store/key_store_keys.rs:1528 — src/store/key_store_keys.rs:1528-1541 | src/store/key_store_keys.rs:1576-1588 | src/store/key_store_keys.rs:1724-1735 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_keys.rs:1528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) src/store/key_store_token_logs.rs:326 — src/store/key_store_token_logs.rs:326-337 | src/store/key_store_token_logs.rs:360-371 | src/store/key_store_token_logs.rs:439-450 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_token_logs.rs:326` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_token_logs.rs:324` calls `Some` and `src/store/key_store_token_logs.rs:437` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) src/store/sqlite_runtime_cooperative.rs:38 — src/store/sqlite_runtime_cooperative.rs:38-49 | src/store/sqlite_runtime_cooperative.rs:216-227 | src/store/sqlite_runtime_cooperative.rs:234-245 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/sqlite_runtime_cooperative.rs:215` calls `Database` and `src/store/sqlite_runtime_cooperative.rs:37` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:497 — src/tavily_proxy/proxy_http_and_logs.rs:497-508 | src/tavily_proxy/proxy_http_and_logs.rs:1119-1130 | src/tavily_proxy/proxy_http_and_logs.rs:1414-1425 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:497` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tavily_proxy/proxy_http_and_logs.rs:1412` calls `redact_api_key_bytes` and `src/tavily_proxy/proxy_http_and_logs.rs:1117` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) src/store/key_store_admin_passkeys.rs:267 — src/store/key_store_admin_passkeys.rs:267-278 | src/store/key_store_admin_passkeys.rs:668-679 | src/store/key_store_admin_passkeys.rs:789-800 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_admin_passkeys.rs:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_admin_passkeys.rs:279` calls `admin_passkey_reset_token_hash` and `src/store/key_store_admin_passkeys.rs:680` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
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/models.rs:2310 — src/models.rs:2310-2324 | src/models.rs:2326-2345 | src/models.rs:2909-2918 | src/models.rs:3058-3075 — 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/server/handlers/public.rs:1412 — src/server/handlers/public.rs:1412-1524 | src/server/handlers/user.rs:2783-2819 | src/server/handlers/user.rs:2826-2874 | src/server/proxy/mcp_helpers.rs:48-80 — 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/server/schedulers.rs:867 — src/server/schedulers.rs:867-887 | src/server/schedulers.rs:889-909 | src/server/schedulers.rs:960-979 | src/server/schedulers.rs:981-1000 — 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/store/key_store_request_logs_and_dashboard.rs:989 — src/store/key_store_request_logs_and_dashboard.rs:989-1019 | src/store/key_store_request_logs_and_dashboard.rs:1026-1048 | src/store/key_store_token_logs.rs:948-1014 | src/store/key_store_token_logs.rs:1022-1084 — 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/store/sqlite_runtime.rs:2142 — src/store/sqlite_runtime.rs:2142-2178 | src/store/sqlite_runtime.rs:2183-2308 | src/store/sqlite_runtime.rs:2339-2414 | src/store/sqlite_runtime_cooperative.rs:258-368 — 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/store/sqlite_runtime.rs:3356 — src/store/sqlite_runtime.rs:3356-3387 | src/store/sqlite_runtime.rs:3621-3671 | src/store/sqlite_runtime.rs:3676-3738 | src/store/sqlite_runtime_cooperative.rs:31-249 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×6
  • Edited copy of a member (15 corresponding lines) src/store/key_store_alerts.rs:822 — src/store/key_store_alerts.rs:822-836 | src/store/key_store_alerts.rs:842-856 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/store/reconciliation_projection_controller.rs:698 — src/store/reconciliation_projection_controller.rs:698-714 | src/store/sqlite_runtime_maintenance_metrics.rs:351-365 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/ha.rs:1972 — src/ha.rs:1972-1986 | src/ha.rs:1988-2006 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/models.rs:170 — src/models.rs:170-185 | src/models.rs:187-201 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/server/handlers/public.rs:275 — src/server/handlers/public.rs:275-289 | src/server/handlers/public.rs:294-308 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/store/key_store_request_logs_and_dashboard.rs:2408 — src/store/key_store_request_logs_and_dashboard.rs:2408-2422 | src/store/key_store_upstream_reconciliation.rs:391-406 — 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 · Edited copy of a member (14 corresponding lines) · ×6
  • Edited copy of a member (14 corresponding lines) src/server/handlers/public.rs:1141 — src/server/handlers/public.rs:1141-1154 | src/server/handlers/public.rs:1156-1176 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/forward_proxy/responses_and_validation.rs:547 — src/forward_proxy/responses_and_validation.rs:547-560 | src/forward_proxy/responses_and_validation.rs:562-575 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/store/sqlite_runtime_maintenance_metrics.rs:100 — src/store/sqlite_runtime_maintenance_metrics.rs:100-113 | src/store/sqlite_runtime_maintenance_metrics.rs:133-146 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/store/key_store_keys.rs:1602 — src/store/key_store_keys.rs:1602-1615 | src/store/key_store_token_logs.rs:2055-2075 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/store/mod.rs:222 — src/store/mod.rs:222-235 | src/store/mod.rs:242-259 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/bin/mcp_session_delete_neutral_repair.rs:136 — src/bin/mcp_session_delete_neutral_repair.rs:136-150 | src/models.rs:2457-2470 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) src/server/schedulers.rs:1636 — src/server/schedulers.rs:1636-1651 | src/server/schedulers.rs:1662-1677 — both copies are in the same file, so extract the 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 `src/server/schedulers.rs:1662` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) src/store/key_store_alerts.rs:1064 — src/store/key_store_alerts.rs:1064-1079 | src/store/key_store_alerts.rs:1120-1135 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:1064` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:629 — src/store/key_store_dashboard_quota_recovery.rs:629-644 | src/store/key_store_request_logs_and_dashboard.rs:2318-2333 — before extracting anything, compare `src/store/key_store_dashboard_quota_recovery.rs` and `src/store/key_store_request_logs_and_dashboard.rs` as WHOLE FILES: this scan already matched 4 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 (16 lines × 2) src/store/sqlite_runtime_cooperative.rs:214 — src/store/sqlite_runtime_cooperative.rs:214-229 | src/store/sqlite_runtime_cooperative.rs:232-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime_cooperative.rs:214` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) src/server/handlers/admin_resources/ha.rs:133 — src/server/handlers/admin_resources/ha.rs:133-148 | src/server/serve.rs:1033-1048 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/ha.rs:133` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `perf` to `HaPerfEvent` in one and `HaSyncPerfEvent<'_>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/serve.rs:1049` calls `unwrap_or` and `src/server/handlers/admin_resources/ha.rs:149` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) src/server/handlers/admin_resources/recharges_and_totp.rs:289 — src/server/handlers/admin_resources/recharges_and_totp.rs:289-304 | src/server/handlers/admin_resources/recharges_and_totp.rs:313-328 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/recharges_and_totp.rs:289` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • Duplicated block (11–12 lines × 2) src/forward_proxy/relay_and_xray.rs:963 — src/forward_proxy/relay_and_xray.rs:963-973 | src/forward_proxy/relay_and_xray.rs:994-1005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/forward_proxy/relay_and_xray.rs:992` calls `run_shared_api_command`, `from_ref` and `src/forward_proxy/relay_and_xray.rs:962` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:350 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:350-360 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:581-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) src/store/key_store_alerts.rs:1333 — src/store/key_store_alerts.rs:1333-1343 | src/store/key_store_alerts.rs:1850-1861 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:1850` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1061 — src/store/key_store_request_logs_and_dashboard.rs:1061-1071 | src/store/key_store_request_logs_and_dashboard.rs:1154-1165 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_and_dashboard.rs:1061` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) src/store/key_store_upstream_reconciliation.rs:1990 — src/store/key_store_upstream_reconciliation.rs:1990-2001 | src/store/key_store_upstream_reconciliation.rs:2045-2055 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:1990` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) src/store/reconciliation_projection_controller.rs:269 — src/store/reconciliation_projection_controller.rs:269-279 | src/store/reconciliation_projection_controller.rs:514-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/reconciliation_projection_controller.rs:269` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×6
  • Duplicated block (9 lines × 3) src/server/handlers/tavily.rs:1121 — src/server/handlers/tavily.rs:1121-1129 | src/server/handlers/tavily.rs:1410-1418 | src/server/proxy/proxy_handlers_and_views.rs:1679-1687 — before extracting anything, compare `src/server/handlers/tavily.rs` and `src/server/proxy/proxy_handlers_and_views.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:1121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/store/key_store_alert_canonical_groups.rs:1948 — src/store/key_store_alert_canonical_groups.rs:1948-1956 | src/store/key_store_alert_canonical_groups.rs:2030-2038 | src/store/key_store_alert_canonical_groups.rs:2129-2137 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:1948` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/store/key_store_request_logs_and_dashboard.rs:576 — src/store/key_store_request_logs_and_dashboard.rs:576-584 | src/store/key_store_token_logs.rs:117-125 | src/store/key_store_token_logs.rs:129-137 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) src/store/key_store_upstream_reconciliation.rs:1340 — src/store/key_store_upstream_reconciliation.rs:1340-1348 | src/store/key_store_upstream_reconciliation.rs:1425-1433 | src/store/key_store_upstream_reconciliation_research.rs:702-710 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:851 — src/tavily_proxy/proxy_http_and_logs.rs:851-859 | src/tavily_proxy/proxy_http_and_logs.rs:1126-1134 | src/tavily_proxy/proxy_http_and_logs.rs:1700-1708 — 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/models.rs:2316 — src/models.rs:2316-2324 | src/models.rs:2337-2345 | src/models.rs:2910-2918 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/models.rs:2316` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
IC1 · Incompleteness & stubs · Empty method body · ×6
  • Empty method body — does nothing with its inputs src/observability.rs:424 — `set_request_operation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs src/server/state.rs:1537 — `emit_admin_privacy_status_prewarm_deferred` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs src/store/key_store_upstream_reconciliation.rs:2672 — `emit_shadow_adjustment_written_log` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs src/store/mod.rs:237 — `log_db_operation_error` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs src/store/sqlite_contention_logging.rs:13 — `log_sqlite_transient_write_retry_with_fields` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs src/store/sqlite_contention_logging.rs:51 — `log_sqlite_transient_write_exhaustion_with_fields` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×5
  • Focus outline removed in CSS without a :focus replacement web/src/styles/admin-announcements.css:179 — `.markdown-editor-shell .ProseMirror` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/styles/admin-announcements.css:249 — `.markdown-editor-storybook-input:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/styles/base.css:155 — `.btn:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/styles/base.css:265 — `.input:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/styles/dark.css:1826 — `.forward-proxy-error-pie-slice:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D2 · Cognitive Complexity · AdminDashboardRuntime.AdminDashboard · ×5
  • AdminDashboardRuntime.AdminDashboard::handleManualRefresh (cognitive 32) web/src/admin/AdminDashboardRuntime.tsx:5167 — AdminDashboardRuntime.AdminDashboard::handleManualRefresh has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 13, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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. This shape REPEATS in the file: 5 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys (cognitive 32) web/src/admin/AdminDashboardRuntime.tsx:6373 — AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (6 pts), boolean chains 5, ternaries 2 (3 pts), error handling 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. This shape REPEATS in the file: 5 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • AdminDashboardRuntime.AdminDashboard::renderUserTagCatalogCard (cognitive 23) web/src/admin/AdminDashboardRuntime.tsx:8072 — AdminDashboardRuntime.AdminDashboard::renderUserTagCatalogCard has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 7 (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. This shape REPEATS in the file: 5 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog (cognitive 19) web/src/admin/AdminDashboardRuntime.tsx:7022 — AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 5 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • AdminDashboardRuntime.AdminDashboard::renderAdminGlobalOverlayHost (cognitive 18) web/src/admin/AdminDashboardRuntime.tsx:8457 — AdminDashboardRuntime.AdminDashboard::renderAdminGlobalOverlayHost has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) src/store/mod.rs:1990 — src/store/mod.rs:1990-2016 | src/store/mod.rs:2020-2047 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) src/tavily_proxy/proxy_request_limits.rs:1760 — src/tavily_proxy/proxy_request_limits.rs:1760-1788 | src/tavily_proxy/proxy_usage_and_metrics.rs:360-386 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) src/bin/mcp_request_log_retry_repair.rs:346 — src/bin/mcp_request_log_retry_repair.rs:346-373 | src/bin/mcp_search_billing_repair.rs:444-470 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2712 — src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2712-2738 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2743-2773 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) src/store/key_store_linuxdo_credit_recharge.rs:890 — src/store/key_store_linuxdo_credit_recharge.rs:890-918 | src/store/key_store_linuxdo_credit_recharge.rs:1222-1248 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×5
  • Edited copy of a member (20 corresponding lines) src/analysis.rs:432 — src/analysis.rs:432-451 | src/analysis.rs:453-475 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/server/handlers/user.rs:1035 — src/server/handlers/user.rs:1035-1054 | src/server/handlers/user.rs:2691-2710 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/forward_proxy/responses_and_validation.rs:423 — src/forward_proxy/responses_and_validation.rs:423-442 | src/forward_proxy/responses_and_validation.rs:447-467 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/server/schedulers.rs:1002 — src/server/schedulers.rs:1002-1023 | src/server/schedulers.rs:1808-1827 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:152 — REDACTED:152-176 | REDACTED:736-755 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×5
  • Edited copy of a member (21 corresponding lines) src/server/dto.rs:2557 — src/server/dto.rs:2557-2577 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1287-1313 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) src/store/reconciliation_projection_controller.rs:634 — src/store/reconciliation_projection_controller.rs:634-654 | src/store/reconciliation_projection_controller.rs:659-681 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) src/store/key_store_linuxdo_credit_recharge.rs:1723 — src/store/key_store_linuxdo_credit_recharge.rs:1723-1744 | src/store/key_store_linuxdo_credit_recharge.rs:1826-1846 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) src/store/mod.rs:1903 — src/store/mod.rs:1903-1923 | src/store/mod.rs:1927-1947 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) src/store/key_store_request_logs_and_dashboard.rs:2572 — src/store/key_store_request_logs_and_dashboard.rs:2572-2592 | src/store/key_store_request_logs_and_dashboard.rs:2655-2676 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×5
  • Edited copy of a member (9 corresponding lines) src/store/immediate_transaction.rs:44 — src/store/immediate_transaction.rs:44-53 | src/store/immediate_transaction.rs:153-161 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/server/handlers/admin_auth.rs:862 — src/server/handlers/admin_auth.rs:862-870 | src/server/handlers/admin_auth.rs:872-880 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/lib.rs:2768 — src/lib.rs:2768-2776 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:462-470 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:161 — REDACTED:161-169 | src/store/mod.rs:1095-1103 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:171 — REDACTED:171-179 | src/store/mod.rs:1212-1220 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×5
  • Duplicated block (30 lines × 2) src/bin/support/sqlite_sidecar.rs:20 — src/bin/support/sqlite_sidecar.rs:20-49 | src/store/mod.rs:1241-1270 — before extracting anything, compare `src/bin/support/sqlite_sidecar.rs` and `src/store/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/support/sqlite_sidecar.rs:20` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (30 lines × 2) src/lib.rs:2696 — src/lib.rs:2696-2725 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:410-439 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (30 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:552 — src/store/key_store_dashboard_quota_recovery.rs:552-581 | src/store/key_store_request_logs_and_dashboard.rs:2258-2287 — before extracting anything, compare `src/store/key_store_dashboard_quota_recovery.rs` and `src/store/key_store_request_logs_and_dashboard.rs` as WHOLE FILES: this scan already matched 4 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 (30 lines × 2) src/store/key_store_token_logs.rs:316 — src/store/key_store_token_logs.rs:316-345 | src/store/key_store_token_logs.rs:350-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (30 lines × 2) src/store/mod.rs:2065 — src/store/mod.rs:2065-2094 | src/store/mod.rs:2240-2270 — both copies are in the same file, so extract the 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 `src/store/mod.rs:2065` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×5
  • Duplicated block (14 lines × 3) src/lib.rs:1086 — src/lib.rs:1086-1099 | src/lib.rs:1103-1116 | src/lib.rs:1121-1134 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lib.rs:1086` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) src/server/dto.rs:1965 — src/server/dto.rs:1965-1978 | src/server/dto.rs:2093-2106 | src/server/dto.rs:2164-2177 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/server/dto.rs:1963` calls `unwrap_or`, `max`, `clamp` and `src/server/dto.rs:2163` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 3) src/server/handlers/tavily.rs:687 — src/server/handlers/tavily.rs:687-700 | src/server/handlers/tavily.rs:1308-1321 | src/server/handlers/tavily.rs:1591-1604 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:687` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 3) src/tavily_proxy/proxy_request_limits.rs:481 — src/tavily_proxy/proxy_request_limits.rs:481-494 | src/tavily_proxy/proxy_request_limits.rs:1163-1176 | src/tavily_proxy/proxy_request_limits.rs:1209-1222 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_request_limits.rs:481` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:203 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:203-216 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:265-278 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:335-348 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) src/server/handlers/public.rs:1516 — src/server/handlers/public.rs:1516-1521 | src/server/handlers/user.rs:2812-2817 | src/server/handlers/user.rs:2867-2872 — before extracting anything, compare `src/server/handlers/public.rs` and `src/server/handlers/user.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/public.rs:1516` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) src/store/key_store_upstream_reconciliation.rs:169 — src/store/key_store_upstream_reconciliation.rs:169-174 | src/store/key_store_upstream_reconciliation.rs:915-920 | src/store/key_store_upstream_reconciliation.rs:939-944 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_upstream_reconciliation.rs:169` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) src/store/sqlite_runtime.rs:3656 — src/store/sqlite_runtime.rs:3656-3661 | src/store/sqlite_runtime.rs:3664-3669 | src/store/sqlite_runtime.rs:3731-3736 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:3656` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) src/forward_proxy/storage.rs:393 — src/forward_proxy/storage.rs:393-398 | src/forward_proxy/storage.rs:470-475 | src/forward_proxy/storage.rs:541-546 — 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/forward_proxy/responses_and_validation.rs:696 — src/forward_proxy/responses_and_validation.rs:696-701 | src/forward_proxy/responses_and_validation.rs:702-707 | src/forward_proxy/responses_and_validation.rs:725-730 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/forward_proxy/responses_and_validation.rs:696` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · AdminDashboardRuntime.AdminDashboard · ×4
  • AdminDashboardRuntime.AdminDashboard::handleManualRefresh (cyclomatic 32) web/src/admin/AdminDashboardRuntime.tsx:5167 — AdminDashboardRuntime.AdminDashboard::handleManualRefresh 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. This shape REPEATS in the file: 4 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys (cyclomatic 24) web/src/admin/AdminDashboardRuntime.tsx:6373 — AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys 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: 4 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • AdminDashboardRuntime.AdminDashboard::renderUserTagCatalogCard (cyclomatic 24) web/src/admin/AdminDashboardRuntime.tsx:8072 — AdminDashboardRuntime.AdminDashboard::renderUserTagCatalogCard has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 4 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog (cyclomatic 18) web/src/admin/AdminDashboardRuntime.tsx:7022 — AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog 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. This shape REPEATS in the file: 4 other methods here (AdminDashboardRuntime.AdminDashboard, AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
D3 · God Classes · TooManyMethods · ×4
  • TooManyMethods: KeyStore src/store/mod.rs:2731 — TooManyMethods — 1188 methods, declared across 62 files: store/key_store_keys.rs (86), store/key_store_sessions.rs (71), store/key_store_token_logs.rs (61), store/key_store_upstream_reconciliation.rs (61), +58 more file(s). The bar is 30 methods; this is 1158 over it, 39.60× 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: TavilyProxy src/tavily_proxy/mod.rs:876 — TooManyMethods — 705 methods, declared across 18 files: tavily_proxy/proxy_auth_and_oauth.rs (134), tavily_proxy/proxy_core.rs (93), tavily_proxy/proxy_request_limits.rs (87), tavily_proxy/proxy_quota_sync_and_jobs.rs (78), +14 more file(s). The bar is 30 methods; this is 675 over it, 23.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SqliteRuntime src/store/sqlite_runtime.rs:1102 — TooManyMethods — 82 methods, declared across 2 files: store/sqlite_runtime.rs (81), store/sqlite_runtime_cooperative.rs (1). The bar is 30 methods; this is 52 over it, 2.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HaRuntime src/ha.rs:714 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×4
  • Edited copy of a member (28 corresponding lines) src/forward_proxy/responses_and_validation.rs:1367 — src/forward_proxy/responses_and_validation.rs:1367-1399 | src/forward_proxy/responses_and_validation.rs:1401-1428 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:23 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:23-50 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:57-88 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) src/server/handlers/admin_resources/admin_user_views_and_sort.rs:376 — src/server/handlers/admin_resources/admin_user_views_and_sort.rs:376-404 | src/server/handlers/user.rs:1316-1343 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) src/store/key_store_request_logs_gc.rs:602 — src/store/key_store_request_logs_gc.rs:602-629 | src/store/key_store_request_logs_gc.rs:635-672 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) src/server/handlers/admin_resources/announcements.rs:104 — src/server/handlers/admin_resources/announcements.rs:104-126 | src/server/handlers/admin_resources/announcements.rs:131-153 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) src/server/handlers/admin_resources/ha.rs:334 — src/server/handlers/admin_resources/ha.rs:334-357 | src/server/handlers/admin_resources/ha.rs:365-387 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) src/store/sqlite_runtime.rs:717 — src/store/sqlite_runtime.rs:717-739 | src/store/sqlite_runtime.rs:741-763 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) src/tavily_proxy/proxy_http_and_logs.rs:2046 — src/tavily_proxy/proxy_http_and_logs.rs:2046-2069 | src/tavily_proxy/proxy_http_and_logs.rs:2123-2145 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) src/server/handlers/public.rs:1813 — src/server/handlers/public.rs:1813-1820 | src/server/handlers/user.rs:1654-1661 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/bin/support/sqlite_sidecar.rs:224 — src/bin/support/sqlite_sidecar.rs:224-231 | src/store/mod.rs:1222-1229 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/server/handlers/tavily.rs:113 — src/bin/mock_tavily.rs:226-233 | src/server/handlers/tavily.rs:113-120 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/store/key_store_users_and_oauth.rs:449 — src/store/key_store_users_and_oauth.rs:449-462 | src/store/key_store_keys.rs:1631-1638 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) src/analysis.rs:2156 — src/analysis.rs:2156-2177 | src/analysis.rs:2214-2235 — both copies are in the same file, so extract the block into 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/store/key_store_alert_canonical_groups.rs:1880 — src/store/key_store_alert_canonical_groups.rs:1880-1901 | src/store/key_store_alert_canonical_groups.rs:2061-2082 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:1880` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) src/store/key_store_alert_canonical_groups.rs:1982 — src/store/key_store_alert_canonical_groups.rs:1982-2003 | src/store/key_store_alert_canonical_groups.rs:2157-2178 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:1982` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) src/store/key_store_keys.rs:1529 — src/store/key_store_keys.rs:1529-1550 | src/store/key_store_keys.rs:1576-1597 — both copies are in the same file, so extract the 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 `src/store/key_store_keys.rs:1529` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×4
  • Duplicated block (16 lines × 3) src/server/dto.rs:1616 — src/server/dto.rs:1616-1631 | src/server/dto.rs:2063-2078 | src/server/handlers/admin_resources/api_keys_and_logs.rs:871-886 — before extracting anything, compare `src/server/dto.rs` and `src/server/handlers/admin_resources/api_keys_and_logs.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/dto.rs:1616` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) src/server/dto.rs:1651 — src/server/dto.rs:1651-1666 | src/server/dto.rs:1705-1720 | src/server/handlers/admin_resources/api_keys_and_logs.rs:974-989 — before extracting anything, compare `src/server/dto.rs` and `src/server/handlers/admin_resources/api_keys_and_logs.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/dto.rs:1651` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) src/server/dto.rs:1982 — src/server/dto.rs:1982-1997 | src/server/dto.rs:2112-2127 | src/server/dto.rs:2181-2196 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/dto.rs:1982` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) src/store/mod.rs:2116 — src/store/mod.rs:2116-2131 | src/store/mod.rs:2293-2308 | src/store/mod.rs:2518-2533 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/mod.rs:2116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×4
  • Duplicated block (15 lines × 3) src/server/proxy/proxy_handlers_and_views.rs:1419 — src/server/proxy/proxy_handlers_and_views.rs:1419-1433 | src/server/proxy/proxy_handlers_and_views.rs:1438-1452 | src/server/proxy/proxy_handlers_and_views.rs:1497-1511 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/proxy_handlers_and_views.rs:1419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) src/server/state.rs:983 — src/server/state.rs:983-997 | src/server/state.rs:1004-1018 | src/server/state.rs:1025-1039 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/state.rs:983` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:631 — src/tavily_proxy/proxy_http_and_logs.rs:631-645 | src/tavily_proxy/proxy_http_and_logs.rs:1549-1563 | src/tavily_proxy/proxy_http_and_logs.rs:1815-1829 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:631` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:1570 — src/tavily_proxy/proxy_http_and_logs.rs:1570-1584 | src/tavily_proxy/proxy_http_and_logs.rs:1747-1761 | src/tavily_proxy/proxy_http_and_logs.rs:1836-1850 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:1570` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×4
  • Duplicated block (12–13 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:443 — src/store/key_store_dashboard_rollup_integrity.rs:443-454 | src/store/key_store_dashboard_rollup_integrity.rs:941-953 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_rollup_integrity.rs:443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:440 — src/store/key_store_dashboard_rollup_integrity.rs:440-452 | src/store/key_store_dashboard_rollup_integrity.rs:2938-2949 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_rollup_integrity.rs:440` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1465 — src/store/key_store_request_logs_and_dashboard.rs:1465-1476 | src/store/key_store_token_logs.rs:595-607 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 2) src/store/key_store_upstream_reconciliation.rs:2897 — src/store/key_store_upstream_reconciliation.rs:2897-2909 | src/store/key_store_upstream_reconciliation.rs:2967-2978 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2897` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×4
  • Duplicated block (10–11 lines × 2) src/server/handlers/public.rs:872 — src/server/handlers/public.rs:872-882 | src/server/handlers/user.rs:2539-2548 — before extracting anything, compare `src/server/handlers/public.rs` and `src/server/handlers/user.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/public.rs:872` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1478 — src/store/key_store_request_logs_and_dashboard.rs:1478-1488 | src/store/key_store_token_logs.rs:609-618 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:1478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) src/store/sqlite_runtime.rs:2143 — src/store/sqlite_runtime.rs:2143-2152 | src/store/sqlite_runtime.rs:2340-2350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) src/store/sqlite_runtime_cooperative.rs:301 — src/store/sqlite_runtime_cooperative.rs:301-311 | src/store/sqlite_runtime_cooperative.rs:347-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime_cooperative.rs:301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) src/server/handlers/admin_resources/ha.rs:739 — src/server/handlers/admin_resources/ha.rs:739-748 | src/server/handlers/admin_resources/ha.rs:856-865 | src/server/handlers/admin_resources/ha.rs:895-904 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/ha.rs:739` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/admin_resources/ha.rs:866` calls `iter`, `enumerate` and `src/server/handlers/admin_resources/ha.rs:749` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) src/store/key_store_alerts.rs:1049 — src/store/key_store_alerts.rs:1049-1058 | src/store/key_store_alerts.rs:1189-1198 | src/store/key_store_alerts.rs:1326-1335 — 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/store/sqlite_runtime.rs:4156 — src/store/sqlite_runtime.rs:4156-4165 | src/store/sqlite_runtime.rs:4201-4210 | src/store/sqlite_runtime.rs:4266-4275 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:4156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn rollback(mut` in one and `crate) async fn finish( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 3) src/bin/ha_outbox_cleanup_once.rs:214 — src/bin/ha_outbox_cleanup_once.rs:214-223 | src/bin/request_logs_gc_once.rs:58-67 | src/bin/request_statistics_recovery_once.rs:58-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×3
  • Edited copy of a member (53 corresponding lines) src/analysis.rs:2155 — src/analysis.rs:2155-2207 | src/analysis.rs:2213-2267 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) src/store/key_store_alert_canonical_groups.rs:399 — src/store/key_store_alert_canonical_groups.rs:399-451 | src/store/key_store_alert_canonical_groups.rs:1313-1372 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) src/store/key_store_keys.rs:870 — src/store/key_store_keys.rs:870-922 | src/store/key_store_keys.rs:927-979 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×3
  • Edited copy of a member (35 corresponding lines) src/store/key_store_alert_canonical_semantic_reduction.rs:703 — src/store/key_store_alert_canonical_semantic_reduction.rs:703-743 | src/store/key_store_alert_canonical_semantic_reduction.rs:745-779 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) src/server/handlers/admin_resources/ha.rs:1494 — src/server/handlers/admin_resources/ha.rs:1494-1528 | src/server/handlers/admin_resources/ha.rs:1534-1568 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) src/store/key_store_keys.rs:2323 — src/store/key_store_keys.rs:2323-2370 | src/store/key_store_request_logs_and_dashboard.rs:2187-2221 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×3
  • Edited copy of a member (26 corresponding lines) src/server/handlers/admin_resources/ha.rs:950 — src/server/handlers/admin_resources/ha.rs:950-976 | src/server/handlers/admin_resources/ha.rs:1201-1226 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) src/server/handlers/admin_resources/recharges_and_totp.rs:843 — src/server/handlers/admin_resources/recharges_and_totp.rs:843-868 | src/server/handlers/user.rs:450-482 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) src/store/key_store_account_usage_rollups.rs:163 — src/store/key_store_account_usage_rollups.rs:163-195 | src/store/key_store_request_logs_and_dashboard.rs:246-271 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) src/store/key_store_upstream_reconciliation.rs:1762 — src/store/key_store_upstream_reconciliation.rs:1762-1798 | src/store/key_store_upstream_reconciliation.rs:1803-1852 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) src/store/key_store_admin_passkeys.rs:834 — src/store/key_store_admin_passkeys.rs:834-870 | src/store/key_store_alert_projection.rs:151-202 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) src/store/key_store_keys.rs:1125 — src/store/key_store_keys.rs:1125-1161 | src/store/key_store_users_and_oauth.rs:2365-2403 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×3
  • Edited copy of a member (25 corresponding lines) src/server/handlers/admin_resources/ha.rs:1749 — src/server/handlers/admin_resources/ha.rs:1749-1773 | src/server/handlers/admin_resources/ha.rs:1780-1808 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) src/server/handlers/admin_resources/recharges_and_totp.rs:535 — src/server/handlers/admin_resources/recharges_and_totp.rs:535-561 | src/server/schedulers.rs:2123-2147 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) src/bin/mcp_session_delete_neutral_repair.rs:317 — src/bin/mcp_session_delete_neutral_repair.rs:317-341 | src/bin/mcp_session_delete_neutral_repair.rs:378-406 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) src/server/handlers/admin_resources/recharges_and_totp.rs:275 — src/server/handlers/admin_resources/recharges_and_totp.rs:275-304 | src/server/handlers/admin_resources/recharges_and_totp.rs:310-328 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) src/server/dto.rs:1314 — src/server/dto.rs:1314-1332 | src/server/dto.rs:1350-1373 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) src/store/key_store_admin_passkeys.rs:56 — src/store/key_store_admin_passkeys.rs:56-74 | src/store/key_store_keys.rs:2161-2202 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×3
  • Edited copy of a member (30 corresponding lines) src/analysis.rs:364 — src/analysis.rs:364-394 | src/analysis.rs:397-426 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) src/observability.rs:654 — src/observability.rs:654-683 | src/observability.rs:693-728 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) src/forward_proxy/storage.rs:1232 — src/forward_proxy/storage.rs:1232-1263 | src/forward_proxy/storage.rs:1269-1298 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) src/lib.rs:2107 — src/lib.rs:2107-2124 | src/main.rs:1013-1024 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/server/proxy/mcp_helpers.rs:992 — src/server/proxy/mcp_helpers.rs:992-1003 | src/server/proxy/mcp_helpers.rs:1009-1028 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/linuxdo_credit_recharge.rs:328 — src/linuxdo_credit_recharge.rs:328-339 | src/server/handlers/admin_resources/recharges_and_totp.rs:675-689 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 13+ corresponding lines) src/linuxdo_credit_recharge.rs:534 — src/linuxdo_credit_recharge.rs:534-546 | src/server/handlers/public.rs:1796-1808 | src/server/handlers/user.rs:1637-1649 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) src/store/key_store_upstream_reconciliation.rs:152 — src/store/key_store_upstream_reconciliation.rs:152-174 | src/store/key_store_upstream_reconciliation.rs:927-944 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:50-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) src/server/handlers/admin_resources/api_keys_and_logs.rs:698 — src/server/handlers/admin_resources/api_keys_and_logs.rs:698-710 | src/server/handlers/admin_resources/api_keys_and_logs.rs:751-764 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1687-1701 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 14+ corresponding lines) src/server/handlers/admin_resources/announcements.rs:48 — src/server/handlers/admin_resources/announcements.rs:48-61 | src/server/handlers/admin_resources/announcements.rs:67-80 | src/server/handlers/admin_resources/announcements.rs:86-99 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) src/server/dto.rs:1511 — src/server/dto.rs:1511-1524 | src/server/dto.rs:2224-2237 | src/server/dto.rs:2243-2256 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) src/server/state.rs:1988 — src/server/state.rs:1988-2001 | src/server/state.rs:2053-2070 | src/server/state.rs:2118-2135 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 14+ corresponding lines) src/store/mod.rs:77 — src/store/mod.rs:77-90 | src/store/mod.rs:94-107 | src/store/mod.rs:109-122 | src/store/mod.rs:126-141 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:317 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:317-330 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:4-17 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:94-107 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:137-153 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) src/store/key_store_ha_watermarks.rs:85 — src/store/key_store_ha_watermarks.rs:85-98 | src/store/key_store_ha_watermarks.rs:105-132 | src/store/key_store_ha_watermarks.rs:137-150 | src/store/key_store_ha_watermarks.rs:157-184 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×3
  • Edited copy of a member (7 corresponding lines) src/forward_proxy/responses_and_validation.rs:751 — src/forward_proxy/responses_and_validation.rs:751-757 | src/forward_proxy/responses_and_validation.rs:759-765 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/server/proxy/mcp_helpers.rs:1245 — src/server/proxy/mcp_helpers.rs:1245-1255 | src/bin/mock_tavily.rs:235-241 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) REDACTED:1474 — REDACTED:1474-1480 | src/store/key_store_ha_defs.rs:292-298 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 11+ corresponding lines) src/models.rs:2961 — src/models.rs:2961-2971 | src/server/handlers/public.rs:1773-1783 | src/tavily_proxy/proxy_request_limits.rs:1982-1993 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) src/server/handlers/tavily.rs:278 — src/server/handlers/tavily.rs:278-288 | src/server/proxy/mcp_helpers.rs:573-584 | src/server/proxy/proxy_handlers_and_views.rs:1934-1946 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) src/store/key_store_meta.rs:125 — src/store/key_store_meta.rs:125-138 | src/store/key_store_token_logs.rs:1912-1925 | src/store/key_store_users_and_oauth.rs:1238-1248 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) src/bin/monthly_quota_rebase.rs:21 — src/bin/monthly_quota_rebase.rs:21-30 | src/bin/request_kind_canonical_backfill.rs:27-35 | src/bin/request_user_id_backfill.rs:22-29 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) src/server/handlers/tavily.rs:104 — src/bin/mock_edgeone_ingress.rs:59-66 | src/bin/mock_tavily.rs:217-224 | src/server/handlers/tavily.rs:104-111 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) src/forward_proxy/responses_and_validation.rs:1770 — src/forward_proxy/responses_and_validation.rs:1770-1777 | src/observability.rs:1528-1537 | src/server/serve.rs:1679-1689 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) src/forward_proxy/storage.rs:595 — src/forward_proxy/storage.rs:595-610 | src/forward_proxy/storage.rs:616-631 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/lib.rs:663 — src/lib.rs:663-681 | src/tavily_proxy/proxy_quota_sync_and_jobs.rs:2824-2839 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/tavily_proxy/mod.rs:2318 — src/tavily_proxy/mod.rs:2318-2334 | src/tavily_proxy/mod.rs:2357-2372 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×3
  • Duplicated block (33 lines × 2) src/server/handlers/tavily.rs:672 — src/server/handlers/tavily.rs:672-704 | src/server/handlers/tavily.rs:1576-1608 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:672` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (33 lines × 2) src/store/key_store_token_logs.rs:729 — src/store/key_store_token_logs.rs:729-761 | src/store/key_store_token_logs.rs:810-842 — both copies are in the same file, so extract the 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 `src/store/key_store_token_logs.rs:729` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (33 lines × 2) src/tavily_proxy/reconciliation_engine.rs:1116 — src/tavily_proxy/reconciliation_engine.rs:1116-1148 | src/tavily_proxy/reconciliation_engine.rs:1305-1337 — both copies are in the same file, so extract the 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 `src/tavily_proxy/reconciliation_engine.rs:1116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tavily_proxy/reconciliation_engine.rs:1115` calls `header` and `src/tavily_proxy/reconciliation_engine.rs:1304` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×3
  • Duplicated block (31 lines × 2) src/server/serve.rs:1149 — src/server/serve.rs:1149-1179 | src/server/serve.rs:1486-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 (31 lines × 2) src/store/key_store_token_logs.rs:503 — src/store/key_store_token_logs.rs:503-533 | src/store/key_store_token_logs.rs:782-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_token_logs.rs:503` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (31 lines × 2) src/tavily_proxy/reconciliation_engine.rs:1076 — src/tavily_proxy/reconciliation_engine.rs:1076-1106 | src/tavily_proxy/reconciliation_engine.rs:1267-1297 — both copies are in the same file, so extract the 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 `src/tavily_proxy/reconciliation_engine.rs:1076` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tavily_proxy/reconciliation_engine.rs:1075` calls `header` and `src/tavily_proxy/reconciliation_engine.rs:1266` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×3
  • Duplicated block (29 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:731 — src/server/proxy/proxy_handlers_and_views.rs:731-759 | src/server/proxy/proxy_handlers_and_views.rs:784-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/proxy_handlers_and_views.rs:784` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:504 — src/store/key_store_request_logs_and_dashboard.rs:504-532 | src/store/key_store_request_logs_and_dashboard.rs:853-881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:504` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) src/server/handlers/tavily.rs:410 — src/server/handlers/tavily.rs:410-438 | src/server/handlers/tavily.rs:757-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:200 — src/server/proxy/proxy_handlers_and_views.rs:200-224 | src/server/proxy/proxy_handlers_and_views.rs:298-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/proxy_handlers_and_views.rs:298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (25 lines × 2) src/server/handlers/admin_resources/alerts.rs:126 — src/server/handlers/admin_resources/alerts.rs:126-150 | src/server/handlers/admin_resources/alerts.rs:231-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) src/store/key_store_token_logs.rs:1047 — src/store/key_store_token_logs.rs:1047-1071 | src/store/key_store_token_logs.rs:1154-1178 — both copies are in the same file, so extract the 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 (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) src/lib.rs:2811 — src/lib.rs:2811-2834 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:511-534 — before extracting anything, compare `src/lib.rs` and `src/server/handlers/admin_resources/versions_and_proxy_helpers.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lib.rs:2811` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:536 — src/store/key_store_request_logs_and_dashboard.rs:536-559 | src/store/key_store_request_logs_and_dashboard.rs:876-899 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_and_dashboard.rs:536` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) src/store/mod.rs:2112 — src/store/mod.rs:2112-2135 | src/store/mod.rs:2289-2312 — both copies are in the same file, so extract the 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 `src/store/mod.rs:2112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) src/server/handlers/admin_resources/ha.rs:1909 — src/server/handlers/admin_resources/ha.rs:1909-1931 | src/server/handlers/admin_resources/ha.rs:1977-1999 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/ha.rs:1909` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) src/bin/mcp_request_log_retry_repair.rs:153 — src/bin/mcp_request_log_retry_repair.rs:153-175 | src/bin/mcp_request_log_retry_repair.rs:206-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/mcp_request_log_retry_repair.rs:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/bin/mcp_request_log_retry_repair.rs:205` calls `bind`, `saturating_add` and `src/bin/mcp_request_log_retry_repair.rs:152` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (23 lines × 2) scripts/perf-local-boundaries.py:4081 — scripts/perf-local-boundaries.py:4081-4103 | scripts/perf-local-boundaries.py:4450-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. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/perf-local-boundaries.py:4081` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) src/store/key_store_account_limit_snapshots.rs:161 — src/store/key_store_account_limit_snapshots.rs:161-179 | src/store/key_store_account_limit_snapshots.rs:198-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_account_limit_snapshots.rs:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_account_limit_snapshots.rs:196` calls `bind` and `src/store/key_store_account_limit_snapshots.rs:159` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1432 — src/store/key_store_request_logs_and_dashboard.rs:1432-1450 | src/store/key_store_token_logs.rs:562-580 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:1432` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 2) src/server/schedulers.rs:2808 — src/server/schedulers.rs:2808-2826 | src/server/schedulers.rs:2851-2869 — both copies are in the same file, so extract the 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 `src/server/schedulers.rs:2808` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×3
  • Duplicated block (17 lines × 3) src/server/proxy/proxy_handlers_and_views.rs:1212 — src/server/proxy/proxy_handlers_and_views.rs:1212-1228 | src/server/proxy/proxy_handlers_and_views.rs:1272-1288 | src/server/proxy/proxy_handlers_and_views.rs:1318-1334 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (17 lines × 3) src/store/key_store_linuxdo_credit_recharge.rs:927 — src/store/key_store_linuxdo_credit_recharge.rs:927-943 | src/store/key_store_linuxdo_credit_recharge.rs:1154-1170 | src/store/key_store_linuxdo_credit_recharge.rs:1255-1271 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (17 lines × 3) src/store/key_store_request_logs_and_dashboard.rs:909 — src/store/key_store_request_logs_and_dashboard.rs:909-925 | src/store/key_store_request_logs_and_dashboard.rs:1748-1764 | src/store/key_store_token_logs.rs:841-857 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:909` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×3
  • Duplicated block (15–17 lines × 2) src/store/key_store_alerts.rs:2037 — src/store/key_store_alerts.rs:2037-2051 | src/store/key_store_alerts.rs:2151-2167 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:2037` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–17 lines × 2) src/store/key_store_upstream_reconciliation_research.rs:446 — src/store/key_store_upstream_reconciliation_research.rs:446-460 | src/store/key_store_upstream_reconciliation_research.rs:528-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15–17 lines × 2) src/store/sqlite_runtime.rs:2185 — src/store/sqlite_runtime.rs:2185-2199 | src/store/sqlite_runtime_cooperative.rs:272-288 — before extracting anything, compare `src/store/sqlite_runtime.rs` and `src/store/sqlite_runtime_cooperative.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:2185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×3
  • Duplicated block (13 lines × 4) src/store/key_store_request_logs_and_dashboard.rs:1007 — src/store/key_store_request_logs_and_dashboard.rs:1007-1019 | src/store/key_store_request_logs_and_dashboard.rs:1036-1048 | src/store/key_store_token_logs.rs:1002-1014 | src/store/key_store_token_logs.rs:1072-1084 — before extracting anything, compare `src/store/key_store_request_logs_and_dashboard.rs` and `src/store/key_store_token_logs.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:1007` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 4) src/tavily_proxy/proxy_http_and_logs.rs:869 — src/tavily_proxy/proxy_http_and_logs.rs:869-881 | src/tavily_proxy/proxy_http_and_logs.rs:948-960 | src/tavily_proxy/proxy_http_and_logs.rs:1145-1157 | src/tavily_proxy/proxy_http_and_logs.rs:1224-1236 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:869` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 4) src/store/key_store_alert_canonical_groups.rs:1599 — src/store/key_store_alert_canonical_groups.rs:1599-1611 | src/store/key_store_alert_canonical_groups.rs:1615-1627 | src/store/key_store_alert_canonical_groups.rs:1631-1643 | src/store/key_store_alert_canonical_groups.rs:1647-1659 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:1599` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) src/store/key_store_alert_canonical_groups.rs:1899 — src/store/key_store_alert_canonical_groups.rs:1899-1911 | src/store/key_store_alert_canonical_groups.rs:2080-2092 | src/store/key_store_alert_canonical_groups.rs:2176-2188 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:1899` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 3) src/store/key_store_dashboard_quota_recovery.rs:539 — src/store/key_store_dashboard_quota_recovery.rs:539-551 | src/store/key_store_dashboard_quota_recovery.rs:616-628 | src/store/key_store_dashboard_quota_recovery.rs:664-676 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) src/store/key_store_token_logs.rs:1940 — src/store/key_store_token_logs.rs:1940-1952 | src/store/key_store_token_logs.rs:1973-1985 | src/store/key_store_token_logs.rs:2001-2013 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_token_logs.rs:1940` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:221 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:221-231 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:296-306 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:366-376 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) src/store/key_store_alert_canonical_groups.rs:437 — src/store/key_store_alert_canonical_groups.rs:437-447 | src/store/key_store_alert_canonical_groups.rs:915-925 | src/store/key_store_alert_canonical_groups.rs:1358-1368 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) src/store/sqlite_runtime.rs:1415 — src/store/sqlite_runtime.rs:1415-1428 | src/store/sqlite_runtime.rs:1522-1532 | src/store/sqlite_runtime.rs:1591-1601 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:1415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×3
  • Duplicated block (7 lines × 3) src/server/handlers/user.rs:1588 — src/server/handlers/user.rs:1588-1594 | src/server/handlers/user.rs:1843-1849 | src/server/handlers/user.rs:2141-2147 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/user.rs:1588` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) src/store/key_store_alerts.rs:1343 — src/store/key_store_alerts.rs:1343-1349 | src/store/key_store_alerts.rs:2075-2082 | src/store/key_store_alerts.rs:2188-2195 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alerts.rs:2075` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) src/store/key_store_upstream_reconciliation.rs:241 — src/store/key_store_upstream_reconciliation.rs:241-247 | src/store/key_store_upstream_reconciliation.rs:897-903 | src/store/key_store_upstream_reconciliation.rs:963-969 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (43 lines × 2 locations) · ×3
  • Duplicated block (43 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:1152 — web/src/admin/AdminDashboardRuntime.tsx:1152 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2650 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (43 lines × 2 locations) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:6910 — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:6910 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:7008 — all 2 copies are in the same file, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
  • Duplicated block (43 lines × 2 locations) web/src/user-console/BillingPage.tsx:59 — web/src/user-console/BillingPage.tsx:59 · web/src/user-console/RechargePanel.tsx:39 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×3
  • Duplicated block (31 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:8566 — web/src/admin/AdminDashboardRuntime.tsx:8566 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2217 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (31 lines × 2 locations) web/src/admin/AnnouncementsModule.tsx:652 — web/src/admin/AnnouncementsModule.tsx:652 · web/src/admin/AnnouncementsModule.tsx:720 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (31 lines × 2 locations) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3367 — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3367 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3458 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (28 lines × 2 locations) · ×3
  • Duplicated block (28 lines × 2 locations) web/src/admin/SystemSettingsModule.tsx:1419 — web/src/admin/SystemSettingsModule.tsx:1419 · web/src/admin/SystemSettingsModule.tsx:1454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2 locations) web/src/admin/UserDetailTokenTable.tsx:98 — web/src/admin/UserDetailTokenTable.tsx:98 · web/src/admin/UserDetailTokenTable.tsx:155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2 locations) web/src/api/userConsoleNormalization.ts:95 — web/src/api/userConsoleNormalization.ts:95 · web/src/api/userConsoleNormalization.ts:199 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R7 · Dead Code · Dead file (~1 LoC) · ×3
  • Dead file (~1 LoC) web/src/api/admin.ts — no import path from any entry point (40 application, 13 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~1 LoC) web/src/api/appUsers.ts — no import path from any entry point (40 application, 13 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~1 LoC) web/src/api/shared.ts — no import path from any entry point (40 application, 13 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×3
  • Recursive walk over a caller-supplied document has no depth cap web/src/lib/mcpProbe.ts:169 — `getMcpProbeResultError` is exported, takes a document from its caller (line 180) and hands it to `extractProbeErrorText`, which calls itself at line 169 (`extractProbeErrorText`) with a piece of `payload` — and nowhere in `extractProbeErrorText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `extractProbeErrorText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/src/lib/mcpProbe.ts:177 — `getMcpProbeResultError` is exported, takes a document from its caller (line 180) and hands it to `extractProbeStatusCode`, which calls itself at line 177 (`extractProbeStatusCode`) with a piece of `payload` — and nowhere in `extractProbeStatusCode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `extractProbeStatusCode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap src/store/key_store_alert_event_projection.rs:779 — `normalize_alert_group_record_for_projection` is public and takes `group: AlertGroupRecord` from its caller, and it calls itself at line 779 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `normalize_alert_group_record_for_projection` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
AC2 · Forms & labels · <Textarea> field component without a label · ×2
  • <Textarea> field component without a label web/src/admin/AdminDashboardRuntime.tsx:8684 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label web/src/pages/TokenDetail.tsx:1507 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×2
  • Modal dialog does not manage focus web/src/admin/ForwardProxySettingsModule.tsx:1205 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/admin/ForwardProxySettingsModule.tsx:1287 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D2 · Cognitive Complexity · XraySupervisor · ×2
  • XraySupervisor::sync_endpoints (cognitive 28) src/forward_proxy/relay_and_xray.rs:619 — XraySupervisor::sync_endpoints has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3, match/switch 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • XraySupervisor::create_relay_handle (cognitive 18) src/forward_proxy/relay_and_xray.rs:841 — XraySupervisor::create_relay_handle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Metrics · ×2
  • Metrics::apply_event (cognitive 18) src/observability.rs:1022 — Metrics::apply_event has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Metrics::record_sqlite (cognitive 16) src/observability.rs:886 — Metrics::record_sqlite has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqliteRuntime · ×2
  • SqliteRuntime::prewarm_maintenance_bulk_capacity (cognitive 16) src/store/sqlite_runtime.rs:1714 — SqliteRuntime::prewarm_maintenance_bulk_capacity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, loops 3, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SqliteRuntime::record_error (cognitive 16) src/store/sqlite_runtime.rs:2768 — SqliteRuntime::record_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (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 hub · ×2
  • Change-coupling hub: tests.rs → analysis.rs, dto.rs, admin_resources.rs, tavily.rs, user.rs, proxy.rs, TokenDetail.stories.tsx src/server/tests.rs — `src/server/tests.rs` changes together with 7 other files — `src/analysis.rs`, `src/server/dto.rs`, `src/server/handlers/admin_resources.rs`, `src/server/handlers/tavily.rs`, `src/server/handlers/user.rs`, `src/server/proxy.rs`, `web/src/pages/TokenDetail.stories.tsx` — 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.
  • Change-coupling hub: AdminPages.stories.tsx → admin_resources.rs, AdminShell.tsx, routes.ts web/src/admin/AdminPages.stories.tsx — `web/src/admin/AdminPages.stories.tsx` changes together with 3 other files — `src/server/handlers/admin_resources.rs`, `web/src/admin/AdminShell.tsx`, `web/src/admin/routes.ts` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/store/key_store_alert_canonical_groups.rs:1814 — src/store/key_store_alert_canonical_groups.rs:1814-1870 | src/store/key_store_alert_canonical_groups.rs:1879-1974 | src/store/key_store_alert_canonical_groups.rs:1981-2050 | src/store/key_store_alert_canonical_groups.rs:2060-2149 | src/store/key_store_alert_canonical_groups.rs:2156-2260 | src/store/key_store_alert_canonical_groups.rs:2266-2329 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/tavily_proxy/proxy_http_and_logs.rs:103 — src/tavily_proxy/proxy_http_and_logs.rs:103-350 | src/tavily_proxy/proxy_http_and_logs.rs:370-670 | src/tavily_proxy/proxy_http_and_logs.rs:751-1004 | src/tavily_proxy/proxy_http_and_logs.rs:1021-1280 | src/tavily_proxy/proxy_http_and_logs.rs:1301-1588 | src/tavily_proxy/proxy_http_and_logs.rs:1604-1854 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×2
  • Edited copy of a member (50 corresponding lines) src/tavily_proxy/proxy_request_limits.rs:1269 — src/tavily_proxy/proxy_request_limits.rs:1269-1318 | src/tavily_proxy/proxy_request_limits.rs:1356-1449 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (50 corresponding lines) src/server/handlers/admin_auth.rs:1792 — src/server/handlers/admin_auth.rs:1792-1841 | src/server/handlers/admin_auth.rs:1980-2034 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (82 corresponding lines) · ×2
  • Edited copy of a member (82 corresponding lines) src/store/key_store_alerts.rs:998 — src/store/key_store_alerts.rs:998-1079 | src/store/key_store_alerts.rs:2551-2639 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (82 corresponding lines) src/store/key_store_admin_privacy_read.rs:81 — src/store/key_store_admin_privacy_read.rs:81-162 | src/store/key_store_alert_projection.rs:1078-1171 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) src/store/key_store_alert_canonical_semantic_reduction.rs:585 — src/store/key_store_alert_canonical_semantic_reduction.rs:585-632 | src/store/key_store_alert_canonical_semantic_reduction.rs:639-682 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) src/bin/mcp_request_log_retry_repair.rs:382 — src/bin/mcp_request_log_retry_repair.rs:382-425 | src/bin/mcp_search_billing_repair.rs:479-527 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) src/server/handlers/admin_resources/recharges_and_totp.rs:619 — src/server/handlers/admin_resources/recharges_and_totp.rs:619-656 | src/server/schedulers.rs:2007-2052 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) src/server/serve.rs:874 — src/server/serve.rs:874-911 | src/server/serve.rs:913-957 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×2
  • Edited copy of a member (59 corresponding lines) src/store/key_store_keys.rs:2577 — src/store/key_store_keys.rs:2577-2635 | src/store/key_store_keys.rs:2641-2700 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (59 corresponding lines) src/store/sqlite_runtime.rs:4186 — src/store/sqlite_runtime.rs:4186-4244 | src/store/sqlite_runtime.rs:4251-4309 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) REDACTED:2699 — REDACTED:2699-2754 | REDACTED:2885-2916 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) src/bin/support/sqlite_sidecar.rs:191 — src/bin/support/sqlite_sidecar.rs:191-222 | REDACTED:6-37 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) src/tavily_proxy/proxy_user_dashboard_overview.rs:242 — src/tavily_proxy/proxy_user_dashboard_overview.rs:242-296 | src/tavily_proxy/proxy_user_dashboard_overview.rs:305-355 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (51 corresponding lines) src/store/key_store_admin_privacy_read.rs:26 — src/store/key_store_admin_privacy_read.rs:26-76 | src/store/key_store_alert_projection.rs:207-259 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) src/tavily_proxy/mod.rs:1798 — src/tavily_proxy/mod.rs:1798-1828 | src/tavily_proxy/mod.rs:1833-1865 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/bin/mcp_search_billing_repair.rs:140 — src/bin/mcp_search_billing_repair.rs:140-170 | src/bin/mcp_session_delete_neutral_repair.rs:192-234 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×2
  • Edited copy of a member (45 corresponding lines) src/server/schedulers.rs:1880 — src/server/schedulers.rs:1880-1924 | src/server/schedulers.rs:3011-3056 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) src/store/key_store_account_limit_snapshots.rs:76 — src/store/key_store_account_limit_snapshots.rs:76-120 | src/store/key_store_account_limit_snapshots.rs:223-287 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) src/store/key_store_upstream_reconciliation.rs:1338 — src/store/key_store_upstream_reconciliation.rs:1338-1378 | src/store/key_store_upstream_reconciliation_research.rs:701-736 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) src/store/key_store_upstream_reconciliation.rs:1966 — src/store/key_store_upstream_reconciliation.rs:1966-2001 | src/store/key_store_upstream_reconciliation.rs:2010-2055 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) src/remote_attempt_admission.rs:448 — src/remote_attempt_admission.rs:448-484 | src/remote_attempt_admission.rs:590-618 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) src/store/sqlite_contention_logging.rs:19 — src/store/sqlite_contention_logging.rs:19-49 | src/store/sqlite_contention_logging.rs:56-84 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) src/store/key_store_linuxdo_credit_recharge.rs:712 — src/store/key_store_linuxdo_credit_recharge.rs:712-752 | src/store/key_store_linuxdo_credit_recharge.rs:758-800 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) src/store/key_store_keys.rs:1163 — src/store/key_store_keys.rs:1163-1223 | src/store/key_store_keys.rs:1225-1265 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) src/server/handlers/admin_auth.rs:1718 — src/server/handlers/admin_auth.rs:1718-1739 | src/server/handlers/admin_auth.rs:1745-1776 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1206 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1206-1227 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1233-1254 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) src/server/handlers/admin_resources/alerts.rs:1 — src/server/handlers/admin_resources/alerts.rs:1-6 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:39-46 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/ha.rs:1312 — src/ha.rs:1312-1319 | src/server/handlers/user.rs:206-211 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) src/server/handlers/public.rs:348 — src/server/handlers/public.rs:348-351 | src/server/handlers/user.rs:1512-1515 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/linuxdo_credit_recharge.rs:306 — src/linuxdo_credit_recharge.rs:306-309 | src/server/handlers/admin_resources/recharges_and_totp.rs:610-613 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×2
  • Duplicated block (56 lines × 2) src/store/mod.rs:2155 — src/store/mod.rs:2155-2210 | src/store/mod.rs:2332-2387 — both copies are in the same file, so extract the 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 `src/store/mod.rs:2155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (56 lines × 2) src/server/handlers/tavily.rs:1102 — src/server/handlers/tavily.rs:1102-1157 | src/server/handlers/tavily.rs:1391-1446 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:1102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×2
  • Duplicated block (42 lines × 2) src/store/sqlite_runtime.rs:1456 — src/store/sqlite_runtime.rs:1456-1497 | src/store/sqlite_runtime.rs:1626-1667 — both copies are in the same file, so extract the 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 `src/store/sqlite_runtime.rs:1456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (42 lines × 2) src/store/sqlite_runtime.rs:4203 — src/store/sqlite_runtime.rs:4203-4244 | src/store/sqlite_runtime.rs:4268-4309 — both copies are in the same file, so extract the 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 `src/store/sqlite_runtime.rs:4203` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn finish( &mut` in one and `crate) async fn finish_in_place( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:1399 — src/server/proxy/proxy_handlers_and_views.rs:1399-1436 | src/server/proxy/proxy_handlers_and_views.rs:1477-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/proxy_handlers_and_views.rs:1399` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/server/proxy/proxy_handlers_and_views.rs:1398` calls `Some` and `src/server/proxy/proxy_handlers_and_views.rs:1476` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (38 lines × 2) src/store/sqlite_runtime_cooperative.rs:69 — src/store/sqlite_runtime_cooperative.rs:69-106 | src/store/sqlite_runtime_cooperative.rs:174-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime_cooperative.rs:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) src/forward_proxy/manager.rs:159 — src/forward_proxy/manager.rs:159-192 | src/forward_proxy/manager.rs:281-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/forward_proxy/manager.rs:159` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (34 lines × 2) src/store/key_store_alerts.rs:2085 — src/store/key_store_alerts.rs:2085-2118 | src/store/key_store_alerts.rs:2197-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alerts.rs:2085` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×2
  • Duplicated block (26 lines × 3) src/store/key_store_request_logs_and_dashboard.rs:900 — src/store/key_store_request_logs_and_dashboard.rs:900-925 | src/store/key_store_request_logs_and_dashboard.rs:1423-1448 | src/store/key_store_request_logs_and_dashboard.rs:1739-1764 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:900` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 3) src/store/key_store_token_logs.rs:553 — src/store/key_store_token_logs.rs:553-578 | src/store/key_store_token_logs.rs:751-776 | src/store/key_store_token_logs.rs:832-857 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_token_logs.rs:553` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) src/server/handlers/tavily.rs:467 — src/server/handlers/tavily.rs:467-487 | src/server/handlers/tavily.rs:527-546 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:467` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20–21 lines × 2) src/tavily_proxy/proxy_request_limits.rs:1276 — src/tavily_proxy/proxy_request_limits.rs:1276-1296 | src/tavily_proxy/proxy_request_limits.rs:1372-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) src/server/schedulers.rs:2164 — src/server/schedulers.rs:2164-2181 | src/server/schedulers.rs:2183-2200 | src/server/schedulers.rs:2201-2218 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/schedulers.rs:2164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18 lines × 3) src/server/proxy/proxy_handlers_and_views.rs:128 — src/server/proxy/proxy_handlers_and_views.rs:128-145 | src/server/proxy/proxy_handlers_and_views.rs:152-169 | src/server/proxy/proxy_handlers_and_views.rs:179-196 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/proxy/proxy_handlers_and_views.rs:128` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) src/lib.rs:1086 — src/lib.rs:1086-1101 | src/lib.rs:1103-1119 — both copies are in the same file, so extract the 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 `src/lib.rs:1086` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 2) src/store/key_store_keys.rs:1367 — src/store/key_store_keys.rs:1367-1382 | src/store/key_store_keys.rs:1402-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_keys.rs:1402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) src/store/key_store_upstream_reconciliation.rs:2293 — src/store/key_store_upstream_reconciliation.rs:2293-2307 | src/store/key_store_upstream_reconciliation.rs:2555-2570 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2293` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) src/tavily_proxy/mod.rs:1807 — src/tavily_proxy/mod.rs:1807-1821 | src/tavily_proxy/mod.rs:1842-1857 — both copies are in the same file, so extract the 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 `src/tavily_proxy/mod.rs:1807` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) src/store/reconciliation_projection_controller.rs:302 — src/store/reconciliation_projection_controller.rs:302-315 | src/store/reconciliation_projection_controller.rs:543-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/reconciliation_projection_controller.rs:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) src/store/sqlite_runtime.rs:1435 — src/store/sqlite_runtime.rs:1435-1449 | src/store/sqlite_runtime.rs:1607-1620 — both copies are in the same file, so extract the 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 `src/store/sqlite_runtime.rs:1435` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:1243 — src/server/proxy/proxy_handlers_and_views.rs:1243-1255 | src/server/proxy/proxy_handlers_and_views.rs:1345-1358 — both copies are in the same file, so extract the 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 `src/server/proxy/proxy_handlers_and_views.rs:1345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) src/store/key_store_keys.rs:1574 — src/store/key_store_keys.rs:1574-1587 | src/store/key_store_keys.rs:1722-1734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_keys.rs:1574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×2
  • Duplicated block (11 lines × 6) src/server/dto.rs:1660 — src/server/dto.rs:1660-1671 | src/server/dto.rs:1714-1725 | src/server/dto.rs:1991-2001 | src/server/dto.rs:2121-2132 | src/server/dto.rs:2190-2201 | src/server/handlers/admin_resources/api_keys_and_logs.rs:983-994 — before extracting anything, compare `src/server/dto.rs` and `src/server/handlers/admin_resources/api_keys_and_logs.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 6) REDACTED:1572 — REDACTED:1572-1582 | REDACTED:1612-1622 | REDACTED:1633-1643 | REDACTED:1700-1710 | REDACTED:1754-1764 | REDACTED:1775-1785 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) src/store/key_store_users_and_oauth.rs:798 — src/store/key_store_users_and_oauth.rs:798-807 | src/store/key_store_users_and_oauth.rs:858-868 | src/store/key_store_users_and_oauth.rs:1009-1019 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_users_and_oauth.rs:798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_users_and_oauth.rs:1008` calls `bind` and `src/store/key_store_users_and_oauth.rs:797` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:455 — src/tavily_proxy/proxy_http_and_logs.rs:455-464 | src/tavily_proxy/proxy_http_and_logs.rs:1373-1382 | src/tavily_proxy/proxy_http_and_logs.rs:1652-1662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) src/server/handlers/tavily.rs:647 — src/server/handlers/tavily.rs:647-655 | src/server/handlers/tavily.rs:1241-1249 | src/server/handlers/tavily.rs:1523-1531 | src/server/proxy/proxy_handlers_and_views.rs:1796-1804 — before extracting anything, compare `src/server/handlers/tavily.rs` and `src/server/proxy/proxy_handlers_and_views.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:647` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) src/store/key_store_alert_canonical_groups.rs:1898 — src/store/key_store_alert_canonical_groups.rs:1898-1906 | src/store/key_store_alert_canonical_groups.rs:2000-2008 | src/store/key_store_alert_canonical_groups.rs:2079-2087 | src/store/key_store_alert_canonical_groups.rs:2175-2183 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:1898` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×2
  • Duplicated block (8–9 lines × 4) src/server/handlers/user.rs:1538 — src/server/handlers/user.rs:1538-1545 | src/server/handlers/user.rs:1561-1568 | src/server/handlers/user.rs:2577-2585 | src/server/handlers/user.rs:2662-2669 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/user.rs:1538` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 4) src/store/sqlite_runtime.rs:2145 — src/store/sqlite_runtime.rs:2145-2152 | src/store/sqlite_runtime.rs:2186-2193 | src/store/sqlite_runtime.rs:2342-2350 | src/store/sqlite_runtime_cooperative.rs:275-282 — before extracting anything, compare `src/store/sqlite_runtime.rs` and `src/store/sqlite_runtime_cooperative.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) src/store/key_store_alerts.rs:1316 — src/store/key_store_alerts.rs:1316-1324 | src/store/key_store_alerts.rs:1838-1845 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:1316` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) src/store/key_store_upstream_reconciliation.rs:896 — src/store/key_store_upstream_reconciliation.rs:896-904 | src/store/key_store_upstream_reconciliation.rs:962-969 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:896` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×2
  • Duplicated block (25 lines × 3) src/store/key_store_users_and_oauth.rs:824 — src/store/key_store_users_and_oauth.rs:824-848 | src/store/key_store_users_and_oauth.rs:889-913 | src/store/key_store_users_and_oauth.rs:1042-1066 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_users_and_oauth.rs:824` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 3) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:399 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:399-423 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:520-544 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:627-651 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:399` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:545` calls `cancel` and `src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:424` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:909 — src/store/key_store_dashboard_rollup_integrity.rs:909-935 | src/store/key_store_dashboard_rollup_integrity.rs:1406-1431 — both copies are in the same file, so extract the 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 `src/store/key_store_dashboard_rollup_integrity.rs:909` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/store/key_store_dashboard_rollup_integrity.rs:1432` calls `bind`, `priority` and `src/store/key_store_dashboard_rollup_integrity.rs:936` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (26 lines × 2) src/store/key_store_users_and_oauth.rs:2129 — src/store/key_store_users_and_oauth.rs:2129-2154 | src/store/key_store_users_and_oauth.rs:2243-2268 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:2129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (42 lines × 2 locations) · ×2
  • Duplicated block (42 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:1464 — web/src/admin/AdminDashboardRuntime.tsx:1464 · web/src/admin/screens/shared.tsx:60 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (42 lines × 2 locations) web/src/admin/ForwardProxySettingsModule.tsx:2841 — web/src/admin/ForwardProxySettingsModule.tsx:2841 · web/src/admin/ForwardProxySettingsModule.tsx:2883 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (38 lines × 2 locations) · ×2
  • Duplicated block (38 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:3979 — web/src/admin/AdminDashboardRuntime.tsx:3979 · web/src/pages/TokenDetail.tsx:1086 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (38 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:10207 — web/src/admin/AdminDashboardRuntime.tsx:10207 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4647 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×2
  • Duplicated block (30 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:812 — web/src/admin/AdminDashboardRuntime.tsx:812 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:183 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (30 lines × 2 locations) web/src/user-console/Announcements.tsx:178 — web/src/user-console/Announcements.tsx:178 · web/src/user-console/Announcements.tsx:209 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×2
  • Duplicated block (29 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:9798 — web/src/admin/AdminDashboardRuntime.tsx:9798 · web/src/admin/AdminDashboardRuntime.tsx:9913 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (29 lines × 2 locations) web/src/admin/KeyStickyPanels.tsx:130 — web/src/admin/KeyStickyPanels.tsx:130 · web/src/admin/KeyStickyPanels.tsx:160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R11 · Import Boundaries · Boundary violation [package · ×2
  • Boundary violation [package:third-party-deep-import] web/src/admin/AdminUserRankingsPage.tsx:3 — web/src/admin/AdminUserRankingsPage.tsx:3 imports echarts-for-react/lib/core, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4 — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4 imports storybook/internal/core-events, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
X2 · Cancellation propagation · Async function without AbortSignal · ×2
  • Async function without AbortSignal: deleteToken web/src/api/tokens.ts:87 — `deleteToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: setTokenEnabled web/src/api/tokens.ts:92 — `setTokenEnabled` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D1 · Cyclomatic Complexity · runtime.UserConsole (cyclomatic 333) · ×1
  • runtime.UserConsole (cyclomatic 333) web/src/user-console/runtime.tsx:1222 — runtime.UserConsole has cyclomatic complexity 333 (threshold 15). Of this number, 87 points are the body's own statements and 246 belong to 72 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminDashboardRuntime.AdminDashboard (cyclomatic 329) · ×1
  • AdminDashboardRuntime.AdminDashboard (cyclomatic 329) web/src/admin/AdminDashboardRuntime.tsx:1757 — AdminDashboardRuntime.AdminDashboard has cyclomatic complexity 329 (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 shape REPEATS in the file: 4 other methods here (AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule (cyclomatic 139) · ×1
  • UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule (cyclomatic 139) web/src/admin/UpstreamPrivacyStatusModule.tsx:189 — UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule has cyclomatic complexity 139 (threshold 15). Of this number, 97 points are the body's own statements and 42 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardProxySettingsModule.ForwardProxySettingsModule (cyclomatic 132) · ×1
  • ForwardProxySettingsModule.ForwardProxySettingsModule (cyclomatic 132) web/src/admin/ForwardProxySettingsModule.tsx:1780 — ForwardProxySettingsModule.ForwardProxySettingsModule has cyclomatic complexity 132 (threshold 15). Of this number, 49 points are the body's own statements and 83 belong to 33 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlertsCenter.AlertsCenter (cyclomatic 107) · ×1
  • AlertsCenter.AlertsCenter (cyclomatic 107) web/src/admin/AlertsCenter.tsx:460 — AlertsCenter.AlertsCenter has cyclomatic complexity 107 (threshold 15). Of this number, 29 points are the body's own statements and 78 belong to 28 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminSecuritySettingsModule.AdminSecuritySettingsModule (cyclomatic 104) · ×1
  • AdminSecuritySettingsModule.AdminSecuritySettingsModule (cyclomatic 104) web/src/admin/AdminSecuritySettingsModule.tsx:167 — AdminSecuritySettingsModule.AdminSecuritySettingsModule has cyclomatic complexity 104 (threshold 15). Of this number, 51 points are the body's own statements and 53 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · demo.handleDemoRoute (cyclomatic 101) · ×1
  • demo.handleDemoRoute (cyclomatic 101) REDACTED:1972 — demo.handleDemoRoute has cyclomatic complexity 101 (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 · PublicHome.PublicHome (cyclomatic 101) · ×1
  • PublicHome.PublicHome (cyclomatic 101) web/src/PublicHome.tsx:110 — PublicHome.PublicHome has cyclomatic complexity 101 (threshold 15). Of this number, 35 points are the body's own statements and 66 belong to 35 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TokenDetail.TokenDetail (cyclomatic 100) · ×1
  • TokenDetail.TokenDetail (cyclomatic 100) web/src/pages/TokenDetail.tsx:405 — TokenDetail.TokenDetail has cyclomatic complexity 100 (threshold 15). Of this number, 32 points are the body's own statements and 68 belong to 35 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SystemSettingsModule.SystemSettingsModule (cyclomatic 97) · ×1
  • SystemSettingsModule.SystemSettingsModule (cyclomatic 97) web/src/admin/SystemSettingsModule.tsx:282 — SystemSettingsModule.SystemSettingsModule has cyclomatic complexity 97 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BillingPage.BillingPage (cyclomatic 94) · ×1
  • BillingPage.BillingPage (cyclomatic 94) web/src/user-console/BillingPage.tsx:428 — BillingPage.BillingPage has cyclomatic complexity 94 (threshold 15). Of this number, 62 points are the body's own statements and 32 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UserDetailSharedUsagePanel.UserDetailSharedUsagePanel (cyclomatic 92) · ×1
  • UserDetailSharedUsagePanel.UserDetailSharedUsagePanel (cyclomatic 92) web/src/admin/UserDetailSharedUsagePanel.tsx:296 — UserDetailSharedUsagePanel.UserDetailSharedUsagePanel has cyclomatic complexity 92 (threshold 15). Of this number, 35 points are the body's own statements and 57 belong to 21 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminDashboardRuntime.KeyDetails (cyclomatic 90) · ×1
  • AdminDashboardRuntime.KeyDetails (cyclomatic 90) web/src/admin/AdminDashboardRuntime.tsx:12901 — AdminDashboardRuntime.KeyDetails has cyclomatic complexity 90 (threshold 15). Of this number, 32 points are the body's own statements and 58 belong to 21 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminRecentRequestsPanel.AdminRecentRequestsPanel (cyclomatic 74) · ×1
  • AdminRecentRequestsPanel.AdminRecentRequestsPanel (cyclomatic 74) web/src/components/AdminRecentRequestsPanel.tsx:741 — AdminRecentRequestsPanel.AdminRecentRequestsPanel has cyclomatic complexity 74 (threshold 15). Of this number, 16 points are the body's own statements and 58 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ApiKeysValidationDialog.ApiKeysValidationDialog (cyclomatic 61) · ×1
  • ApiKeysValidationDialog.ApiKeysValidationDialog (cyclomatic 61) web/src/components/ApiKeysValidationDialog.tsx:310 — ApiKeysValidationDialog.ApiKeysValidationDialog has cyclomatic complexity 61 (threshold 15). Of this number, 30 points are the body's own statements and 31 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminLogin.AdminLogin (cyclomatic 60) · ×1
  • AdminLogin.AdminLogin (cyclomatic 60) web/src/pages/AdminLogin.tsx:25 — AdminLogin.AdminLogin has cyclomatic complexity 60 (threshold 15). Of this number, 32 points are the body's own statements and 28 belong to 13 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RequestKindBadge.resolveRequestKindBadgeTone (cyclomatic 59) · ×1
  • RequestKindBadge.resolveRequestKindBadgeTone (cyclomatic 59) web/src/components/RequestKindBadge.tsx:57 — RequestKindBadge.resolveRequestKindBadgeTone has cyclomatic complexity 59 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · demo.createDemoLog (cyclomatic 54) · ×1
  • demo.createDemoLog (cyclomatic 54) REDACTED:95 — demo.createDemoLog has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HaStatusBanner.HaStatusBanner (cyclomatic 51) · ×1
  • HaStatusBanner.HaStatusBanner (cyclomatic 51) web/src/components/HaStatusBanner.tsx:225 — HaStatusBanner.HaStatusBanner has cyclomatic complexity 51 (threshold 15). Of this number, 32 points are the body's own statements and 19 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HaNodeDetailPanel.HaNodeDetailPanel (cyclomatic 48) · ×1
  • HaNodeDetailPanel.HaNodeDetailPanel (cyclomatic 48) web/src/admin/HaNodeDetailPanel.tsx:192 — HaNodeDetailPanel.HaNodeDetailPanel has cyclomatic complexity 48 (threshold 15). Of this number, 21 points are the body's own statements and 27 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.schemaExampleValue (cyclomatic 45) · ×1
  • runtime.schemaExampleValue (cyclomatic 45) web/src/user-console/runtime.tsx:778 — runtime.schemaExampleValue has cyclomatic complexity 45 (threshold 15). Of this number, 44 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · routes.parseAdminPath (cyclomatic 42) · ×1
  • routes.parseAdminPath (cyclomatic 42) web/src/admin/routes.ts:118 — routes.parseAdminPath has cyclomatic complexity 42 (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 · DashboardTrendPanel.DashboardTrendPanel (cyclomatic 42) · ×1
  • DashboardTrendPanel.DashboardTrendPanel (cyclomatic 42) web/src/admin/DashboardTrendPanel.tsx:221 — DashboardTrendPanel.DashboardTrendPanel has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 15 of the 42 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 382, 368, 510, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AnnouncementsModule.AnnouncementsModule (cyclomatic 41) · ×1
  • AnnouncementsModule.AnnouncementsModule (cyclomatic 41) web/src/admin/AnnouncementsModule.tsx:787 — AnnouncementsModule.AnnouncementsModule has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 15 of the 41 points are its own statements and the rest belongs to 6 function items inside it that branch (submit, a function literal at line 862, a function literal at line 835, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · routes.isSameAdminRoute (cyclomatic 39) · ×1
  • routes.isSameAdminRoute (cyclomatic 39) web/src/admin/routes.ts:230 — routes.isSameAdminRoute has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardProxySettingsModule.ForwardProxyCandidateDialog (cyclomatic 37) · ×1
  • ForwardProxySettingsModule.ForwardProxyCandidateDialog (cyclomatic 37) web/src/admin/ForwardProxySettingsModule.tsx:1528 — ForwardProxySettingsModule.ForwardProxyCandidateDialog has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AdminPagesStoryRuntime.KeysPageCanvas (cyclomatic 37) · ×1
  • AdminPagesStoryRuntime.KeysPageCanvas (cyclomatic 37) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3836 — AdminPagesStoryRuntime.KeysPageCanvas has cyclomatic complexity 37 (threshold 15). Of this number, 20 points are the body's own statements and 17 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminRechargeRecordsModule.AdminRechargeRecordsModule (cyclomatic 36) · ×1
  • AdminRechargeRecordsModule.AdminRechargeRecordsModule (cyclomatic 36) web/src/admin/AdminRechargeRecordsModule.tsx:56 — AdminRechargeRecordsModule.AdminRechargeRecordsModule has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 13 function items inside it that branch (executeRefund, a function literal at line 105, openUser, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · HaSourceSettingsDialog.HaSourceSettingsDialog (cyclomatic 35) · ×1
  • HaSourceSettingsDialog.HaSourceSettingsDialog (cyclomatic 35) web/src/admin/HaSourceSettingsDialog.tsx:100 — HaSourceSettingsDialog.HaSourceSettingsDialog has cyclomatic complexity 35 (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 shape REPEATS in the file: one other method here (HaSourceSettingsDialog.HaSourceSettingsDialog::handleSubmit) 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.
D1 · Cyclomatic Complexity · AdminUserRankingsPage.RankingsBarChart (cyclomatic 35) · ×1
  • AdminUserRankingsPage.RankingsBarChart (cyclomatic 35) web/src/admin/AdminUserRankingsPage.tsx:241 — AdminUserRankingsPage.RankingsBarChart has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 14 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 292, 281). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AdminPagesStoryRuntime.UsersPageCanvas (cyclomatic 35) · ×1
  • AdminPagesStoryRuntime.UsersPageCanvas (cyclomatic 35) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4827 — AdminPagesStoryRuntime.UsersPageCanvas has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 11 of the 35 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 4973, toggleSort, a function literal at line 5075, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas (cyclomatic 35) · ×1
  • AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas (cyclomatic 35) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5280 — AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 10 of the 35 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 5472, a function literal at line 5582, toggleSort, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Announcements.UserConsoleAnnouncements (cyclomatic 34) · ×1
  • Announcements.UserConsoleAnnouncements (cyclomatic 34) web/src/user-console/Announcements.tsx:80 — Announcements.UserConsoleAnnouncements has cyclomatic complexity 34 (threshold 15). Of this number, 18 points are the body's own statements and 16 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardProxyEgressControl.ForwardProxyEgressControl (cyclomatic 33) · ×1
  • ForwardProxyEgressControl.ForwardProxyEgressControl (cyclomatic 33) web/src/admin/ForwardProxyEgressControl.tsx:74 — ForwardProxyEgressControl.ForwardProxyEgressControl has cyclomatic complexity 33 (threshold 15). Of this number, 18 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · api-key-extract.isPublicIpv4 (cyclomatic 32) · ×1
  • api-key-extract.isPublicIpv4 (cyclomatic 32) web/src/lib/api-key-extract.ts:20 — api-key-extract.isPublicIpv4 has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useOAuthCallbackFlow.useOAuthCallbackFlow (cyclomatic 32) · ×1
  • useOAuthCallbackFlow.useOAuthCallbackFlow (cyclomatic 32) web/src/user-console/useOAuthCallbackFlow.ts:24 — useOAuthCallbackFlow.useOAuthCallbackFlow has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 45, 136, 92, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ReconciliationProjectionController · ×1
  • ReconciliationProjectionController::advance_slice_inner (cyclomatic 29) src/store/reconciliation_projection_controller.rs:164 — ReconciliationProjectionController::advance_slice_inner has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HaStatusBanner.buildNodeRows (cyclomatic 29) · ×1
  • HaStatusBanner.buildNodeRows (cyclomatic 29) web/src/components/HaStatusBanner.tsx:114 — HaStatusBanner.buildNodeRows has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · check_quality_gates.audit_github_state (cyclomatic 28) · ×1
  • check_quality_gates.audit_github_state (cyclomatic 28) .github/scripts/check_quality_gates.py:331 — check_quality_gates.audit_github_state has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminUserDetailQuotaWorkspace.AdminUserDetailQuotaWorkspace (cyclomatic 28) · ×1
  • AdminUserDetailQuotaWorkspace.AdminUserDetailQuotaWorkspace (cyclomatic 28) web/src/admin/AdminUserDetailQuotaWorkspace.tsx:107 — AdminUserDetailQuotaWorkspace.AdminUserDetailQuotaWorkspace has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 5 function items inside it that branch (submitEntitlement, applyEntitlementFilters, a function literal at line 241, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AdminPagesStoryRuntime.UserDetailPageCanvas (cyclomatic 28) · ×1
  • AdminPagesStoryRuntime.UserDetailPageCanvas (cyclomatic 28) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5844 — AdminPagesStoryRuntime.UserDetailPageCanvas has cyclomatic complexity 28 (threshold 15). Of this number, 15 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SegmentedTabs.SegmentedTabs (cyclomatic 27) · ×1
  • SegmentedTabs.SegmentedTabs (cyclomatic 27) web/src/components/ui/SegmentedTabs.tsx:33 — SegmentedTabs.SegmentedTabs has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 113, findNextEnabledIndex, a function literal at line 98, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · anchored-info-disclosure.AnchoredInfoDisclosure (cyclomatic 27) · ×1
  • anchored-info-disclosure.AnchoredInfoDisclosure (cyclomatic 27) web/src/components/ui/anchored-info-disclosure.tsx:23 — anchored-info-disclosure.AnchoredInfoDisclosure has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (handleBlur, a function literal at line 55, handleClick, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · logOperationalClass.failureKindGuidance (cyclomatic 27) · ×1
  • logOperationalClass.failureKindGuidance (cyclomatic 27) web/src/lib/logOperationalClass.ts:68 — logOperationalClass.failureKindGuidance has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RechargePanel.RechargePanel (cyclomatic 27) · ×1
  • RechargePanel.RechargePanel (cyclomatic 27) web/src/user-console/RechargePanel.tsx:162 — RechargePanel.RechargePanel has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.buildApiProbeStepDefinitions (cyclomatic 27) · ×1
  • runtime.buildApiProbeStepDefinitions (cyclomatic 27) web/src/user-console/runtime.tsx:1030 — runtime.buildApiProbeStepDefinitions has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 1113, 1095, 1037, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · McpSessionBindingsModule.McpSessionBindingsModule (cyclomatic 26) · ×1
  • McpSessionBindingsModule.McpSessionBindingsModule (cyclomatic 26) web/src/admin/McpSessionBindingsModule.tsx:230 — McpSessionBindingsModule.McpSessionBindingsModule has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PublicHomeHeroCard.PublicHomeHeroCard (cyclomatic 26) · ×1
  • PublicHomeHeroCard.PublicHomeHeroCard (cyclomatic 26) web/src/components/PublicHomeHeroCard.tsx:68 — PublicHomeHeroCard.PublicHomeHeroCard has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DashboardOverview.DashboardOverview (cyclomatic 25) · ×1
  • DashboardOverview.DashboardOverview (cyclomatic 25) web/src/admin/DashboardOverview.tsx:546 — DashboardOverview.DashboardOverview has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminRechargeRecordsModule.AdminRechargeRefundDialogBody (cyclomatic 25) · ×1
  • AdminRechargeRecordsModule.AdminRechargeRefundDialogBody (cyclomatic 25) web/src/admin/AdminRechargeRecordsModule.tsx:434 — AdminRechargeRecordsModule.AdminRechargeRefundDialogBody 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 · ConnectivityChecksPanel.ConnectivityChecksPanel (cyclomatic 25) · ×1
  • ConnectivityChecksPanel.ConnectivityChecksPanel (cyclomatic 25) web/src/components/ConnectivityChecksPanel.tsx:90 — ConnectivityChecksPanel.ConnectivityChecksPanel has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 125, a function literal at line 149, renderProbeBubble). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · design_system.format_ascii_box (cyclomatic 24) · ×1
  • design_system.format_ascii_box (cyclomatic 24) .codex/skills/ui-ux-pro-max/scripts/design_system.py:267 — design_system.format_ascii_box has cyclomatic complexity 24 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · release_failure_notifier.main (cyclomatic 24) · ×1
  • release_failure_notifier.main (cyclomatic 24) .github/scripts/release_failure_notifier.py:550 — release_failure_notifier.main has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardProxySettingsModule.formatValidationMessage (cyclomatic 24) · ×1
  • ForwardProxySettingsModule.formatValidationMessage (cyclomatic 24) web/src/admin/ForwardProxySettingsModule.tsx:987 — ForwardProxySettingsModule.formatValidationMessage has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AdminPagesStoryRuntime.UsersUsagePageCanvas (cyclomatic 24) · ×1
  • AdminPagesStoryRuntime.UsersUsagePageCanvas (cyclomatic 24) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5102 — AdminPagesStoryRuntime.UsersUsagePageCanvas has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 5127, toggleSort, a function literal at line 5143, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: AdminPagesStoryRuntime.AdminPageFrame (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · check_quality_gates.parse_workflow (cyclomatic 23) · ×1
  • check_quality_gates.parse_workflow (cyclomatic 23) .github/scripts/check_quality_gates.py:69 — check_quality_gates.parse_workflow 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 · verify_relay_mesh_lockup_geometry.validate_structure (cyclomatic 23) · ×1
  • verify_relay_mesh_lockup_geometry.validate_structure (cyclomatic 23) web/scripts/verify_relay_mesh_lockup_geometry.py:42 — verify_relay_mesh_lockup_geometry.validate_structure has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runtime.requestForwardProxyProgress (cyclomatic 23) · ×1
  • runtime.requestForwardProxyProgress (cyclomatic 23) web/src/api/runtime.ts:1331 — runtime.requestForwardProxyProgress 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 · runtime.syncApiKeyBulkUsageWithProgress (cyclomatic 23) · ×1
  • runtime.syncApiKeyBulkUsageWithProgress (cyclomatic 23) web/src/api/runtime.ts:1825 — runtime.syncApiKeyBulkUsageWithProgress 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 · AdminRecentRequestsPanel.RecentRequestDetails (cyclomatic 23) · ×1
  • AdminRecentRequestsPanel.RecentRequestDetails (cyclomatic 23) web/src/components/AdminRecentRequestsPanel.tsx:549 — AdminRecentRequestsPanel.RecentRequestDetails 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 · AdminShell.AdminShell (cyclomatic 23) · ×1
  • AdminShell.AdminShell (cyclomatic 23) web/src/admin/AdminShell.tsx:45 — AdminShell.AdminShell has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UsersUsageScreen.UsersUsageScreen (cyclomatic 22) · ×1
  • UsersUsageScreen.UsersUsageScreen (cyclomatic 22) web/src/admin/screens/UsersUsageScreen.tsx:62 — UsersUsageScreen.UsersUsageScreen has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 194, 313, 381). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ForwardProxySettingsModule.ForwardProxyValidationNodeTable (cyclomatic 22) · ×1
  • ForwardProxySettingsModule.ForwardProxyValidationNodeTable (cyclomatic 22) web/src/admin/ForwardProxySettingsModule.tsx:1375 — ForwardProxySettingsModule.ForwardProxyValidationNodeTable has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1452, a function literal at line 1406, clearCloseTimer, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PublicHome.buildGuideContent (cyclomatic 22) · ×1
  • PublicHome.buildGuideContent (cyclomatic 22) web/src/PublicHome.tsx:1047 — PublicHome.buildGuideContent has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · guide.buildGuideContent (cyclomatic 22) · ×1
  • guide.buildGuideContent (cyclomatic 22) REDACTED:146 — guide.buildGuideContent has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminUserRankingsPage.AdminUserRankingsPage (cyclomatic 21) · ×1
  • AdminUserRankingsPage.AdminUserRankingsPage (cyclomatic 21) web/src/admin/AdminUserRankingsPage.tsx:842 — AdminUserRankingsPage.AdminUserRankingsPage has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardProxyManager · ×1
  • ForwardProxyManager::apply_incremental_settings (cyclomatic 20) src/forward_proxy/manager.rs:195 — ForwardProxyManager::apply_incremental_settings 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 · haCopy.formatHaStatusMessage (cyclomatic 20) · ×1
  • haCopy.formatHaStatusMessage (cyclomatic 20) web/src/lib/haCopy.ts:165 — haCopy.formatHaStatusMessage 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 · SqliteReadSnapshot · ×1
  • SqliteReadSnapshot::complete_cooperative_query_inner (cyclomatic 19) src/store/sqlite_runtime_cooperative.rs:27 — SqliteReadSnapshot::complete_cooperative_query_inner 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 · demoHa.handleDemoHaRoute (cyclomatic 19) · ×1
  • demoHa.handleDemoHaRoute (cyclomatic 19) web/src/api/demoHa.ts:190 — demoHa.handleDemoHaRoute 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 · ApiKeyBulkSyncProgressBubble.ApiKeyBulkSyncProgressBubble (cyclomatic 19) · ×1
  • ApiKeyBulkSyncProgressBubble.ApiKeyBulkSyncProgressBubble (cyclomatic 19) web/src/admin/ApiKeyBulkSyncProgressBubble.tsx:49 — ApiKeyBulkSyncProgressBubble.ApiKeyBulkSyncProgressBubble has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 89). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AdminDashboardRuntime.statusTone (cyclomatic 19) · ×1
  • AdminDashboardRuntime.statusTone (cyclomatic 19) web/src/admin/AdminDashboardRuntime.tsx:1516 — AdminDashboardRuntime.statusTone has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AdminRecentRequestsPanel.formatKeyEffectSummary (cyclomatic 18) · ×1
  • AdminRecentRequestsPanel.formatKeyEffectSummary (cyclomatic 18) web/src/components/AdminRecentRequestsPanel.tsx:299 — AdminRecentRequestsPanel.formatKeyEffectSummary 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 · demo.handleUserTags (cyclomatic 18) · ×1
  • demo.handleUserTags (cyclomatic 18) REDACTED:2251 — demo.handleUserTags 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. This is NOT this file's highest cyclomatic complexity: demo.demoDashboardOverview (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · demo.handleTokenRoute (cyclomatic 18) · ×1
  • demo.handleTokenRoute (cyclomatic 18) REDACTED:2288 — demo.handleTokenRoute has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: demo.demoDashboardOverview (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · api-key-extract.parseIpv6 (cyclomatic 18) · ×1
  • api-key-extract.parseIpv6 (cyclomatic 18) web/src/lib/api-key-extract.ts:37 — api-key-extract.parseIpv6 has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenSecretField.TokenSecretField (cyclomatic 18) · ×1
  • TokenSecretField.TokenSecretField (cyclomatic 18) web/src/components/TokenSecretField.tsx:40 — TokenSecretField.TokenSecretField has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UserConsoleHeader.UserConsoleAccountMenu (cyclomatic 18) · ×1
  • UserConsoleHeader.UserConsoleAccountMenu (cyclomatic 18) web/src/components/UserConsoleHeader.tsx:231 — UserConsoleHeader.UserConsoleAccountMenu has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AdminPagesStoryRuntime.StoryUserTagCatalogCard (cyclomatic 18) · ×1
  • AdminPagesStoryRuntime.StoryUserTagCatalogCard (cyclomatic 18) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2722 — AdminPagesStoryRuntime.StoryUserTagCatalogCard has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AdminPagesStoryRuntime.AdminPageFrame (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · runtime.appendRequestLogsPageFilters (cyclomatic 17) · ×1
  • runtime.appendRequestLogsPageFilters (cyclomatic 17) web/src/api/runtime.ts:1052 — runtime.appendRequestLogsPageFilters has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminRecentRequestsPanel.formatSelectionEffectSummary (cyclomatic 17) · ×1
  • AdminRecentRequestsPanel.formatSelectionEffectSummary (cyclomatic 17) web/src/components/AdminRecentRequestsPanel.tsx:361 — AdminRecentRequestsPanel.formatSelectionEffectSummary has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · demo.handleKeyRoute (cyclomatic 17) · ×1
  • demo.handleKeyRoute (cyclomatic 17) REDACTED:2193 — demo.handleKeyRoute has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: demo.demoDashboardOverview (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · HaSourceSettingsDialog.HaSourceSettingsDialog · ×1
  • HaSourceSettingsDialog.HaSourceSettingsDialog::handleSubmit (cyclomatic 17) web/src/admin/HaSourceSettingsDialog.tsx:190 — HaSourceSettingsDialog.HaSourceSettingsDialog::handleSubmit has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (HaSourceSettingsDialog.HaSourceSettingsDialog) 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.
D1 · Cyclomatic Complexity · RollingNumber.buildRollingCells (cyclomatic 17) · ×1
  • RollingNumber.buildRollingCells (cyclomatic 17) web/src/components/RollingNumber.tsx:82 — RollingNumber.buildRollingCells has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnnouncementsModule.AnnouncementsListPanel (cyclomatic 17) · ×1
  • AnnouncementsModule.AnnouncementsListPanel (cyclomatic 17) web/src/admin/AnnouncementsModule.tsx:562 — AnnouncementsModule.AnnouncementsListPanel has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 689, 638). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useUpdateAvailable.useUpdateAvailable (cyclomatic 16) · ×1
  • useUpdateAvailable.useUpdateAvailable (cyclomatic 16) web/src/hooks/useUpdateAvailable.ts:30 — useUpdateAvailable.useUpdateAvailable has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 81, 136, 127, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ForwardProxyProgressBubble.ForwardProxyProgressBubble (cyclomatic 16) · ×1
  • ForwardProxyProgressBubble.ForwardProxyProgressBubble (cyclomatic 16) web/src/admin/ForwardProxyProgressBubble.tsx:14 — ForwardProxyProgressBubble.ForwardProxyProgressBubble has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 42). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ForwardProxySettingsModule.buildVisibleBarHeights (cyclomatic 16) · ×1
  • ForwardProxySettingsModule.buildVisibleBarHeights (cyclomatic 16) web/src/admin/ForwardProxySettingsModule.tsx:500 — ForwardProxySettingsModule.buildVisibleBarHeights has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenDetail.computeStartDate (cyclomatic 16) · ×1
  • TokenDetail.computeStartDate (cyclomatic 16) web/src/pages/TokenDetail.tsx:283 — TokenDetail.computeStartDate 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 · KeyStickyPanels.buildVisibleBarHeights (cyclomatic 16) · ×1
  • KeyStickyPanels.buildVisibleBarHeights (cyclomatic 16) web/src/admin/KeyStickyPanels.tsx:90 — KeyStickyPanels.buildVisibleBarHeights has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminDashboardRuntime.formatKeyEffectSummary (cyclomatic 16) · ×1
  • AdminDashboardRuntime.formatKeyEffectSummary (cyclomatic 16) web/src/admin/AdminDashboardRuntime.tsx:1640 — AdminDashboardRuntime.formatKeyEffectSummary 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 · AdminPagesStoryRuntime.filterStoryRequestLogs (cyclomatic 16) · ×1
  • AdminPagesStoryRuntime.filterStoryRequestLogs (cyclomatic 16) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:803 — AdminPagesStoryRuntime.filterStoryRequestLogs has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 828). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: AdminPagesStoryRuntime.AdminPageFrame (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · runtime.UserConsole (cognitive 373) · ×1
  • runtime.UserConsole (cognitive 373) web/src/user-console/runtime.tsx:1222 — runtime.UserConsole has cognitive complexity 373 (threshold 15). Drivers by points: if/else 130 (175 pts), boolean chains 86, ternaries 59 (80 pts), error handling 15 (23 pts), loops 9 (nesting depth added 74). Of this number, 74 points are the body's own statements and 299 belong to 72 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminDashboardRuntime.AdminDashboard (cognitive 286) · ×1
  • AdminDashboardRuntime.AdminDashboard (cognitive 286) web/src/admin/AdminDashboardRuntime.tsx:1757 — AdminDashboardRuntime.AdminDashboard has cognitive complexity 286 (threshold 15). Drivers by points: if/else 407 (498 pts), ternaries 301 (492 pts), boolean chains 319, error handling 60 (67 pts), loops 19 (22 pts), match/switch 3 (4 pts) (nesting depth added 293). To reduce it, split the body into named stages: move each independent 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: 5 other methods here (AdminDashboardRuntime.AdminDashboard::handleManualRefresh, AdminDashboardRuntime.AdminDashboard::handleImportValidatedKeys, AdminDashboardRuntime.AdminDashboard::saveUserTagCatalog, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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 · UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule (cognitive 259) · ×1
  • UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule (cognitive 259) web/src/admin/UpstreamPrivacyStatusModule.tsx:189 — UpstreamPrivacyStatusModule.UpstreamPrivacyStatusModule has cognitive complexity 259 (threshold 15). Drivers by points: ternaries 117 (241 pts), boolean chains 9, if/else 9 (nesting depth added 124). Of this number, 187 points are the body's own statements and 72 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlertsCenter.AlertsCenter (cognitive 213) · ×1
  • AlertsCenter.AlertsCenter (cognitive 213) web/src/admin/AlertsCenter.tsx:460 — AlertsCenter.AlertsCenter has cognitive complexity 213 (threshold 15). Drivers by points: ternaries 65 (157 pts), if/else 29 (43 pts), boolean chains 12, loops 1 (nesting depth added 106). Of this number, 50 points are the body's own statements and 163 belong to 28 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UserDetailSharedUsagePanel.UserDetailSharedUsagePanel (cognitive 166) · ×1
  • UserDetailSharedUsagePanel.UserDetailSharedUsagePanel (cognitive 166) web/src/admin/UserDetailSharedUsagePanel.tsx:296 — UserDetailSharedUsagePanel.UserDetailSharedUsagePanel has cognitive complexity 166 (threshold 15). Drivers by points: ternaries 47 (124 pts), if/else 26, boolean chains 16 (nesting depth added 77). Of this number, 105 points are the body's own statements and 61 belong to 21 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ForwardProxySettingsModule.ForwardProxySettingsModule (cognitive 141) · ×1
  • ForwardProxySettingsModule.ForwardProxySettingsModule (cognitive 141) web/src/admin/ForwardProxySettingsModule.tsx:1780 — ForwardProxySettingsModule.ForwardProxySettingsModule has cognitive complexity 141 (threshold 15). Drivers by points: ternaries 32 (55 pts), boolean chains 37, if/else 34 (37 pts), error handling 10, loops 2 (nesting depth added 26). Of this number, 39 points are the body's own statements and 102 belong to 33 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BillingPage.BillingPage (cognitive 138) · ×1
  • BillingPage.BillingPage (cognitive 138) web/src/user-console/BillingPage.tsx:428 — BillingPage.BillingPage has cognitive complexity 138 (threshold 15). Drivers by points: ternaries 64 (111 pts), boolean chains 15, if/else 12 (nesting depth added 47). Of this number, 98 points are the body's own statements and 40 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminSecuritySettingsModule.AdminSecuritySettingsModule (cognitive 117) · ×1
  • AdminSecuritySettingsModule.AdminSecuritySettingsModule (cognitive 117) web/src/admin/AdminSecuritySettingsModule.tsx:167 — AdminSecuritySettingsModule.AdminSecuritySettingsModule has cognitive complexity 117 (threshold 15). Drivers by points: ternaries 38 (57 pts), boolean chains 26, if/else 21 (23 pts), error handling 11 (nesting depth added 21). Of this number, 48 points are the body's own statements and 69 belong to 19 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · demo.handleDemoRoute (cognitive 110) · ×1
  • demo.handleDemoRoute (cognitive 110) REDACTED:1972 — demo.handleDemoRoute has cognitive complexity 110 (threshold 15). Drivers by points: if/else 79 (83 pts), boolean chains 14, ternaries 7 (13 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TokenDetail.TokenDetail (cognitive 109) · ×1
  • TokenDetail.TokenDetail (cognitive 109) web/src/pages/TokenDetail.tsx:405 — TokenDetail.TokenDetail has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 38 (45 pts), if/else 32 (36 pts), boolean chains 18, error handling 10 (nesting depth added 11). Of this number, 36 points are the body's own statements and 73 belong to 35 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SystemSettingsModule.SystemSettingsModule (cognitive 107) · ×1
  • SystemSettingsModule.SystemSettingsModule (cognitive 107) web/src/admin/SystemSettingsModule.tsx:282 — SystemSettingsModule.SystemSettingsModule has cognitive complexity 107 (threshold 15). Drivers by points: ternaries 48 (52 pts), boolean chains 34, if/else 20, error handling 1 (nesting depth added 4). Of this number, 65 points are the body's own statements and 42 belong to 25 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AdminRecentRequestsPanel.AdminRecentRequestsPanel (cognitive 106) · ×1
  • AdminRecentRequestsPanel.AdminRecentRequestsPanel (cognitive 106) web/src/components/AdminRecentRequestsPanel.tsx:741 — AdminRecentRequestsPanel.AdminRecentRequestsPanel has cognitive complexity 106 (threshold 15). Drivers by points: ternaries 43 (79 pts), boolean chains 16, if/else 10, loops 1 (nesting depth added 36). Most of this is not in the body itself: 15 of the 106 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 1261, a function literal at line 1102, renderFilters, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AdminDashboardRuntime.KeyDetails (cognitive 104) · ×1
  • AdminDashboardRuntime.KeyDetails (cognitive 104) web/src/admin/AdminDashboardRuntime.tsx:12901 — AdminDashboardRuntime.KeyDetails has cognitive complexity 104 (threshold 15). Drivers by points: ternaries 44 (62 pts), if/else 24 (27 pts), boolean chains 10, error handling 5 (nesting depth added 21). Of this number, 30 points are the body's own statements and 74 belong to 21 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PublicHome.PublicHome (cognitive 84) · ×1
  • PublicHome.PublicHome (cognitive 84) web/src/PublicHome.tsx:110 — PublicHome.PublicHome has cognitive complexity 84 (threshold 15). Drivers by points: if/else 33 (35 pts), boolean chains 24, ternaries 18 (21 pts), error handling 4 (nesting depth added 5). Of this number, 23 points are the body's own statements and 61 belong to 35 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ApiKeysValidationDialog.ApiKeysValidationDialog (cognitive 82) · ×1
  • ApiKeysValidationDialog.ApiKeysValidationDialog (cognitive 82) web/src/components/ApiKeysValidationDialog.tsx:310 — ApiKeysValidationDialog.ApiKeysValidationDialog has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 27 (54 pts), boolean chains 19, if/else 7 (9 pts) (nesting depth added 29). Of this number, 32 points are the body's own statements and 50 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · demo.createDemoLog (cognitive 77) · ×1
  • demo.createDemoLog (cognitive 77) REDACTED:95 — demo.createDemoLog has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 50 (74 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HaNodeDetailPanel.HaNodeDetailPanel (cognitive 76) · ×1
  • HaNodeDetailPanel.HaNodeDetailPanel (cognitive 76) web/src/admin/HaNodeDetailPanel.tsx:192 — HaNodeDetailPanel.HaNodeDetailPanel has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 41 (73 pts), boolean chains 3 (nesting depth added 32). Of this number, 21 points are the body's own statements and 55 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HaStatusBanner.HaStatusBanner (cognitive 69) · ×1
  • HaStatusBanner.HaStatusBanner (cognitive 69) web/src/components/HaStatusBanner.tsx:225 — HaStatusBanner.HaStatusBanner has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 22 (50 pts), boolean chains 14, if/else 4 (5 pts) (nesting depth added 29). Of this number, 42 points are the body's own statements and 27 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HaStatusBanner.buildNodeRows (cognitive 59) · ×1
  • HaStatusBanner.buildNodeRows (cognitive 59) web/src/components/HaStatusBanner.tsx:114 — HaStatusBanner.buildNodeRows has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 23 (55 pts), boolean chains 3, loops 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.
D2 · Cognitive Complexity · AdminLogin.AdminLogin (cognitive 59) · ×1
  • AdminLogin.AdminLogin (cognitive 59) web/src/pages/AdminLogin.tsx:25 — AdminLogin.AdminLogin has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 21 (27 pts), boolean chains 16, if/else 14 (15 pts), error handling 1 (nesting depth added 7). Of this number, 31 points are the body's own statements and 28 belong to 13 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DashboardOverview.DashboardOverview (cognitive 58) · ×1
  • DashboardOverview.DashboardOverview (cognitive 58) web/src/admin/DashboardOverview.tsx:546 — DashboardOverview.DashboardOverview has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 19 (54 pts), boolean chains 3, if/else 1 (nesting depth added 35). Of this number, 40 points are the body's own statements and 18 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · runtime.schemaExampleValue (cognitive 57) · ×1
  • runtime.schemaExampleValue (cognitive 57) web/src/user-console/runtime.tsx:778 — runtime.schemaExampleValue has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 8 (15 pts), loops 5 (7 pts), boolean chains 5, match/switch 1 (nesting depth added 24). Of this number, 56 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnouncementsModule.AnnouncementsModule (cognitive 54) · ×1
  • AnnouncementsModule.AnnouncementsModule (cognitive 54) web/src/admin/AnnouncementsModule.tsx:787 — AnnouncementsModule.AnnouncementsModule has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (25 pts), ternaries 15 (22 pts), boolean chains 4, error handling 3 (nesting depth added 10). Of this number, 18 points are the body's own statements and 36 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RequestKindBadge.resolveRequestKindBadgeTone (cognitive 49) · ×1
  • RequestKindBadge.resolveRequestKindBadgeTone (cognitive 49) web/src/components/RequestKindBadge.tsx:57 — RequestKindBadge.resolveRequestKindBadgeTone has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25, boolean chains 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.
D2 · Cognitive Complexity · routes.parseAdminPath (cognitive 47) · ×1
  • routes.parseAdminPath (cognitive 47) web/src/admin/routes.ts:118 — routes.parseAdminPath has cognitive complexity 47 (threshold 15). Drivers by points: if/else 37 (43 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DashboardTrendPanel.DashboardTrendPanel (cognitive 46) · ×1
  • DashboardTrendPanel.DashboardTrendPanel (cognitive 46) web/src/admin/DashboardTrendPanel.tsx:221 — DashboardTrendPanel.DashboardTrendPanel has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 20 (30 pts), if/else 9, boolean chains 6, match/switch 1 (nesting depth added 10). Of this number, 19 points are the body's own statements and 27 belong to 14 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminPagesStoryRuntime.UsersPageCanvas (cognitive 46) · ×1
  • AdminPagesStoryRuntime.UsersPageCanvas (cognitive 46) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4827 — AdminPagesStoryRuntime.UsersPageCanvas has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 18 (32 pts), boolean chains 11, if/else 3 (nesting depth added 14). Most of this is not in the body itself: 13 of the 46 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 4973, a function literal at line 5075, toggleSort, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas (cognitive 46) · ×1
  • AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas (cognitive 46) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5280 — AdminPagesStoryRuntime.UnboundTokenUsagePageCanvas has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 17 (30 pts), boolean chains 10, if/else 6 (nesting depth added 13). Most of this is not in the body itself: 9 of the 46 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 5472, a function literal at line 5582, toggleSort, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · routes.isSameAdminRoute (cognitive 44) · ×1
  • routes.isSameAdminRoute (cognitive 44) web/src/admin/routes.ts:230 — routes.isSameAdminRoute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 20 (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 · AdminRechargeRecordsModule.AdminRechargeRecordsModule (cognitive 43) · ×1
  • AdminRechargeRecordsModule.AdminRechargeRecordsModule (cognitive 43) web/src/admin/AdminRechargeRecordsModule.tsx:56 — AdminRechargeRecordsModule.AdminRechargeRecordsModule has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 15 (23 pts), if/else 12, boolean chains 7, error handling 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 26 belong to 13 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Announcements.UserConsoleAnnouncements (cognitive 42) · ×1
  • Announcements.UserConsoleAnnouncements (cognitive 42) web/src/user-console/Announcements.tsx:80 — Announcements.UserConsoleAnnouncements has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 19 (29 pts), boolean chains 11, if/else 2 (nesting depth added 10). Of this number, 20 points are the body's own statements and 22 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_quality_gates.audit_github_state (cognitive 41) · ×1
  • check_quality_gates.audit_github_state (cognitive 41) .github/scripts/check_quality_gates.py:331 — check_quality_gates.audit_github_state has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 8, ternaries 2 (6 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HaSourceSettingsDialog.HaSourceSettingsDialog (cognitive 41) · ×1
  • HaSourceSettingsDialog.HaSourceSettingsDialog (cognitive 41) web/src/admin/HaSourceSettingsDialog.tsx:100 — HaSourceSettingsDialog.HaSourceSettingsDialog has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 31 (41 pts), boolean chains 18, if/else 12 (13 pts), error handling 1 (nesting depth added 11). 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. This shape REPEATS in the file: one other method here (HaSourceSettingsDialog.HaSourceSettingsDialog::handleSubmit) 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 · RechargePanel.RechargePanel (cognitive 39) · ×1
  • RechargePanel.RechargePanel (cognitive 39) web/src/user-console/RechargePanel.tsx:162 — RechargePanel.RechargePanel has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 18 (32 pts), boolean chains 6, if/else 1 (nesting depth added 14). Of this number, 31 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.requestForwardProxyProgress (cognitive 37) · ×1
  • runtime.requestForwardProxyProgress (cognitive 37) web/src/api/runtime.ts:1331 — runtime.requestForwardProxyProgress has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.syncApiKeyBulkUsageWithProgress (cognitive 37) · ×1
  • runtime.syncApiKeyBulkUsageWithProgress (cognitive 37) web/src/api/runtime.ts:1825 — runtime.syncApiKeyBulkUsageWithProgress has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminPagesStoryRuntime.KeysPageCanvas (cognitive 37) · ×1
  • AdminPagesStoryRuntime.KeysPageCanvas (cognitive 37) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3836 — AdminPagesStoryRuntime.KeysPageCanvas has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 24 (27 pts), boolean chains 8, if/else 2 (nesting depth added 3). Of this number, 21 points are the body's own statements and 16 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ReconciliationProjectionController · ×1
  • ReconciliationProjectionController::advance_slice_inner (cognitive 35) src/store/reconciliation_projection_controller.rs:164 — ReconciliationProjectionController::advance_slice_inner has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (24 pts), loops 3 (5 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · check_quality_gates.parse_workflow (cognitive 35) · ×1
  • check_quality_gates.parse_workflow (cognitive 35) .github/scripts/check_quality_gates.py:69 — check_quality_gates.parse_workflow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 8, 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.
D2 · Cognitive Complexity · release_failure_notifier.main (cognitive 35) · ×1
  • release_failure_notifier.main (cognitive 35) .github/scripts/release_failure_notifier.py:550 — release_failure_notifier.main has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 10, error handling 3 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · McpSessionBindingsModule.McpSessionBindingsModule (cognitive 35) · ×1
  • McpSessionBindingsModule.McpSessionBindingsModule (cognitive 35) web/src/admin/McpSessionBindingsModule.tsx:230 — McpSessionBindingsModule.McpSessionBindingsModule has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 11, if/else 6 (8 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 19 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminRechargeRecordsModule.AdminRechargeRefundDialogBody (cognitive 35) · ×1
  • AdminRechargeRecordsModule.AdminRechargeRefundDialogBody (cognitive 35) web/src/admin/AdminRechargeRecordsModule.tsx:434 — AdminRechargeRecordsModule.AdminRechargeRefundDialogBody has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 17 (31 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForwardProxyManager · ×1
  • ForwardProxyManager::apply_incremental_settings (cognitive 34) src/forward_proxy/manager.rs:195 — ForwardProxyManager::apply_incremental_settings has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminUserRankingsPage.RankingsBarChart (cognitive 34) · ×1
  • AdminUserRankingsPage.RankingsBarChart (cognitive 34) web/src/admin/AdminUserRankingsPage.tsx:241 — AdminUserRankingsPage.RankingsBarChart has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 30 (31 pts), if/else 2, boolean chains 1 (nesting depth added 1). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 292, 281). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ForwardProxyEgressControl.ForwardProxyEgressControl (cognitive 33) · ×1
  • ForwardProxyEgressControl.ForwardProxyEgressControl (cognitive 33) web/src/admin/ForwardProxyEgressControl.tsx:74 — ForwardProxyEgressControl.ForwardProxyEgressControl has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 9, if/else 9 (nesting depth added 3). Of this number, 19 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useOAuthCallbackFlow.useOAuthCallbackFlow (cognitive 33) · ×1
  • useOAuthCallbackFlow.useOAuthCallbackFlow (cognitive 33) web/src/user-console/useOAuthCallbackFlow.ts:24 — useOAuthCallbackFlow.useOAuthCallbackFlow has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 7, ternaries 3 (nesting depth added 2). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 45, 136, 92, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AdminUserRankingsPage.AdminUserRankingsPage (cognitive 32) · ×1
  • AdminUserRankingsPage.AdminUserRankingsPage (cognitive 32) web/src/admin/AdminUserRankingsPage.tsx:842 — AdminUserRankingsPage.AdminUserRankingsPage has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 15 (27 pts), boolean chains 5 (nesting depth added 12). Of this number, 29 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnouncementsModule.AnnouncementsListPanel (cognitive 32) · ×1
  • AnnouncementsModule.AnnouncementsListPanel (cognitive 32) web/src/admin/AnnouncementsModule.tsx:562 — AnnouncementsModule.AnnouncementsListPanel has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 15 (31 pts), boolean chains 1 (nesting depth added 16). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 689, 638). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · UsersUsageScreen.UsersUsageScreen (cognitive 31) · ×1
  • UsersUsageScreen.UsersUsageScreen (cognitive 31) web/src/admin/screens/UsersUsageScreen.tsx:62 — UsersUsageScreen.UsersUsageScreen has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 17 (29 pts), boolean chains 2 (nesting depth added 12). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 194, 313, 381). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ForwardProxySettingsModule.buildVisibleBarHeights (cognitive 31) · ×1
  • ForwardProxySettingsModule.buildVisibleBarHeights (cognitive 31) web/src/admin/ForwardProxySettingsModule.tsx:500 — ForwardProxySettingsModule.buildVisibleBarHeights has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 5 (7 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeyStickyPanels.buildVisibleBarHeights (cognitive 31) · ×1
  • KeyStickyPanels.buildVisibleBarHeights (cognitive 31) web/src/admin/KeyStickyPanels.tsx:90 — KeyStickyPanels.buildVisibleBarHeights has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 5 (7 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqliteReadSnapshot · ×1
  • SqliteReadSnapshot::complete_cooperative_query_inner (cognitive 30) src/store/sqlite_runtime_cooperative.rs:27 — SqliteReadSnapshot::complete_cooperative_query_inner has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaintenanceRuntime · ×1
  • MaintenanceRuntime::run (cognitive 30) src/tavily_proxy/maintenance_runtime.rs:97 — MaintenanceRuntime::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · design_system.format_ascii_box (cognitive 30) · ×1
  • design_system.format_ascii_box (cognitive 30) .codex/skills/ui-ux-pro-max/scripts/design_system.py:267 — design_system.format_ascii_box has cognitive complexity 30 (threshold 15). Drivers by points: loops 9 (16 pts), if/else 13, boolean chains 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AdminUserDetailQuotaWorkspace.AdminUserDetailQuotaWorkspace (cognitive 29) · ×1
  • AdminUserDetailQuotaWorkspace.AdminUserDetailQuotaWorkspace (cognitive 29) web/src/admin/AdminUserDetailQuotaWorkspace.tsx:107 — AdminUserDetailQuotaWorkspace.AdminUserDetailQuotaWorkspace has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 9, if/else 5, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (submitEntitlement, applyEntitlementFilters, a function literal at line 262, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · anchored-info-disclosure.AnchoredInfoDisclosure (cognitive 28) · ×1
  • anchored-info-disclosure.AnchoredInfoDisclosure (cognitive 28) web/src/components/ui/anchored-info-disclosure.tsx:23 — anchored-info-disclosure.AnchoredInfoDisclosure has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, ternaries 4 (6 pts), boolean chains 3 (nesting depth added 2). Most of this is not in the body itself: 7 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (handleBlur, a function literal at line 55, handleClick, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · design_system.format_page_override_md (cognitive 27) · ×1
  • design_system.format_page_override_md (cognitive 27) .codex/skills/ui-ux-pro-max/scripts/design_system.py:838 — design_system.format_page_override_md has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 13 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AdminRecentRequestsPanel.RecentRequestDetails (cognitive 27) · ×1
  • AdminRecentRequestsPanel.RecentRequestDetails (cognitive 27) web/src/components/AdminRecentRequestsPanel.tsx:549 — AdminRecentRequestsPanel.RecentRequestDetails has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 18 (25 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 · ForwardProxySettingsModule.ForwardProxyCandidateDialog (cognitive 27) · ×1
  • ForwardProxySettingsModule.ForwardProxyCandidateDialog (cognitive 27) web/src/admin/ForwardProxySettingsModule.tsx:1528 — ForwardProxySettingsModule.ForwardProxyCandidateDialog has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 13 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · logOperationalClass.failureKindGuidance (cognitive 27) · ×1
  • logOperationalClass.failureKindGuidance (cognitive 27) web/src/lib/logOperationalClass.ts:68 — logOperationalClass.failureKindGuidance has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (26 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SegmentedTabs.SegmentedTabs (cognitive 26) · ×1
  • SegmentedTabs.SegmentedTabs (cognitive 26) web/src/components/ui/SegmentedTabs.tsx:33 — SegmentedTabs.SegmentedTabs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 10, ternaries 3 (4 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 113, findNextEnabledIndex, a function literal at line 98, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · RollingNumber.buildRollingCells (cognitive 26) · ×1
  • RollingNumber.buildRollingCells (cognitive 26) web/src/components/RollingNumber.tsx:82 — RollingNumber.buildRollingCells has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiKeyBulkSyncProgressBubble.ApiKeyBulkSyncProgressBubble (cognitive 26) · ×1
  • ApiKeyBulkSyncProgressBubble.ApiKeyBulkSyncProgressBubble (cognitive 26) web/src/admin/ApiKeyBulkSyncProgressBubble.tsx:49 — ApiKeyBulkSyncProgressBubble.ApiKeyBulkSyncProgressBubble has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 15 (26 pts) (nesting depth added 11). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 89). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · api-key-extract.isPublicIpv4 (cognitive 25) · ×1
  • api-key-extract.isPublicIpv4 (cognitive 25) web/src/lib/api-key-extract.ts:20 — api-key-extract.isPublicIpv4 has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 12. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · generate_relay_mesh_brand_assets.write_vector_svg (cognitive 24) · ×1
  • generate_relay_mesh_brand_assets.write_vector_svg (cognitive 24) web/scripts/generate_relay_mesh_brand_assets.py:211 — generate_relay_mesh_brand_assets.write_vector_svg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (5 pts), boolean chains 4, 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 · demoHa.handleDemoHaRoute (cognitive 24) · ×1
  • demoHa.handleDemoHaRoute (cognitive 24) web/src/api/demoHa.ts:190 — demoHa.handleDemoHaRoute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (8 pts), boolean chains 7 (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 · api-key-extract.parseIpv6 (cognitive 24) · ×1
  • api-key-extract.parseIpv6 (cognitive 24) web/src/lib/api-key-extract.ts:37 — api-key-extract.parseIpv6 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnboundTokenUsageScreen.UnboundTokenUsageScreen (cognitive 23) · ×1
  • UnboundTokenUsageScreen.UnboundTokenUsageScreen (cognitive 23) web/src/admin/screens/UnboundTokenUsageScreen.tsx:52 — UnboundTokenUsageScreen.UnboundTokenUsageScreen has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (21 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 266, 172). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ConnectivityChecksPanel.ConnectivityChecksPanel (cognitive 23) · ×1
  • ConnectivityChecksPanel.ConnectivityChecksPanel (cognitive 23) web/src/components/ConnectivityChecksPanel.tsx:90 — ConnectivityChecksPanel.ConnectivityChecksPanel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (15 pts), boolean chains 5, if/else 3 (nesting depth added 2). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 125, a function literal at line 149, renderProbeBubble). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · verify_relay_mesh_lockup_geometry.validate_structure (cognitive 22) · ×1
  • verify_relay_mesh_lockup_geometry.validate_structure (cognitive 22) web/scripts/verify_relay_mesh_lockup_geometry.py:42 — verify_relay_mesh_lockup_geometry.validate_structure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 9, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UpdateAvailableBanner.UpdateAvailableBanner (cognitive 22) · ×1
  • UpdateAvailableBanner.UpdateAvailableBanner (cognitive 22) web/src/components/UpdateAvailableBanner.tsx:19 — UpdateAvailableBanner.UpdateAvailableBanner has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (20 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForwardProxyProgressBubble.ForwardProxyProgressBubble (cognitive 22) · ×1
  • ForwardProxyProgressBubble.ForwardProxyProgressBubble (cognitive 22) web/src/admin/ForwardProxyProgressBubble.tsx:14 — ForwardProxyProgressBubble.ForwardProxyProgressBubble has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (22 pts) (nesting depth added 10). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 42). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TokenSecretField.TokenSecretField (cognitive 22) · ×1
  • TokenSecretField.TokenSecretField (cognitive 22) web/src/components/TokenSecretField.tsx:40 — TokenSecretField.TokenSecretField has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 3, if/else 1 (nesting depth added 5). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminPagesStoryRuntime.filterStoryRequestLogs (cognitive 22) · ×1
  • AdminPagesStoryRuntime.filterStoryRequestLogs (cognitive 22) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:803 — AdminPagesStoryRuntime.filterStoryRequestLogs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 828). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · design_system._generate_intelligent_overrides (cognitive 21) · ×1
  • design_system._generate_intelligent_overrides (cognitive 21) .codex/skills/ui-ux-pro-max/scripts/design_system.py:948 — design_system._generate_intelligent_overrides has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · release_failure_notifier.inspect_jobs (cognitive 21) · ×1
  • release_failure_notifier.inspect_jobs (cognitive 21) .github/scripts/release_failure_notifier.py:465 — release_failure_notifier.inspect_jobs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate_relay_mesh_brand_assets.remove_background (cognitive 21) · ×1
  • generate_relay_mesh_brand_assets.remove_background (cognitive 21) web/scripts/generate_relay_mesh_brand_assets.py:76 — generate_relay_mesh_brand_assets.remove_background has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenDetail.computeStartDate (cognitive 21) · ×1
  • TokenDetail.computeStartDate (cognitive 21) web/src/pages/TokenDetail.tsx:283 — TokenDetail.computeStartDate has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 6 (8 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeyStickyPanels.KeyStickyPanels (cognitive 21) · ×1
  • KeyStickyPanels.KeyStickyPanels (cognitive 21) web/src/admin/KeyStickyPanels.tsx:309 — KeyStickyPanels.KeyStickyPanels has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14 (21 pts) (nesting depth added 7). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 388, 557, 600, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PublicHome.buildGuideContent (cognitive 21) · ×1
  • PublicHome.buildGuideContent (cognitive 21) web/src/PublicHome.tsx:1047 — PublicHome.buildGuideContent has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 21. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · guide.buildGuideContent (cognitive 21) · ×1
  • guide.buildGuideContent (cognitive 21) REDACTED:146 — guide.buildGuideContent has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 21. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AdminPagesStoryRuntime.StoryUserTagCatalogCard (cognitive 21) · ×1
  • AdminPagesStoryRuntime.StoryUserTagCatalogCard (cognitive 21) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2722 — AdminPagesStoryRuntime.StoryUserTagCatalogCard has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 3 (nesting depth added 5). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminPagesStoryRuntime.UsersUsagePageCanvas (cognitive 21) · ×1
  • AdminPagesStoryRuntime.UsersUsagePageCanvas (cognitive 21) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5102 — AdminPagesStoryRuntime.UsersUsagePageCanvas has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 4 (5 pts) (nesting depth added 1). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 7 function items inside it that branch (toggleSort, a function literal at line 5127, a function literal at line 5143, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · mcpProbe.getMcpProbeResultError (cognitive 20) · ×1
  • mcpProbe.getMcpProbeResultError (cognitive 20) web/src/lib/mcpProbe.ts:180 — mcpProbe.getMcpProbeResultError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · demo.handleUserTags (cognitive 20) · ×1
  • demo.handleUserTags (cognitive 20) REDACTED:2251 — demo.handleUserTags has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 5 (6 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PublicHomeHeroCard.PublicHomeHeroCard (cognitive 20) · ×1
  • PublicHomeHeroCard.PublicHomeHeroCard (cognitive 20) web/src/components/PublicHomeHeroCard.tsx:68 — PublicHomeHeroCard.PublicHomeHeroCard has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (9 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · runtime.buildApiProbeStepDefinitions (cognitive 20) · ×1
  • runtime.buildApiProbeStepDefinitions (cognitive 20) web/src/user-console/runtime.tsx:1030 — runtime.buildApiProbeStepDefinitions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4 (nesting depth added 3). None of this is in the body itself: all 20 points belong to 7 function literals inside it that branch (lines 1113, 1095, 1037, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AdminRecentRequestsRequestKindFilter.AdminRecentRequestsRequestKindFilter (cognitive 19) · ×1
  • AdminRecentRequestsRequestKindFilter.AdminRecentRequestsRequestKindFilter (cognitive 19) web/src/components/AdminRecentRequestsRequestKindFilter.tsx:92 — AdminRecentRequestsRequestKindFilter.AdminRecentRequestsRequestKindFilter has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 218, 167, 271, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · demo.handleTokenRoute (cognitive 19) · ×1
  • demo.handleTokenRoute (cognitive 19) REDACTED:2288 — demo.handleTokenRoute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · userUsageComparison.buildShadowDailyUsageStack (cognitive 19) · ×1
  • userUsageComparison.buildShadowDailyUsageStack (cognitive 19) web/src/admin/userUsageComparison.ts:19 — userUsageComparison.buildShadowDailyUsageStack has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 4, if/else 3 (4 pts) (nesting depth added 7). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForwardProxySettingsModule.formatValidationMessage (cognitive 19) · ×1
  • ForwardProxySettingsModule.formatValidationMessage (cognitive 19) web/src/admin/ForwardProxySettingsModule.tsx:987 — ForwardProxySettingsModule.formatValidationMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6 (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 · ReconciliationEngine · ×1
  • ReconciliationEngine::finalize_observed_candidates (cognitive 18) src/tavily_proxy/reconciliation_engine.rs:488 — ReconciliationEngine::finalize_observed_candidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminRecentRequestsPanel.formatKeyEffectSummary (cognitive 18) · ×1
  • AdminRecentRequestsPanel.formatKeyEffectSummary (cognitive 18) web/src/components/AdminRecentRequestsPanel.tsx:299 — AdminRecentRequestsPanel.formatKeyEffectSummary has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HaSourceSettingsDialog.HaSourceSettingsDialog · ×1
  • HaSourceSettingsDialog.HaSourceSettingsDialog::handleSubmit (cognitive 18) web/src/admin/HaSourceSettingsDialog.tsx:190 — HaSourceSettingsDialog.HaSourceSettingsDialog::handleSubmit has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 5 (6 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (HaSourceSettingsDialog.HaSourceSettingsDialog) 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 · dashboardHourlyCharts.buildAggregatedHourlySlots (cognitive 18) · ×1
  • dashboardHourlyCharts.buildAggregatedHourlySlots (cognitive 18) web/src/admin/dashboardHourlyCharts.ts:446 — dashboardHourlyCharts.buildAggregatedHourlySlots has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 3 (5 pts), boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DesignSystemGenerator._select_best_match (cognitive 17) · ×1
  • DesignSystemGenerator._select_best_match (cognitive 17) .codex/skills/ui-ux-pro-max/scripts/design_system.py:147 — DesignSystemGenerator._select_best_match has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcpProbe.extractProbeErrorText (cognitive 17) · ×1
  • mcpProbe.extractProbeErrorText (cognitive 17) web/src/lib/mcpProbe.ts:139 — mcpProbe.extractProbeErrorText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.appendRequestLogsPageFilters (cognitive 17) · ×1
  • runtime.appendRequestLogsPageFilters (cognitive 17) web/src/api/runtime.ts:1052 — runtime.appendRequestLogsPageFilters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AdminRecentRequestsPanel.formatSelectionEffectSummary (cognitive 17) · ×1
  • AdminRecentRequestsPanel.formatSelectionEffectSummary (cognitive 17) web/src/components/AdminRecentRequestsPanel.tsx:361 — AdminRecentRequestsPanel.formatSelectionEffectSummary has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 1, if/else 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · demo.handleKeyRoute (cognitive 17) · ×1
  • demo.handleKeyRoute (cognitive 17) REDACTED:2193 — demo.handleKeyRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, ternaries 2 (4 pts), boolean chains 2 (nesting depth added 2). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · forwardProxyDialogProgress.buildProgressSteps (cognitive 17) · ×1
  • forwardProxyDialogProgress.buildProgressSteps (cognitive 17) web/src/admin/forwardProxyDialogProgress.ts:50 — forwardProxyDialogProgress.buildProgressSteps has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (17 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AdminDashboardRuntime.formatErrorMessage (cognitive 17) · ×1
  • AdminDashboardRuntime.formatErrorMessage (cognitive 17) web/src/admin/AdminDashboardRuntime.tsx:1590 — AdminDashboardRuntime.formatErrorMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenLogsPanel.TokenLogsPanel (cognitive 17) · ×1
  • TokenLogsPanel.TokenLogsPanel (cognitive 17) web/src/user-console/TokenLogsPanel.tsx:45 — TokenLogsPanel.TokenLogsPanel has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (17 pts) (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · quotaSlider.buildQuotaSliderStages (cognitive 17) · ×1
  • quotaSlider.buildQuotaSliderStages (cognitive 17) web/src/admin/quotaSlider.ts:71 — quotaSlider.buildQuotaSliderStages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminDashboardRuntime.formatKeyEffectSummary (cognitive 16) · ×1
  • AdminDashboardRuntime.formatKeyEffectSummary (cognitive 16) web/src/admin/AdminDashboardRuntime.tsx:1640 — AdminDashboardRuntime.formatKeyEffectSummary has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D3 · God Classes · TooManyFunctions · ×1
  • TooManyFunctions: tavily_hikari::server::spa src/server/spa.rs:1 — TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (153 shared lines) · ×1
  • Near-duplicate member pair (153 shared lines) src/server/serve.rs:1096 — src/server/serve.rs:1096-1337 | src/server/serve.rs:1420-1647 — These two members are variants of one another: 153 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 (121 shared lines) · ×1
  • Near-duplicate member pair (121 shared lines) src/store/mod.rs:2056 — src/store/mod.rs:2056-2222 | src/store/mod.rs:2231-2399 — These two members are variants of one another: 121 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 (119 shared lines) · ×1
  • Near-duplicate member pair (119 shared lines) src/tavily_proxy/reconciliation_engine.rs:997 — src/tavily_proxy/reconciliation_engine.rs:997-1179 | src/tavily_proxy/reconciliation_engine.rs:1187-1359 — These two members are variants of one another: 119 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 (94 shared lines) · ×1
  • Near-duplicate member pair (94 shared lines) src/bin/mcp_session_delete_neutral_repair.rs:495 — src/bin/mcp_session_delete_neutral_repair.rs:495-654 | src/bin/mcp_session_delete_neutral_repair.rs:659-814 — These two members are variants of one another: 94 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 (82 shared lines) · ×1
  • Near-duplicate member pair (82 shared lines) src/store/key_store_alerts.rs:2000 — src/store/key_store_alerts.rs:2000-2118 | src/store/key_store_alerts.rs:2125-2230 — These two members are variants of one another: 82 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 (81 shared lines) · ×1
  • Near-duplicate member pair (81 shared lines) src/store/key_store_upstream_reconciliation.rs:2216 — src/store/key_store_upstream_reconciliation.rs:2216-2455 | src/store/key_store_upstream_reconciliation.rs:2463-2670 — These two members are variants of one another: 81 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (67 shared lines) · ×1
  • Near-duplicate member pair (67 shared lines) src/store/sqlite_runtime.rs:1407 — src/store/sqlite_runtime.rs:1407-1497 | src/store/sqlite_runtime.rs:1588-1667 — These two members are variants of one another: 67 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) src/store/key_store_request_logs_and_dashboard.rs:1278 — src/store/key_store_request_logs_and_dashboard.rs:1278-1545 | src/store/key_store_token_logs.rs:474-675 — These two members are variants of one another: 57 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 (56 shared lines) · ×1
  • Near-duplicate member pair (56 shared lines) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:336 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:336-441 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:576-670 — These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) REDACTED:1562 — REDACTED:1562-1649 | REDACTED:1688-1796 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) src/server/handlers/user.rs:1536 — src/server/handlers/user.rs:1536-1553 | src/server/handlers/user.rs:1559-1579 | src/server/handlers/user.rs:1585-1605 | src/server/handlers/user.rs:1841-1880 | src/server/handlers/user.rs:1885-2103 | src/server/handlers/user.rs:2109-2134 | src/server/handlers/user.rs:2139-2155 | src/server/handlers/user.rs:2161-2180 | src/server/handlers/user.rs:2186-2386 | src/server/handlers/user.rs:2575-2653 | src/server/handlers/user.rs:2660-2685 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) src/server/dto.rs:1543 — src/server/dto.rs:1543-1633 | src/server/dto.rs:1641-1690 | src/server/dto.rs:1698-1741 | src/server/dto.rs:1959-2080 | src/server/dto.rs:2088-2152 | src/server/dto.rs:2160-2218 | src/server/handlers/admin_resources/api_keys_and_logs.rs:967-1012 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/tavily_proxy/mod.rs:730 — src/tavily_proxy/mod.rs:730-743 | src/tavily_proxy/mod.rs:762-775 | src/tavily_proxy/mod.rs:794-807 | src/tavily_proxy/mod.rs:826-839 | src/tavily_proxy/mod.rs:858-871 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) src/server/handlers/admin_resources/alerts.rs:125 — src/server/handlers/admin_resources/alerts.rs:125-223 | src/server/handlers/admin_resources/alerts.rs:230-328 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (78 corresponding lines) · ×1
  • Edited copy of a member (78 corresponding lines) src/lib.rs:2806 — src/lib.rs:2806-2909 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:507-584 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) src/server/ha_peer_lookup.rs:14 — src/server/ha_peer_lookup.rs:14-74 | src/server/ha_peer_lookup.rs:79-164 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) src/server/serve.rs:1797 — src/server/serve.rs:1797-1864 | src/server/serve.rs:1871-1925 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) src/store/key_store_alerts.rs:1304 — src/store/key_store_alerts.rs:1304-1373 | src/store/key_store_alerts.rs:1830-1885 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) src/store/key_store_alerts.rs:1158 — src/store/key_store_alerts.rs:1158-1227 | src/store/key_store_alerts.rs:1908-1961 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) src/store/key_store_linuxdo_credit_recharge.rs:617 — src/store/key_store_linuxdo_credit_recharge.rs:617-655 | src/store/key_store_linuxdo_credit_recharge.rs:660-706 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) src/tavily_proxy/proxy_request_limits.rs:468 — src/tavily_proxy/proxy_request_limits.rs:468-511 | src/tavily_proxy/proxy_request_limits.rs:1153-1192 | src/tavily_proxy/proxy_request_limits.rs:1196-1242 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 50+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 50+ corresponding lines) src/forward_proxy/storage.rs:392 — src/forward_proxy/storage.rs:392-454 | src/forward_proxy/storage.rs:469-535 | src/forward_proxy/storage.rs:540-589 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 50 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) src/bin/mcp_request_log_retry_repair.rs:125 — src/bin/mcp_request_log_retry_repair.rs:125-175 | src/bin/mcp_request_log_retry_repair.rs:181-228 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 37+ corresponding lines) src/store/key_store_admin_passkeys.rs:264 — src/store/key_store_admin_passkeys.rs:264-306 | src/store/key_store_admin_passkeys.rs:665-711 | src/store/key_store_admin_passkeys.rs:786-828 | src/store/key_store_users_and_oauth.rs:1132-1168 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) src/server/handlers/admin_resources/recharges_and_totp.rs:568 — src/server/handlers/admin_resources/recharges_and_totp.rs:568-606 | src/server/schedulers.rs:2058-2090 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) src/store/key_store_token_logs.rs:1932 — src/store/key_store_token_logs.rs:1932-1952 | src/store/key_store_token_logs.rs:1959-1985 | src/store/key_store_token_logs.rs:1992-2013 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) src/tavily_proxy/proxy_usage_and_metrics.rs:666 — src/tavily_proxy/proxy_usage_and_metrics.rs:666-708 | src/tavily_proxy/proxy_usage_and_metrics.rs:1250-1295 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 41+ corresponding lines) src/store/key_store_keys.rs:1506 — src/store/key_store_keys.rs:1506-1550 | src/store/key_store_keys.rs:1555-1597 | src/store/key_store_keys.rs:1704-1744 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) src/bin/observability_lock_holder.rs:19 — src/bin/observability_lock_holder.rs:19-33 | src/bin/support/sqlite_sidecar.rs:233-247 | src/store/mod.rs:1273-1287 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) src/store/key_store_keys.rs:239 — src/store/key_store_keys.rs:239-304 | src/store/key_store_token_logs.rs:2178-2306 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1601 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1601-1624 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1630-1653 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1747-1772 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (74 corresponding lines) · ×1
  • Edited copy of a member (74 corresponding lines) src/store/key_store_schema_migrations_convergence.rs:1249 — src/store/key_store_schema_migrations_convergence.rs:1249-1322 | src/store/key_store_schema_migrations_convergence.rs:1396-1500 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:265 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:265-289 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:295-312 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) src/store/key_store_admin_passkeys.rs:455 — src/store/key_store_admin_passkeys.rs:455-499 | src/store/key_store_upstream_reconciliation.rs:2695-2734 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) src/store/key_store_dashboard_rollup_integrity.rs:1002 — src/store/key_store_dashboard_rollup_integrity.rs:1002-1028 | src/store/key_store_dashboard_rollup_integrity.rs:2176-2202 | src/store/key_store_dashboard_rollup_integrity.rs:3134-3156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) src/lib.rs:699 — src/lib.rs:699-716 | src/lib.rs:724-740 | src/store/key_store_request_logs_gc.rs:49-64 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1551 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1551-1567 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1579-1595 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1665-1681 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1708-1728 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) web/scripts/generate_relay_mesh_brand_assets.py:147 — web/scripts/generate_relay_mesh_brand_assets.py:147-157 | web/scripts/generate_relay_mesh_brand_assets.py:161-170 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) src/store/key_store_account_limit_snapshots.rs:150 — src/store/key_store_account_limit_snapshots.rs:150-179 | src/store/key_store_account_limit_snapshots.rs:185-216 | src/store/key_store_analysis_pressure.rs:101-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) src/store/key_store_keys.rs:1656 — src/store/key_store_keys.rs:1656-1667 | src/store/key_store_keys.rs:1796-1812 | src/store/key_store_users_and_oauth.rs:720-735 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 13+ corresponding lines) src/lib.rs:2998 — src/lib.rs:2998-3011 | src/lib.rs:3030-3042 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:610-623 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:627-640 | src/server/handlers/admin_resources/admin_user_views_and_sort.rs:644-656 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) src/tavily_proxy/proxy_http_and_logs.rs:2088 — src/tavily_proxy/proxy_http_and_logs.rs:2088-2110 | src/tavily_proxy/proxy_http_and_logs.rs:2199-2222 | src/tavily_proxy/proxy_http_and_logs.rs:2239-2261 | src/tavily_proxy/proxy_http_and_logs.rs:2275-2297 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) src/store/key_store_dashboard_rollup_integrity.rs:2350 — src/store/key_store_dashboard_rollup_integrity.rs:2350-2372 | src/store/key_store_dashboard_rollup_integrity.rs:2374-2385 | src/store/key_store_dashboard_rollup_integrity.rs:2503-2517 | src/store/key_store_dashboard_rollup_integrity.rs:3064-3077 | src/store/key_store_dashboard_rollup_integrity.rs:3108-3128 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) src/store/key_store_keys.rs:2280 — src/store/key_store_keys.rs:2280-2298 | src/store/key_store_keys.rs:2410-2429 | src/store/key_store_keys.rs:2467-2486 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) src/store/key_store_admin_passkeys.rs:535 — src/store/key_store_admin_passkeys.rs:535-550 | src/store/key_store_admin_passkeys.rs:557-571 | REDACTED:979-997 | src/store/key_store_token_logs.rs:1436-1454 | src/store/key_store_token_logs.rs:1456-1472 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) src/server/handlers/admin_resources/announcements.rs:31 — src/server/handlers/admin_resources/announcements.rs:31-41 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:89-102 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:675-688 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:693-706 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:1188-1199 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) src/tavily_proxy/proxy_usage_and_metrics.rs:891 — src/tavily_proxy/proxy_usage_and_metrics.rs:891-916 | src/tavily_proxy/proxy_usage_and_metrics.rs:1021-1047 | src/tavily_proxy/proxy_usage_and_metrics.rs:1152-1178 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) src/bin/mcp_session_delete_neutral_repair.rs:123 — src/bin/mcp_session_delete_neutral_repair.rs:123-130 | src/models.rs:2442-2448 | REDACTED:181-192 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) src/server/handlers/public.rs:1767 — src/server/handlers/public.rs:1767-1771 | src/server/handlers/user.rs:1631-1635 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) src/store/key_store_account_limit_snapshots.rs:42 — src/store/key_store_account_limit_snapshots.rs:42-48 | src/store/key_store_keys.rs:2264-2275 | src/store/key_store_meta.rs:73-81 | src/store/key_store_request_logs_and_dashboard.rs:2058-2066 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) src/lib.rs:2691 — src/lib.rs:2691-2693 | src/server/handlers/admin_resources/versions_and_proxy_helpers.rs:388-390 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (153–154 lines × 2) · ×1
  • Duplicated block (153–154 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:852 — src/tavily_proxy/proxy_http_and_logs.rs:852-1004 | src/tavily_proxy/proxy_http_and_logs.rs:1127-1280 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:852` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (70 lines × 2) · ×1
  • Duplicated block (70 lines × 2) src/bin/mcp_session_delete_neutral_repair.rs:506 — src/bin/mcp_session_delete_neutral_repair.rs:506-575 | src/bin/mcp_session_delete_neutral_repair.rs:662-731 — both copies are in the same file, so extract the 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 (60 lines × 2) · ×1
  • Duplicated block (60 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1289 — src/store/key_store_request_logs_and_dashboard.rs:1289-1348 | src/store/key_store_request_logs_and_dashboard.rs:1582-1641 — both copies are in the same file, so extract the 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 (90 lines × 2) · ×1
  • Duplicated block (90 lines × 2) src/server/handlers/tavily.rs:1183 — src/server/handlers/tavily.rs:1183-1272 | src/server/handlers/tavily.rs:1466-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:1183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:504 — src/tavily_proxy/proxy_http_and_logs.rs:504-560 | src/tavily_proxy/proxy_http_and_logs.rs:1421-1477 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:504` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (55 lines × 2) · ×1
  • Duplicated block (55 lines × 2) src/tavily_proxy/reconciliation_engine.rs:1015 — src/tavily_proxy/reconciliation_engine.rs:1015-1069 | src/tavily_proxy/reconciliation_engine.rs:1208-1262 — both copies are in the same file, so extract the 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 `src/tavily_proxy/reconciliation_engine.rs:1015` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/tavily_proxy/reconciliation_engine.rs:1070` calls `disarm` and `src/tavily_proxy/reconciliation_engine.rs:1263` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:574 — src/tavily_proxy/proxy_http_and_logs.rs:574-626 | src/tavily_proxy/proxy_http_and_logs.rs:1491-1543 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:574` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (46–51 lines × 2) · ×1
  • Duplicated block (46–51 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1074 — src/store/key_store_request_logs_and_dashboard.rs:1074-1119 | src/store/key_store_request_logs_and_dashboard.rs:1785-1835 — both copies are in the same file, so extract the 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 `src/store/key_store_request_logs_and_dashboard.rs:1074` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (48–49 lines × 2) · ×1
  • Duplicated block (48–49 lines × 2) src/store/key_store_users_and_oauth.rs:580 — src/store/key_store_users_and_oauth.rs:580-627 | src/store/key_store_users_and_oauth.rs:967-1015 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:580` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44–46 lines × 2) · ×1
  • Duplicated block (44–46 lines × 2) src/server/serve.rs:1258 — src/server/serve.rs:1258-1301 | src/server/serve.rs:1588-1633 — both copies are in the same file, so extract the 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 `src/server/serve.rs:1258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37–43 lines × 2) · ×1
  • Duplicated block (37–43 lines × 2) src/store/key_store_token_logs.rs:379 — src/store/key_store_token_logs.rs:379-415 | src/store/key_store_token_logs.rs:878-920 — both copies are in the same file, so extract the 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 `src/store/key_store_token_logs.rs:878` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) src/store/key_store_upstream_reconciliation.rs:2238 — src/store/key_store_upstream_reconciliation.rs:2238-2280 | src/store/key_store_upstream_reconciliation.rs:2477-2519 — both copies are in the same file, so extract the 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 `src/store/key_store_upstream_reconciliation.rs:2238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (40–41 lines × 2) · ×1
  • Duplicated block (40–41 lines × 2) src/server/serve.rs:1209 — src/server/serve.rs:1209-1248 | src/server/serve.rs:1524-1564 — both copies are in the same file, so extract the 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 `src/server/serve.rs:1209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:809 — src/tavily_proxy/proxy_http_and_logs.rs:809-849 | src/tavily_proxy/proxy_http_and_logs.rs:1077-1117 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:809` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) src/tavily_proxy/proxy_usage_and_metrics.rs:670 — src/tavily_proxy/proxy_usage_and_metrics.rs:670-708 | src/tavily_proxy/proxy_usage_and_metrics.rs:1257-1295 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_usage_and_metrics.rs:670` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) src/store/key_store_alert_canonical_groups.rs:1913 — src/store/key_store_alert_canonical_groups.rs:1913-1949 | src/store/key_store_alert_canonical_groups.rs:2094-2130 — both copies are in the same file, so extract the 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 `src/store/key_store_alert_canonical_groups.rs:1913` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) src/store/key_store_request_logs_and_dashboard.rs:1404 — src/store/key_store_request_logs_and_dashboard.rs:1404-1438 | src/store/key_store_request_logs_and_dashboard.rs:1720-1754 — both copies are in the same file, so extract the 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 (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) src/store/key_store_alert_canonical_groups.rs:2217 — src/store/key_store_alert_canonical_groups.rs:2217-2248 | src/store/key_store_alert_canonical_groups.rs:2272-2304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) src/store/mod.rs:390 — src/store/mod.rs:390-421 | src/store/mod.rs:424-455 | src/store/mod.rs:458-489 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/mod.rs:390` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:189 — src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:189-219 | src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:322-351 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/user_tag_and_token_handlers.rs:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) src/store/key_store_admin_privacy_read.rs:132 — src/store/key_store_admin_privacy_read.rs:132-162 | src/store/key_store_alert_projection.rs:1144-1171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_admin_privacy_read.rs:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) src/server/proxy/proxy_handlers_and_views.rs:1210 — src/server/proxy/proxy_handlers_and_views.rs:1210-1238 | src/server/proxy/proxy_handlers_and_views.rs:1315-1344 — both copies are in the same file, so extract the 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 `src/server/proxy/proxy_handlers_and_views.rs:1210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–30 lines × 2) · ×1
  • Duplicated block (26–30 lines × 2) src/server/serve.rs:1808 — src/server/serve.rs:1808-1837 | src/server/serve.rs:1880-1905 — both copies are in the same file, so extract the 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 `src/server/serve.rs:1808` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (28 lines × 3) · ×1
  • Duplicated block (28 lines × 3) src/store/mod.rs:2176 — src/store/mod.rs:2176-2203 | src/store/mod.rs:2353-2380 | src/store/mod.rs:2572-2599 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/mod.rs:2176` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src/server/handlers/tavily.rs:495 — src/server/handlers/tavily.rs:495-521 | src/server/handlers/tavily.rs:549-575 — both copies are in the same file, so extract the 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 `src/server/handlers/tavily.rs:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) src/tavily_proxy/proxy_http_and_logs.rs:372 — src/tavily_proxy/proxy_http_and_logs.rs:372-397 | src/tavily_proxy/proxy_http_and_logs.rs:1302-1326 — both copies are in the same file, so extract the 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 `src/tavily_proxy/proxy_http_and_logs.rs:372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–25 lines × 4) · ×1
  • Duplicated block (23–25 lines × 4) src/store/key_store_token_logs.rs:479 — src/store/key_store_token_logs.rs:479-503 | src/store/key_store_token_logs.rs:697-721 | src/store/key_store_token_logs.rs:956-978 | src/store/key_store_token_logs.rs:1023-1045 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_token_logs.rs:479` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) src/store/key_store_dashboard_rollup_integrity.rs:2690 — src/store/key_store_dashboard_rollup_integrity.rs:2690-2713 | src/store/key_store_dashboard_rollup_integrity.rs:2808-2831 | src/store/key_store_dashboard_rollup_integrity.rs:3243-3266 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_dashboard_rollup_integrity.rs:2690` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) src/server/serve.rs:1224 — src/server/serve.rs:1224-1246 | src/server/serve.rs:1262-1284 | src/server/serve.rs:1540-1562 | src/server/serve.rs:1594-1616 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/serve.rs:1224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–23 lines × 3) · ×1
  • Duplicated block (22–23 lines × 3) src/store/key_store_request_logs_and_dashboard.rs:826 — src/store/key_store_request_logs_and_dashboard.rs:826-848 | src/store/key_store_request_logs_and_dashboard.rs:1300-1321 | src/store/key_store_request_logs_and_dashboard.rs:1593-1614 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_request_logs_and_dashboard.rs:826` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_request_logs_and_dashboard.rs:1299` calls `canonical_request_kind_label_sql` and `src/store/key_store_request_logs_and_dashboard.rs:826` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:473 — src/tavily_proxy/proxy_http_and_logs.rs:473-495 | src/tavily_proxy/proxy_http_and_logs.rs:1391-1413 | src/tavily_proxy/proxy_http_and_logs.rs:1670-1692 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:473` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) src/store/sqlite_runtime_cooperative.rs:58 — src/store/sqlite_runtime_cooperative.rs:58-79 | src/store/sqlite_runtime_cooperative.rs:108-129 | src/store/sqlite_runtime_cooperative.rs:163-184 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime_cooperative.rs:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) src/store/key_store_alerts.rs:2755 — src/store/key_store_alerts.rs:2755-2775 | src/store/key_store_alerts.rs:2785-2805 | src/store/key_store_alerts.rs:2815-2835 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alerts.rs:2755` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–20 lines × 4) · ×1
  • Duplicated block (18–20 lines × 4) src/tavily_proxy/proxy_http_and_logs.rs:406 — src/tavily_proxy/proxy_http_and_logs.rs:406-425 | src/tavily_proxy/proxy_http_and_logs.rs:771-788 | src/tavily_proxy/proxy_http_and_logs.rs:1041-1058 | src/tavily_proxy/proxy_http_and_logs.rs:1335-1353 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/tavily_proxy/proxy_http_and_logs.rs:789` calls `insert`, `to_string`, `Bool` and `src/tavily_proxy/proxy_http_and_logs.rs:426` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) src/store/key_store_token_logs.rs:525 — src/store/key_store_token_logs.rs:525-543 | src/store/key_store_token_logs.rs:723-741 | src/store/key_store_token_logs.rs:804-822 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_token_logs.rs:525` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:416 — src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:416-433 | src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:644-662 — both copies are in the same file, so extract the 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 `src/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:416` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) src/store/key_store_admin_privacy_read.rs:104 — src/store/key_store_admin_privacy_read.rs:104-118 | src/store/key_store_alert_projection.rs:1108-1126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_admin_privacy_read.rs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) src/store/key_store_alerts.rs:2001 — src/store/key_store_alerts.rs:2001-2018 | src/store/key_store_alerts.rs:2126-2141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–17 lines × 5) · ×1
  • Duplicated block (14–17 lines × 5) src/tavily_proxy/proxy_http_and_logs.rs:466 — src/tavily_proxy/proxy_http_and_logs.rs:466-479 | src/tavily_proxy/proxy_http_and_logs.rs:818-834 | src/tavily_proxy/proxy_http_and_logs.rs:1086-1102 | src/tavily_proxy/proxy_http_and_logs.rs:1384-1397 | src/tavily_proxy/proxy_http_and_logs.rs:1663-1676 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:466` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tavily_proxy/proxy_http_and_logs.rs:816` calls `header`, `body`, `clone` and `src/tavily_proxy/proxy_http_and_logs.rs:1662` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) src/tavily_proxy/proxy_http_and_logs.rs:574 — src/tavily_proxy/proxy_http_and_logs.rs:574-589 | src/tavily_proxy/proxy_http_and_logs.rs:898-913 | src/tavily_proxy/proxy_http_and_logs.rs:1174-1189 | src/tavily_proxy/proxy_http_and_logs.rs:1491-1506 | src/tavily_proxy/proxy_http_and_logs.rs:1756-1771 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:574` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) src/store/sqlite_runtime.rs:3628 — src/store/sqlite_runtime.rs:3628-3642 | src/store/sqlite_runtime.rs:3690-3704 | src/store/sqlite_runtime_cooperative.rs:61-75 | src/store/sqlite_runtime_cooperative.rs:111-125 | src/store/sqlite_runtime_cooperative.rs:166-180 — before extracting anything, compare `src/store/sqlite_runtime.rs` and `src/store/sqlite_runtime_cooperative.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:3628` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10–14 lines × 6) · ×1
  • Duplicated block (10–14 lines × 6) src/store/sqlite_runtime.rs:3366 — src/store/sqlite_runtime.rs:3366-3375 | src/store/sqlite_runtime.rs:3626-3639 | src/store/sqlite_runtime.rs:3688-3701 | src/store/sqlite_runtime_cooperative.rs:60-72 | src/store/sqlite_runtime_cooperative.rs:110-122 | src/store/sqlite_runtime_cooperative.rs:165-177 — before extracting anything, compare `src/store/sqlite_runtime.rs` and `src/store/sqlite_runtime_cooperative.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/sqlite_runtime.rs:3366` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn close(mut` in one and `crate) async fn close_after_query( mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) src/store/key_store_announcements.rs:329 — src/store/key_store_announcements.rs:329-342 | REDACTED:1159-1171 | REDACTED:1259-1271 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_announcements.rs:329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1257` calls `bind` and `REDACTED:1157` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) src/store/key_store_alerts.rs:1047 — src/store/key_store_alerts.rs:1047-1058 | src/store/key_store_alerts.rs:1185-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alerts.rs:1185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) src/tavily_proxy/mod.rs:731 — src/tavily_proxy/mod.rs:731-743 | src/tavily_proxy/mod.rs:763-775 | src/tavily_proxy/mod.rs:795-807 | src/tavily_proxy/mod.rs:827-839 | src/tavily_proxy/mod.rs:859-871 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12–13 lines × 5) · ×1
  • Duplicated block (12–13 lines × 5) src/tavily_proxy/proxy_http_and_logs.rs:388 — src/tavily_proxy/proxy_http_and_logs.rs:388-400 | src/tavily_proxy/proxy_http_and_logs.rs:756-768 | src/tavily_proxy/proxy_http_and_logs.rs:1026-1038 | src/tavily_proxy/proxy_http_and_logs.rs:1318-1329 | src/tavily_proxy/proxy_http_and_logs.rs:1618-1630 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:388` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) src/tavily_proxy/proxy_http_and_logs.rs:921 — src/tavily_proxy/proxy_http_and_logs.rs:921-933 | src/tavily_proxy/proxy_http_and_logs.rs:983-994 | src/tavily_proxy/proxy_http_and_logs.rs:1197-1209 | src/tavily_proxy/proxy_http_and_logs.rs:1259-1270 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:921` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) src/store/key_store_dashboard_rollup_integrity.rs:1740 — src/store/key_store_dashboard_rollup_integrity.rs:1740-1761 | src/store/key_store_request_logs_gc.rs:254-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) src/store/key_store_users_and_oauth.rs:1282 — src/store/key_store_users_and_oauth.rs:1282-1294 | src/store/key_store_users_and_oauth.rs:1396-1406 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:1282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–12 lines × 5) · ×1
  • Duplicated block (5–12 lines × 5) src/store/key_store_account_usage_rollups.rs:572 — src/store/key_store_account_usage_rollups.rs:572-583 | src/store/key_store_account_usage_rollups.rs:586-597 | src/store/key_store_account_usage_rollups.rs:600-611 | src/store/key_store_account_usage_rollups.rs:614-625 | src/store/key_store_account_usage_rollups.rs:626-630 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_account_usage_rollups.rs:572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/key_store_account_usage_rollups.rs:571` calls `then_with`, `cmp` and `src/store/key_store_account_usage_rollups.rs:626` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) src/tavily_proxy/proxy_http_and_logs.rs:501 — src/tavily_proxy/proxy_http_and_logs.rs:501-511 | src/tavily_proxy/proxy_http_and_logs.rs:1123-1133 | src/tavily_proxy/proxy_http_and_logs.rs:1418-1428 | src/tavily_proxy/proxy_http_and_logs.rs:1697-1707 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:501` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) src/analysis.rs:42 — src/analysis.rs:42-52 | src/analysis.rs:370-378 | src/analysis.rs:403-411 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) src/store/key_store_alerts.rs:1919 — src/store/key_store_alerts.rs:1919-1929 | src/store/key_store_alerts.rs:2602-2610 — both copies are in the same file, so extract the 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 `src/store/key_store_alerts.rs:1919` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) src/tavily_proxy/proxy_request_limits.rs:1305 — src/tavily_proxy/proxy_request_limits.rs:1305-1312 | src/tavily_proxy/proxy_request_limits.rs:1424-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • Duplicated block (11 lines × 7) src/server/dto.rs:1549 — src/server/dto.rs:1549-1559 | src/server/dto.rs:1648-1658 | src/server/dto.rs:1702-1712 | src/server/dto.rs:1979-1989 | src/server/dto.rs:2109-2119 | src/server/dto.rs:2178-2188 | src/server/handlers/admin_resources/api_keys_and_logs.rs:971-981 — before extracting anything, compare `src/server/dto.rs` and `src/server/handlers/admin_resources/api_keys_and_logs.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/server/dto.rs:1547` calls `unwrap_or`, `max`, `clamp` and `src/server/dto.rs:1701` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) src/store/key_store_users_and_oauth.rs:264 — src/store/key_store_users_and_oauth.rs:264-272 | src/store/key_store_users_and_oauth.rs:635-644 — both copies are in the same file, so extract the 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 `src/store/key_store_users_and_oauth.rs:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 10) · ×1
  • Duplicated block (7–8 lines × 10) src/server/handlers/tavily.rs:647 — src/server/handlers/tavily.rs:647-653 | src/server/handlers/tavily.rs:1121-1128 | src/server/handlers/tavily.rs:1146-1153 | src/server/handlers/tavily.rs:1241-1247 | src/server/handlers/tavily.rs:1410-1417 | src/server/handlers/tavily.rs:1435-1442 | src/server/handlers/tavily.rs:1523-1529 | src/server/proxy/proxy_handlers_and_views.rs:1679-1686 | src/server/proxy/proxy_handlers_and_views.rs:1705-1712 | src/server/proxy/proxy_handlers_and_views.rs:1796-1802 — before extracting anything, compare `src/server/handlers/tavily.rs` and `src/server/proxy/proxy_handlers_and_views.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/tavily.rs:647` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) src/tavily_proxy/proxy_http_and_logs.rs:504 — src/tavily_proxy/proxy_http_and_logs.rs:504-511 | src/tavily_proxy/proxy_http_and_logs.rs:851-858 | src/tavily_proxy/proxy_http_and_logs.rs:1126-1133 | src/tavily_proxy/proxy_http_and_logs.rs:1421-1428 | src/tavily_proxy/proxy_http_and_logs.rs:1700-1707 — 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 (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) src/store/key_store_upstream_reconciliation.rs:2274 — src/store/key_store_upstream_reconciliation.rs:2274-2281 | src/store/key_store_upstream_reconciliation.rs:2422-2429 | src/store/key_store_upstream_reconciliation.rs:2513-2520 | src/store/key_store_upstream_reconciliation.rs:2624-2631 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_upstream_reconciliation.rs:2274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–8 lines × 3) · ×1
  • Duplicated block (5–8 lines × 3) src/tavily_proxy/proxy_http_and_logs.rs:426 — src/tavily_proxy/proxy_http_and_logs.rs:426-430 | src/tavily_proxy/proxy_http_and_logs.rs:1060-1067 | src/tavily_proxy/proxy_http_and_logs.rs:1355-1362 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:426` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) src/tavily_proxy/proxy_http_and_logs.rs:174 — src/tavily_proxy/proxy_http_and_logs.rs:174-180 | src/tavily_proxy/proxy_http_and_logs.rs:454-460 | src/tavily_proxy/proxy_http_and_logs.rs:808-814 | src/tavily_proxy/proxy_http_and_logs.rs:1076-1082 | src/tavily_proxy/proxy_http_and_logs.rs:1372-1378 | src/tavily_proxy/proxy_http_and_logs.rs:1651-1657 — 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) src/store/key_store_dashboard_quota_recovery.rs:740 — src/store/key_store_dashboard_quota_recovery.rs:740-745 | src/store/key_store_request_logs_and_dashboard.rs:2391-2397 — before extracting anything, compare `src/store/key_store_dashboard_quota_recovery.rs` and `src/store/key_store_request_logs_and_dashboard.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_dashboard_quota_recovery.rs:740` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) src/tavily_proxy/proxy_http_and_logs.rs:447 — src/tavily_proxy/proxy_http_and_logs.rs:447-452 | src/tavily_proxy/proxy_http_and_logs.rs:801-806 | src/tavily_proxy/proxy_http_and_logs.rs:1069-1074 | src/tavily_proxy/proxy_http_and_logs.rs:1365-1370 | src/tavily_proxy/proxy_http_and_logs.rs:1644-1649 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:447` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (3–6 lines × 3) · ×1
  • Duplicated block (3–6 lines × 3) src/store/immediate_transaction.rs:156 — src/store/immediate_transaction.rs:156-161 | src/store/immediate_transaction.rs:172-174 | src/store/immediate_transaction.rs:178-183 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/immediate_transaction.rs:156` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn commit_connection( mut` in one and `crate) async fn rollback_connection( mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/store/immediate_transaction.rs:156` calls `take`, `expect` and `src/store/immediate_transaction.rs:172` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 11) · ×1
  • Duplicated block (6 lines × 11) src/server/handlers/user.rs:1537 — src/server/handlers/user.rs:1537-1542 | src/server/handlers/user.rs:1560-1565 | src/server/handlers/user.rs:1587-1592 | src/server/handlers/user.rs:1842-1847 | src/server/handlers/user.rs:1886-1891 | src/server/handlers/user.rs:2110-2115 | src/server/handlers/user.rs:2140-2145 | src/server/handlers/user.rs:2162-2167 | src/server/handlers/user.rs:2188-2193 | src/server/handlers/user.rs:2576-2581 | src/server/handlers/user.rs:2661-2666 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/server/handlers/user.rs:1543` calls `parse_user_today_window_query` and `src/server/handlers/user.rs:1593` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) src/tavily_proxy/proxy_http_and_logs.rs:168 — src/tavily_proxy/proxy_http_and_logs.rs:168-172 | src/tavily_proxy/proxy_http_and_logs.rs:448-452 | src/tavily_proxy/proxy_http_and_logs.rs:802-806 | src/tavily_proxy/proxy_http_and_logs.rs:1070-1074 | src/tavily_proxy/proxy_http_and_logs.rs:1366-1370 | src/tavily_proxy/proxy_http_and_logs.rs:1645-1649 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tavily_proxy/proxy_http_and_logs.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) src/server/handlers/public.rs:1519 — src/server/handlers/public.rs:1519-1524 | src/server/handlers/user.rs:2815-2819 | src/server/handlers/user.rs:2870-2874 | src/server/proxy/mcp_helpers.rs:76-80 — before extracting anything, compare `src/server/handlers/public.rs` and `src/server/handlers/user.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/handlers/public.rs:1519` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) src/bin/ha_outbox_cleanup_once.rs:203 — src/bin/ha_outbox_cleanup_once.rs:203-212 | src/bin/observability_sidecar_migrate.rs:31-40 | src/bin/request_logs_gc_once.rs:47-56 | src/bin/request_statistics_recovery_once.rs:47-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (33 lines × 3) · ×1
  • Duplicated block (33 lines × 3) src/forward_proxy/storage.rs:405 — src/forward_proxy/storage.rs:405-443 | src/forward_proxy/storage.rs:482-524 | src/forward_proxy/storage.rs:547-579 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/forward_proxy/storage.rs:445` calls `bind` and `src/forward_proxy/storage.rs:581` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) src/store/key_store_keys.rs:448 — src/store/key_store_keys.rs:448-479 | src/store/key_store_keys.rs:482-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_keys.rs:448` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) src/store/key_store_keys.rs:2335 — src/store/key_store_keys.rs:2335-2364 | src/store/key_store_request_logs_and_dashboard.rs:2201-2215 | src/store/key_store_upstream_reconciliation.rs:2170-2193 | src/store/key_store_users_and_oauth.rs:2186-2215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_keys.rs:2335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) src/store/key_store_keys.rs:2378 — src/store/key_store_keys.rs:2378-2402 | src/store/key_store_keys.rs:2437-2460 | src/store/key_store_keys.rs:2902-2917 | src/store/key_store_keys.rs:2926-2941 | src/store/key_store_users_and_oauth.rs:429-442 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) src/store/key_store_alert_canonical_groups.rs:1427 — src/store/key_store_alert_canonical_groups.rs:1427-1446 | src/store/key_store_alert_canonical_groups.rs:1457-1476 | src/store/key_store_alert_canonical_groups.rs:1487-1506 | src/store/key_store_alert_canonical_groups.rs:1517-1536 | src/store/key_store_alert_canonical_groups.rs:1547-1567 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:1427` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) src/store/key_store_alert_projection.rs:328 — src/store/key_store_alert_projection.rs:328-365 | src/store/key_store_alert_projection.rs:521-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_projection.rs:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 5) · ×1
  • Duplicated block (17 lines × 5) src/store/key_store_alert_canonical_groups.rs:706 — src/store/key_store_alert_canonical_groups.rs:706-725 | src/store/key_store_alert_canonical_groups.rs:1881-1897 | src/store/key_store_alert_canonical_groups.rs:1983-1999 | src/store/key_store_alert_canonical_groups.rs:2062-2078 | src/store/key_store_alert_canonical_groups.rs:2158-2174 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:706` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) src/store/key_store_alert_canonical_groups.rs:483 — src/store/key_store_alert_canonical_groups.rs:483-493 | src/store/key_store_alert_canonical_groups.rs:1881-1897 | src/store/key_store_alert_canonical_groups.rs:1983-1999 | src/store/key_store_alert_canonical_groups.rs:2062-2078 | src/store/key_store_alert_canonical_groups.rs:2158-2174 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/store/key_store_alert_canonical_groups.rs:483` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) src/server/schedulers.rs:873 — src/server/schedulers.rs:873-887 | src/server/schedulers.rs:895-909 | src/server/schedulers.rs:966-979 | src/server/schedulers.rs:987-1000 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/server/schedulers.rs:873` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) src/forward_proxy/responses_and_validation.rs:1696 — src/forward_proxy/responses_and_validation.rs:1696-1701 | src/forward_proxy/responses_and_validation.rs:1726-1731 | src/forward_proxy/responses_and_validation.rs:1734-1739 | src/forward_proxy/responses_and_validation.rs:1742-1747 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/forward_proxy/responses_and_validation.rs:1696` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) src/models.rs:2313 — src/models.rs:2313-2317 | src/models.rs:2334-2338 | src/models.rs:3067-3071 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/models.rs:2313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–10 lines × 5) · ×1
  • Duplicated block (7–10 lines × 5) .codex/skills/ui-ux-pro-max/scripts/design_system.py:864 — .codex/skills/ui-ux-pro-max/scripts/design_system.py:864-873 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:875-884 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:886-895 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:897-906 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:907-913 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) .codex/skills/ui-ux-pro-max/scripts/design_system.py:678 — .codex/skills/ui-ux-pro-max/scripts/design_system.py:678-684 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:696-702 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:711-717 | .codex/skills/ui-ux-pro-max/scripts/design_system.py:741-749 — 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.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.91 rust-toolchain.toml:1 — rust-toolchain.toml declares Rust 1.91 as this project's toolchain file, and Rust 1.91, superseded by 1.92 on 2025-12-11 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2025-12-11 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
IC1 · Incompleteness & stubs · Hollow method · ×1
  • Hollow method — returns a constant without doing the work REDACTED:1021 — `import_ha_recovery_events` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
P5 · DR & Backup · No DR/backup evidence · ×1
  • No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (79 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (79 clone groups) web/src/admin/DashboardOverview.tsx:90 — 79 duplicated blocks under web/src/ have copies in at least two of the sibling directories admin, api, components, i18n, lib, pages (+1 more sibling(s) not listed) — 35 of them are reported below, and 44 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 79 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 79 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 79 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (7 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (7 clone groups) web/src/admin/screens/UnboundTokenUsageScreen.tsx:106 — 7 duplicated blocks under web/src/admin/ have copies in at least two of the sibling directories screens, storySupport — 6 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (230 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (230 matched lines × 2 locations) web/src/admin/screens/UnboundTokenUsageScreen.tsx:106 — web/src/admin/screens/UnboundTokenUsageScreen.tsx:106 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:5406 — the two spans are one implementation copied and then locally edited — 1447 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (224 lines × 2 locations) · ×1
  • Duplicated block (224 lines × 2 locations) web/src/PublicHome.tsx:1047 — web/src/PublicHome.tsx:1047 · REDACTED:146 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block with local edits (120 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (120 matched lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:8048 — web/src/admin/AdminDashboardRuntime.tsx:8048 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2702 — the two spans are one implementation copied and then locally edited — 830 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (91 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (91 matched lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:10888 — web/src/admin/AdminDashboardRuntime.tsx:10888 · web/src/admin/AdminDashboardRuntime.tsx:11616 — the two spans are one implementation copied and then locally edited — 578 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (85 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (85 matched lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:12322 — web/src/admin/AdminDashboardRuntime.tsx:12322 · web/src/admin/screens/UsersUsageScreen.tsx:244 — the two spans are one implementation copied and then locally edited — 528 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (59 lines × 2 locations) · ×1
  • Duplicated block (59 lines × 2 locations) web/src/admin/DashboardOverview.tsx:90 — web/src/admin/DashboardOverview.tsx:90 · web/src/i18n/types.ts:277 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block (48 lines × 2 locations) · ×1
  • Duplicated block (48 lines × 2 locations) web/src/api/userConsoleNormalization.ts:301 — web/src/api/userConsoleNormalization.ts:301 · web/src/api/userConsoleNormalization.ts:415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:9710 — web/src/admin/AdminDashboardRuntime.tsx:9710 · web/src/admin/AdminDashboardRuntime.tsx:9979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (46 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (46 matched lines × 2 locations) web/src/lib/haCopy.ts:57 — web/src/lib/haCopy.ts:57 · web/src/lib/haCopy.ts:109 — the two spans are one implementation copied and then locally edited — 258 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (44 lines × 2 locations) · ×1
  • Duplicated block (44 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:3809 — web/src/admin/AdminDashboardRuntime.tsx:3809 · web/src/admin/AdminDashboardRuntime.tsx:13016 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (41 lines × 2 locations) · ×1
  • Duplicated block (41 lines × 2 locations) web/src/components/requestLogRebalance.tsx:36 — web/src/components/requestLogRebalance.tsx:36 · web/src/components/requestLogRebalance.tsx:88 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (40 lines × 2 locations) · ×1
  • Duplicated block (40 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:4086 — web/src/admin/AdminDashboardRuntime.tsx:4086 · web/src/admin/AdminDashboardRuntime.tsx:5347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) web/src/admin/ApiKeyBulkSyncProgressBubble.tsx:85 — web/src/admin/ApiKeyBulkSyncProgressBubble.tsx:85 · web/src/admin/ForwardProxyProgressBubble.tsx:38 — the two spans are one implementation copied and then locally edited — 165 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) web/src/admin/ForwardProxySettingsModule.tsx:500 — web/src/admin/ForwardProxySettingsModule.tsx:500 · web/src/admin/KeyStickyPanels.tsx:90 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (37 lines × 2 locations) · ×1
  • Duplicated block (37 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:11530 — web/src/admin/AdminDashboardRuntime.tsx:11530 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4283 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×1
  • Duplicated block (36 lines × 2 locations) web/src/admin/ForwardProxySettingsModule.tsx:1160 — web/src/admin/ForwardProxySettingsModule.tsx:1160 · web/src/admin/ForwardProxySettingsModule.tsx:1244 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (35 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (35 matched lines × 2 locations) web/src/components/LanguageSwitcher.tsx:17 — web/src/components/LanguageSwitcher.tsx:17 · web/src/components/UserConsoleHeader.tsx:139 — the two spans are one implementation copied and then locally edited — 229 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (32 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (32 matched lines × 2 locations) web/src/components/ui/dropdown-menu.tsx:42 — web/src/components/ui/dropdown-menu.tsx:42 · web/src/components/ui/dropdown-menu.tsx:78 — the two spans are one implementation copied and then locally edited — 174 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (28 lines × 3 locations) · ×1
  • Duplicated block (28 lines × 3 locations) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3998 — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3998 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4037 · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:4076 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) web/src/admin/AdminDashboardRuntime.tsx:8296 — web/src/admin/AdminDashboardRuntime.tsx:8296 · web/src/admin/AdminDashboardRuntime.tsx:8333 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (27 lines × 3 locations) · ×1
  • Duplicated block (27 lines × 3 locations) web/src/admin/AdminDashboardRuntime.tsx:11184 — web/src/admin/AdminDashboardRuntime.tsx:11184 · web/src/admin/AdminDashboardRuntime.tsx:11224 · web/src/admin/AdminDashboardRuntime.tsx:11263 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R2 · Cyclomatic Complexity · Complex function AdminDashboard (cyclomatic 335, cognitive 319) · ×1
  • Complex function AdminDashboard (cyclomatic 335, cognitive 319) web/src/admin/AdminDashboardRuntime.tsx:1757 — AdminDashboard has cyclomatic complexity 335 and cognitive complexity 319; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function UpstreamPrivacyStatusModule (cyclomatic 126, cognitive 114) · ×1
  • Complex function UpstreamPrivacyStatusModule (cyclomatic 126, cognitive 114) web/src/admin/UpstreamPrivacyStatusModule.tsx:189 — UpstreamPrivacyStatusModule has cyclomatic complexity 126 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SystemSettingsModule (cyclomatic 121, cognitive 95) · ×1
  • Complex function SystemSettingsModule (cyclomatic 121, cognitive 95) web/src/admin/SystemSettingsModule.tsx:282 — SystemSettingsModule has cyclomatic complexity 121 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleDemoRoute (cyclomatic 101, cognitive 110) · ×1
  • Complex function handleDemoRoute (cyclomatic 101, cognitive 110) REDACTED:1972 — handleDemoRoute has cyclomatic complexity 101 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function BillingPage (cyclomatic 67, cognitive 66) · ×1
  • Complex function BillingPage (cyclomatic 67, cognitive 66) web/src/user-console/BillingPage.tsx:428 — BillingPage has cyclomatic complexity 67 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function play (cyclomatic 67, cognitive 61) · ×1
  • Complex function play (cyclomatic 67, cognitive 61) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:7318 — play has cyclomatic complexity 67 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ForwardProxySettingsModule (cyclomatic 67, cognitive 56) · ×1
  • Complex function ForwardProxySettingsModule (cyclomatic 67, cognitive 56) web/src/admin/ForwardProxySettingsModule.tsx:1780 — ForwardProxySettingsModule has cyclomatic complexity 67 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 65, cognitive 101) · ×1
  • Complex function (anonymous) (cyclomatic 65, cognitive 101) web/src/UserConsole.stories.tsx:934 — (anonymous) has cyclomatic complexity 65 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AdminSecuritySettingsModule (cyclomatic 64, cognitive 57) · ×1
  • Complex function AdminSecuritySettingsModule (cyclomatic 64, cognitive 57) web/src/admin/AdminSecuritySettingsModule.tsx:167 — AdminSecuritySettingsModule has cyclomatic complexity 64 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function resolveRequestKindBadgeTone (cyclomatic 61, cognitive 51) · ×1
  • Complex function resolveRequestKindBadgeTone (cyclomatic 61, cognitive 51) web/src/components/RequestKindBadge.tsx:57 — resolveRequestKindBadgeTone has cyclomatic complexity 61 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function createDemoLog (cyclomatic 55, cognitive 54) · ×1
  • Complex function createDemoLog (cyclomatic 55, cognitive 54) REDACTED:95 — createDemoLog has cyclomatic complexity 55 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ApiKeysValidationDialog (cyclomatic 52, cognitive 48) · ×1
  • Complex function ApiKeysValidationDialog (cyclomatic 52, cognitive 48) web/src/components/ApiKeysValidationDialog.tsx:310 — ApiKeysValidationDialog has cyclomatic complexity 52 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function PublicHome (cyclomatic 47, cognitive 44) · ×1
  • Complex function PublicHome (cyclomatic 47, cognitive 44) web/src/PublicHome.tsx:110 — PublicHome has cyclomatic complexity 47 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AlertsCenter (cyclomatic 46, cognitive 45) · ×1
  • Complex function AlertsCenter (cyclomatic 46, cognitive 45) web/src/admin/AlertsCenter.tsx:460 — AlertsCenter has cyclomatic complexity 46 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function schemaExampleValue (cyclomatic 44, cognitive 59) · ×1
  • Complex function schemaExampleValue (cyclomatic 44, cognitive 59) web/src/user-console/runtime.tsx:778 — schemaExampleValue has cyclomatic complexity 44 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isSameAdminRoute (cyclomatic 43, cognitive 46) · ×1
  • Complex function isSameAdminRoute (cyclomatic 43, cognitive 46) web/src/admin/routes.ts:230 — isSameAdminRoute has cyclomatic complexity 43 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function HaStatusBanner (cyclomatic 43, cognitive 44) · ×1
  • Complex function HaStatusBanner (cyclomatic 43, cognitive 44) web/src/components/HaStatusBanner.tsx:225 — HaStatusBanner has cyclomatic complexity 43 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseAdminPath (cyclomatic 42, cognitive 47) · ×1
  • Complex function parseAdminPath (cyclomatic 42, cognitive 47) web/src/admin/routes.ts:118 — parseAdminPath has cyclomatic complexity 42 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function UserDetailSharedUsagePanel (cyclomatic 41, cognitive 40) · ×1
  • Complex function UserDetailSharedUsagePanel (cyclomatic 41, cognitive 40) web/src/admin/UserDetailSharedUsagePanel.tsx:296 — UserDetailSharedUsagePanel has cyclomatic complexity 41 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function TokenDetail (cyclomatic 39, cognitive 38) · ×1
  • Complex function TokenDetail (cyclomatic 39, cognitive 38) web/src/pages/TokenDetail.tsx:405 — TokenDetail has cyclomatic complexity 39 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function HaSourceSettingsDialog (cyclomatic 39, cognitive 35) · ×1
  • Complex function HaSourceSettingsDialog (cyclomatic 39, cognitive 35) web/src/admin/HaSourceSettingsDialog.tsx:100 — HaSourceSettingsDialog has cyclomatic complexity 39 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RechargePanel (cyclomatic 39, cognitive 34) · ×1
  • Complex function RechargePanel (cyclomatic 39, cognitive 34) web/src/user-console/RechargePanel.tsx:162 — RechargePanel has cyclomatic complexity 39 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleManualRefresh (cyclomatic 38, cognitive 44) · ×1
  • Complex function handleManualRefresh (cyclomatic 38, cognitive 44) web/src/admin/AdminDashboardRuntime.tsx:5167 — handleManualRefresh has cyclomatic complexity 38 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ForwardProxyCandidateDialog (cyclomatic 38, cognitive 27) · ×1
  • Complex function ForwardProxyCandidateDialog (cyclomatic 38, cognitive 27) web/src/admin/ForwardProxySettingsModule.tsx:1528 — ForwardProxyCandidateDialog has cyclomatic complexity 38 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function KeyDetails (cyclomatic 37, cognitive 34) · ×1
  • Complex function KeyDetails (cyclomatic 37, cognitive 34) web/src/admin/AdminDashboardRuntime.tsx:12901 — KeyDetails has cyclomatic complexity 37 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildNodeRows (cyclomatic 35, cognitive 44) · ×1
  • Complex function buildNodeRows (cyclomatic 35, cognitive 44) web/src/components/HaStatusBanner.tsx:114 — buildNodeRows has cyclomatic complexity 35 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 34, cognitive 30) · ×1
  • Complex function (anonymous) (cyclomatic 34, cognitive 30) web/src/admin/AdminDashboardRuntime.tsx:8072 — (anonymous) has cyclomatic complexity 34 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function McpSessionBindingsModule (cyclomatic 33, cognitive 32) · ×1
  • Complex function McpSessionBindingsModule (cyclomatic 33, cognitive 32) web/src/admin/McpSessionBindingsModule.tsx:230 — McpSessionBindingsModule has cyclomatic complexity 33 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AdminLogin (cyclomatic 33, cognitive 29) · ×1
  • Complex function AdminLogin (cyclomatic 33, cognitive 29) web/src/pages/AdminLogin.tsx:25 — AdminLogin has cyclomatic complexity 33 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RecentRequestDetails (cyclomatic 32, cognitive 30) · ×1
  • Complex function RecentRequestDetails (cyclomatic 32, cognitive 30) web/src/components/AdminRecentRequestsPanel.tsx:549 — RecentRequestDetails has cyclomatic complexity 32 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isPublicIpv4 (cyclomatic 32, cognitive 25) · ×1
  • Complex function isPublicIpv4 (cyclomatic 32, cognitive 25) web/src/lib/api-key-extract.ts:20 — isPublicIpv4 has cyclomatic complexity 32 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 31, cognitive 68) · ×1
  • Complex function (anonymous) (cyclomatic 31, cognitive 68) web/src/user-console/runtime.tsx:2398 — (anonymous) has cyclomatic complexity 31 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function play (cyclomatic 31, cognitive 30) · ×1
  • Complex function play (cyclomatic 31, cognitive 30) web/src/admin/AnnouncementsModule.stories.tsx:234 — play has cyclomatic complexity 31 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 30, cognitive 29) · ×1
  • Complex function (anonymous) (cyclomatic 30, cognitive 29) web/src/admin/HaNodeDetailPanel.tsx:311 — (anonymous) has cyclomatic complexity 30 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function syncApiKeyBulkUsageWithProgress (cyclomatic 29, cognitive 50) · ×1
  • Complex function syncApiKeyBulkUsageWithProgress (cyclomatic 29, cognitive 50) web/src/api/runtime.ts:1825 — syncApiKeyBulkUsageWithProgress has cyclomatic complexity 29 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 29, cognitive 28) · ×1
  • Complex function (anonymous) (cyclomatic 29, cognitive 28) web/src/admin/AdminDashboardRuntime.tsx:8457 — (anonymous) has cyclomatic complexity 29 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function play (cyclomatic 29, cognitive 27) · ×1
  • Complex function play (cyclomatic 29, cognitive 27) web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:7896 — play has cyclomatic complexity 29 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function requestForwardProxyProgress (cyclomatic 28, cognitive 47) · ×1
  • Complex function requestForwardProxyProgress (cyclomatic 28, cognitive 47) web/src/api/runtime.ts:1331 — requestForwardProxyProgress has cyclomatic complexity 28 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 28, cognitive 31) · ×1
  • Complex function (anonymous) (cyclomatic 28, cognitive 31) web/src/pages/TokenDetail.stories.tsx:594 — (anonymous) has cyclomatic complexity 28 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function failureKindGuidance (cyclomatic 28, cognitive 28) · ×1
  • Complex function failureKindGuidance (cyclomatic 28, cognitive 28) web/src/lib/logOperationalClass.ts:68 — failureKindGuidance has cyclomatic complexity 28 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · web/src/admin/AdminDashboardRuntime.tsx · ×1
  • web/src/admin/AdminDashboardRuntime.tsx: 13102 lines of code web/src/admin/AdminDashboardRuntime.tsx:1 — web/src/admin/AdminDashboardRuntime.tsx has 13102 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/storySupport/AdminPagesStoryRuntime.tsx · ×1
  • web/src/admin/storySupport/AdminPagesStoryRuntime.tsx: 7648 lines of code web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:1 — web/src/admin/storySupport/AdminPagesStoryRuntime.tsx has 7648 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/api/runtime.ts · ×1
  • web/src/api/runtime.ts: 3690 lines of code web/src/api/runtime.ts:1 — web/src/api/runtime.ts has 3690 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/user-console/runtime.tsx · ×1
  • web/src/user-console/runtime.tsx: 3154 lines of code web/src/user-console/runtime.tsx:1 — web/src/user-console/runtime.tsx has 3154 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/ForwardProxySettingsModule.tsx · ×1
  • web/src/admin/ForwardProxySettingsModule.tsx: 2848 lines of code web/src/admin/ForwardProxySettingsModule.tsx:1 — web/src/admin/ForwardProxySettingsModule.tsx has 2848 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2495 lines of code REDACTED:1 — REDACTED has 2495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/UserConsole.stories.tsx · ×1
  • web/src/UserConsole.stories.tsx: 2225 lines of code web/src/UserConsole.stories.tsx:1 — web/src/UserConsole.stories.tsx has 2225 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/types.ts · ×1
  • web/src/i18n/types.ts: 1945 lines of code web/src/i18n/types.ts:1 — web/src/i18n/types.ts has 1945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/translations/en.ts · ×1
  • web/src/i18n/translations/en.ts: 1629 lines of code web/src/i18n/translations/en.ts:1 — web/src/i18n/translations/en.ts has 1629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/translations/zh.ts · ×1
  • web/src/i18n/translations/zh.ts: 1628 lines of code web/src/i18n/translations/zh.ts:1 — web/src/i18n/translations/zh.ts has 1628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/pages/TokenDetail.tsx · ×1
  • web/src/pages/TokenDetail.tsx: 1518 lines of code web/src/pages/TokenDetail.tsx:1 — web/src/pages/TokenDetail.tsx has 1518 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/SystemSettingsModule.tsx · ×1
  • web/src/admin/SystemSettingsModule.tsx: 1497 lines of code web/src/admin/SystemSettingsModule.tsx:1 — web/src/admin/SystemSettingsModule.tsx has 1497 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/AlertsCenter.tsx · ×1
  • web/src/admin/AlertsCenter.tsx: 1458 lines of code web/src/admin/AlertsCenter.tsx:1 — web/src/admin/AlertsCenter.tsx has 1458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/AdminRecentRequestsPanel.tsx · ×1
  • web/src/components/AdminRecentRequestsPanel.tsx: 1414 lines of code web/src/components/AdminRecentRequestsPanel.tsx:1 — web/src/components/AdminRecentRequestsPanel.tsx has 1414 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/PublicHome.tsx · ×1
  • web/src/PublicHome.tsx: 1380 lines of code web/src/PublicHome.tsx:1 — web/src/PublicHome.tsx has 1380 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/DashboardOverview.stories.tsx · ×1
  • web/src/admin/DashboardOverview.stories.tsx: 1260 lines of code web/src/admin/DashboardOverview.stories.tsx:1 — web/src/admin/DashboardOverview.stories.tsx has 1260 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/DashboardOverview.tsx · ×1
  • web/src/admin/DashboardOverview.tsx: 1158 lines of code web/src/admin/DashboardOverview.tsx:1 — web/src/admin/DashboardOverview.tsx has 1158 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/UpstreamPrivacyStatusModule.tsx · ×1
  • web/src/admin/UpstreamPrivacyStatusModule.tsx: 1091 lines of code web/src/admin/UpstreamPrivacyStatusModule.tsx:1 — web/src/admin/UpstreamPrivacyStatusModule.tsx has 1091 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/AdminRecentRequestsPanel.stories.tsx · ×1
  • web/src/components/AdminRecentRequestsPanel.stories.tsx: 1008 lines of code web/src/components/AdminRecentRequestsPanel.stories.tsx:1 — web/src/components/AdminRecentRequestsPanel.stories.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/AnnouncementsModule.tsx · ×1
  • web/src/admin/AnnouncementsModule.tsx: 983 lines of code web/src/admin/AnnouncementsModule.tsx:1 — web/src/admin/AnnouncementsModule.tsx has 983 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/UserDetailSharedUsagePanel.tsx · ×1
  • web/src/admin/UserDetailSharedUsagePanel.tsx: 956 lines of code web/src/admin/UserDetailSharedUsagePanel.tsx:1 — web/src/admin/UserDetailSharedUsagePanel.tsx has 956 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/AdminUserRankingsPage.tsx · ×1
  • web/src/admin/AdminUserRankingsPage.tsx: 941 lines of code web/src/admin/AdminUserRankingsPage.tsx:1 — web/src/admin/AdminUserRankingsPage.tsx has 941 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/user-console/BillingPage.tsx · ×1
  • web/src/user-console/BillingPage.tsx: 933 lines of code web/src/user-console/BillingPage.tsx:1 — web/src/user-console/BillingPage.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/pages/TokenDetail.stories.tsx · ×1
  • web/src/pages/TokenDetail.stories.tsx: 865 lines of code web/src/pages/TokenDetail.stories.tsx:1 — web/src/pages/TokenDetail.stories.tsx has 865 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 834 lines of code REDACTED:1 — REDACTED has 834 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/ApiKeysValidationDialog.tsx · ×1
  • web/src/components/ApiKeysValidationDialog.tsx: 831 lines of code web/src/components/ApiKeysValidationDialog.tsx:1 — web/src/components/ApiKeysValidationDialog.tsx has 831 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/UpstreamPrivacyStatusModule.stories.tsx · ×1
  • web/src/admin/UpstreamPrivacyStatusModule.stories.tsx: 799 lines of code web/src/admin/UpstreamPrivacyStatusModule.stories.tsx:1 — web/src/admin/UpstreamPrivacyStatusModule.stories.tsx has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/user-console/BillingPage.stories.tsx · ×1
  • web/src/user-console/BillingPage.stories.tsx: 799 lines of code web/src/user-console/BillingPage.stories.tsx:1 — web/src/user-console/BillingPage.stories.tsx has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/AdminSecuritySettingsModule.tsx · ×1
  • web/src/admin/AdminSecuritySettingsModule.tsx: 770 lines of code web/src/admin/AdminSecuritySettingsModule.tsx:1 — web/src/admin/AdminSecuritySettingsModule.tsx has 770 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/HaStatusBanner.stories.tsx · ×1
  • web/src/components/HaStatusBanner.stories.tsx: 765 lines of code web/src/components/HaStatusBanner.stories.tsx:1 — web/src/components/HaStatusBanner.stories.tsx has 765 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/routes.ts · ×1
  • web/src/admin/routes.ts: 703 lines of code web/src/admin/routes.ts:1 — web/src/admin/routes.ts has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/ForwardProxyEgressControl.stories.tsx · ×1
  • web/src/admin/ForwardProxyEgressControl.stories.tsx: 649 lines of code web/src/admin/ForwardProxyEgressControl.stories.tsx:1 — web/src/admin/ForwardProxyEgressControl.stories.tsx has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/DashboardTrendPanel.tsx · ×1
  • web/src/admin/DashboardTrendPanel.tsx: 638 lines of code web/src/admin/DashboardTrendPanel.tsx:1 — web/src/admin/DashboardTrendPanel.tsx has 638 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/McpSessionBindingsModule.tsx · ×1
  • web/src/admin/McpSessionBindingsModule.tsx: 621 lines of code web/src/admin/McpSessionBindingsModule.tsx:1 — web/src/admin/McpSessionBindingsModule.tsx has 621 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/user-console/RechargePanel.tsx · ×1
  • web/src/user-console/RechargePanel.tsx: 608 lines of code web/src/user-console/RechargePanel.tsx:1 — web/src/user-console/RechargePanel.tsx has 608 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/KeyStickyPanels.tsx · ×1
  • web/src/admin/KeyStickyPanels.tsx: 607 lines of code web/src/admin/KeyStickyPanels.tsx:1 — web/src/admin/KeyStickyPanels.tsx has 607 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/AdminUserDetailQuotaWorkspace.tsx · ×1
  • web/src/admin/AdminUserDetailQuotaWorkspace.tsx: 593 lines of code web/src/admin/AdminUserDetailQuotaWorkspace.tsx:1 — web/src/admin/AdminUserDetailQuotaWorkspace.tsx has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/dashboardHourlyCharts.ts · ×1
  • web/src/admin/dashboardHourlyCharts.ts: 557 lines of code web/src/admin/dashboardHourlyCharts.ts:1 — web/src/admin/dashboardHourlyCharts.ts has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/admin/AdminRechargeRecordsModule.tsx · ×1
  • web/src/admin/AdminRechargeRecordsModule.tsx: 537 lines of code web/src/admin/AdminRechargeRecordsModule.tsx:1 — web/src/admin/AdminRechargeRecordsModule.tsx has 537 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/HaStatusBanner.tsx · ×1
  • web/src/components/HaStatusBanner.tsx: 530 lines of code web/src/components/HaStatusBanner.tsx:1 — web/src/components/HaStatusBanner.tsx has 530 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~55 LoC) · ×1
  • Dead file (~55 LoC) scripts/capture_admin_pressure_storybook.mjs — no import path from any entry point (40 application, 13 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unlisted import '@iconify/types' · ×1
  • Unlisted import '@iconify/types' web/src/lib/icon-data.ts:1 — Imported only as a TYPE and declared in no reachable REDACTED. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning REDACTED.
R8 · Dependency Hygiene · Unused dependency '@modelcontextprotocol/inspector' · ×1
  • Unused dependency '@modelcontextprotocol/inspector' REDACTED:20 — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'dprint' · ×1
  • Unused dependency 'dprint' REDACTED:23 — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@tanstack/react-router' · ×1
  • Unused dependency '@tanstack/react-router' REDACTED:29 — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm src/server/handlers/user.rs:1783 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X12 · Unreachable branch · Statement is unreachable · ×1
  • Statement is unreachable — control never gets past the statement before it src/tavily_proxy/proxy_affinity.rs:1254 — `match self.key_store.get_research_request_affinity(request_id, now).await { O…` follows `{ return Ok(owner == token_id); }` (line 1250) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
X18 · Disposal-pattern correctness · Explicit release owed and not made on every path · ×1
  • Explicit release owed and not made on every path REDACTED:673 — `tx` (line 673) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 987; the `return` on line 869 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
Minor — 96 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×35
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:1128 — `Boolean(tag.systemKey) || tag.source === 'system_linuxdo'` appears character-identically in 3 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/screens/shared.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:977 — `Number.isFinite(parsedPage) && parsedPage > 1` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/routes.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminUserRankingsPage.tsx:72 — `color.startsWith('hsl(') && color.endsWith(')')` appears character-identically in 4 files — web/src/admin/AdminUserRankingsPage.tsx, web/src/admin/DashboardOverview.tsx, web/src/admin/DashboardTrendPanel.tsx, web/src/admin/PressureAnalysisScreen.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/PublicHome.tsx:1373 — `content.samples && content.samples.length > 0` appears character-identically in 2 files — web/src/PublicHome.tsx, 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 web/src/admin/AdminDashboardRuntime.tsx:12873 — `forwarded.length > 0 || dropped.length > 0` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/components/AdminRecentRequestsPanel.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/api/runtime.ts:1236 — `init?.body != null && !headers.has('Content-Type')` appears character-identically in 2 files — web/src/api/runtime.ts, web/src/lib/mcpProbe.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/screens/UsersUsageScreen.tsx:196 — `item.displayName || item.username || item.userId` appears character-identically in 2 files — web/src/admin/screens/UsersUsageScreen.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/screens/UnboundTokenUsageScreen.tsx:179 — `item.monthlyBrokenCount == null || item.monthlyBrokenLimit == null` appears character-identically in 2 files — web/src/admin/screens/UnboundTokenUsageScreen.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:11558 — `item.quota_remaining != null && item.quota_limit != null` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:6573 — `item.shadowDailyAvailability != null || item.shadowDailyCreditsUsed != null` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:1615 — `log.http_status != null && log.mcp_status != null` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/components/AdminRecentRequestsPanel.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:1518 — `normalized === 'active' || normalized === 'success' || normalized === 'completed'` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:1520 — `normalized === 'exhausted' || normalized === 'quota_exhausted' || normalized === 'retry_exhausted'` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/user-console/BillingPage.tsx:189 — `order.status === 'paid' && order.paidAt != null` appears character-identically in 2 files — web/src/user-console/BillingPage.tsx, web/src/user-console/RechargePanel.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/lib/userConsoleRoutes.ts:86 — `route.name === 'token' || route.name === 'tokenLogs'` appears character-identically in 2 files — web/src/lib/userConsoleRoutes.ts, web/src/user-console/runtime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/user-console/BillingPage.tsx:174 — `status === 'pending' || status === 'expired' || status === 'refunding'` appears character-identically in 2 files — web/src/user-console/BillingPage.tsx, web/src/user-console/RechargePanel.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/api/adminUserNormalization.ts:41 — `typeof candidate === 'number' && Number.isFinite(candidate)` appears character-identically in 2 files — web/src/api/adminUserNormalization.ts, web/src/api/userConsoleNormalization.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/components/RollingNumber.tsx:267 — `typeof value === 'number' && Number.isFinite(value)` appears character-identically in 6 files — web/src/components/RollingNumber.tsx, web/src/lib/haCopy.ts, web/src/lib/mcpProbe.ts, web/src/user-console/UserDashboardOverview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/api/adminUserNormalization.ts:21 — `typeof value === 'object' && value !== null` appears character-identically in 2 files — web/src/api/adminUserNormalization.ts, web/src/api/userConsoleNormalization.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/admin/AdminDashboardRuntime.tsx:710 — `user.displayName || user.username || user.userId` appears character-identically in 2 files — web/src/admin/AdminDashboardRuntime.tsx, web/src/admin/storySupport/AdminPagesStoryRuntime.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/src/api/adminUserNormalization.ts:62 — `value.scope === 'user' || value.scope === 'token'` appears character-identically in 2 files — web/src/api/adminUserNormalization.ts, web/src/api/userConsoleNormalization.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate .github/scripts/check_quality_gates.py:289 — `result.stderr.strip() or result.stdout.strip() or f"exit {result.returncode}"` appears character-identically in 2 files — .github/scripts/check_quality_gates.py, .github/scripts/detect_docs_pages_changes.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/lib.rs:2734 — `!ip.is_loopback() && !ip.is_unspecified() && !ip.is_multicast() && !ip.is_unique_local() && !ip.is_unicast_link_local() && !is_documentation` appears character-identically in 2 files — src/lib.rs, src/server/handlers/admin_resources/versions_and_proxy_helpers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/store/key_store_request_stats_coalescer.rs:179 — `Self::pending_key_count(state) > 0 && state.flush_deadline.is_none()` appears character-identically in 2 files — src/store/key_store_request_stats_coalescer.rs, src/tavily_proxy/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/lib.rs:2696 — `ip.is_private() || ip.is_loopback() || ip.is_link_local() || ip.is_broadcast() || ip.is_documentation() || ip.is_unspecified() || ip.is_mult…` appears character-identically in 2 files — src/lib.rs, src/server/handlers/admin_resources/versions_and_proxy_helpers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 10 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×6
  • Silent fallback default in catch REDACTED:1953 — `readJsonBody` 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.
  • Silent fallback default in catch web/src/admin/displayDensity.ts:14 — `readStoredAdminDisplayDensity` swallows every exception into `return 'comfortable'` — 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.
  • Silent fallback default in catch web/src/user-console/Announcements.tsx:54 — `formatAnnouncementTime` 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.
  • Silent fallback default in catch web/src/admin/AnnouncementsModule.tsx:225 — `formatTimestamp` 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.
  • Silent fallback default in catch web/src/PublicHome.tsx:1430 — `loadTokenMap` 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.
  • Silent fallback default in catch web/src/user-console/useAnnouncements.ts:39 — `readClosedAnnouncementRecords` 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.
X7 · Silent fallback defaults · Silent fallback default on Err · ×5
  • Silent fallback default on Err src/tavily_proxy/proxy_core.rs:156 — `parse_retry_after_secs_value` turns every `Err` into `Some(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/analysis.rs:2523 — `redact_api_key_bytes` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src/server/proxy/mcp_helpers.rs:132 — `mcp_session_retry_after_secs` turns every `Err` into `Some(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/store/key_store_alert_event_projection.rs:529 — `retain_alert_group_child_events` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src/store/sqlite_runtime_maintenance_metrics.rs:346 — `sqlite_file_size` turns every `Err` into `"unknown".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.
X4 · Structured logging · Interpolated log message defeats structured logging · ×4
  • Interpolated log message defeats structured logging src/store/mod.rs:226 — `warn!` at line 226 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging src/store/mod.rs:243 — `error!` at line 243 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging src/store/mod.rs:639 — `warn!` at line 639 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging src/server/schedulers.rs:333 — `warn!` at line 333 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
D30 · Dependency Vulnerabilities · Low CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
X9 · Subsumed condition operand · Subsumed condition operand · ×3
  • Subsumed condition operand src/store/key_store_alert_event_projection.rs:30 — `key.contains("accesstoken")` can never decide this `||` — every value satisfying `key.contains("accesstoken")` also satisfies `key.contains("token")`, 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/store/key_store_alert_event_projection.rs:31 — `key.contains("refreshtoken")` can never decide this `||` — every value satisfying `key.contains("refreshtoken")` also satisfies `key.contains("token")`, 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/server/handlers/admin_resources/forward_proxy_and_key_validation.rs:200 — `message.contains("non_business_body_days")` can never decide this `||` — every value satisfying `message.contains("non_business_body_days")` also satisfies `message.contains("business_body_days")`, 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.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×2
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (178608 LoC, 483 module-visible types across 16 directories) overshoots its size bounds. 2 of 3 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `web` (84369 LoC, 636 module-visible types across 15 directories) overshoots its size bounds. 2 of 3 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
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.
C3 · Audit Trail · Partial audit-trail evidence · ×1
  • Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: a write-side hook every change flows through (a SeaORM ActiveModelBehavior hook or a database trigger recording each change, or an event-sourced store), per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
D24 · Comment Value · redundant comment · ×1
  • redundant comment web/src/admin/AdminDashboardRuntime.tsx:2170 — "Batch dialog state" repeats the code it sits on: 3 of its 3 words (batch, dialog, state) are already in `const [batchDialogOpen, setBatchDialogOpen] = useState(false)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P3 · Security & performance tooling · Dependabot does not watch github-actions/bun/cargo · ×1
  • Dependabot does not watch github-actions/bun/cargo REDACTED:2 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `bun`, `cargo`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
R7 · Dead Code · Unused export 'buildMonthBackdropBaseline' · ×1
  • Unused export 'buildMonthBackdropBaseline' web/src/admin/dashboardCardBackdrops.ts:37 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatQuotaDraftInput' · ×1
  • Unused export 'formatQuotaDraftInput' web/src/admin/quotaSlider.ts:47 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'findNearestQuotaSliderStageIndex' · ×1
  • Unused export 'findNearestQuotaSliderStageIndex' web/src/admin/quotaSlider.ts:122 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildQuotaSliderTrack' · ×1
  • Unused export 'buildQuotaSliderTrack' web/src/admin/quotaSlider.ts:176 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'UserTagBadgeList' · ×1
  • Unused export 'UserTagBadgeList' web/src/admin/screens/shared.tsx:192 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ObservedClientIpHeaderValue' · ×1
  • Unused export 'ObservedClientIpHeaderValue' web/src/api/clientIp.ts:8 — Nothing ultimately consumes this binding: its only referrer is the re-export in web/src/api/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web/src/api/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'extractTvlyDevApiKeyFromLine' · ×1
  • Unused export 'extractTvlyDevApiKeyFromLine' web/src/lib/api-key-extract.ts:129 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'extractTvlyDevApiKeysFromText' · ×1
  • Unused export 'extractTvlyDevApiKeysFromText' web/src/lib/api-key-extract.ts:133 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'TEST_RECHARGE_AMOUNT_LDC' · ×1
  • Unused export 'TEST_RECHARGE_AMOUNT_LDC' web/src/user-console/rechargeControls.ts:4 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'REPO_URL' · ×1
  • Unused module-local declaration 'REPO_URL' web/src/PublicHome.tsx:81 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'DASHBOARD_RECENT_LOGS_PER_PAGE' · ×1
  • Unused module-local declaration 'DASHBOARD_RECENT_LOGS_PER_PAGE' web/src/admin/AdminDashboardRuntime.tsx:453 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'DASHBOARD_RECENT_JOBS_PER_PAGE' · ×1
  • Unused module-local declaration 'DASHBOARD_RECENT_JOBS_PER_PAGE' web/src/admin/AdminDashboardRuntime.tsx:454 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'MonthlyBrokenCountTrigger' · ×1
  • Unused module-local declaration 'MonthlyBrokenCountTrigger' web/src/admin/AdminDashboardRuntime.tsx:678 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'formatUnboundTokenIdentityMeta' · ×1
  • Unused module-local declaration 'formatUnboundTokenIdentityMeta' web/src/admin/AdminDashboardRuntime.tsx:793 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'LogRow' · ×1
  • Unused module-local declaration 'LogRow' web/src/admin/AdminDashboardRuntime.tsx:12689 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'isValidPercentDraft' · ×1
  • Unused module-local declaration 'isValidPercentDraft' web/src/admin/SystemSettingsModule.tsx:137 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'logResultTone' · ×1
  • Unused module-local declaration 'logResultTone' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2898 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestErrorText' · ×1
  • Unused module-local declaration 'requestErrorText' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2905 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestKeyEffectText' · ×1
  • Unused module-local declaration 'requestKeyEffectText' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2914 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestStatusPair' · ×1
  • Unused module-local declaration 'requestStatusPair' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2920 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestStatusTip' · ×1
  • Unused module-local declaration 'requestStatusTip' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:2924 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestKeyEffectTone' · ×1
  • Unused module-local declaration 'requestKeyEffectTone' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3050 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestKeyEffectBadgeLabel' · ×1
  • Unused module-local declaration 'requestKeyEffectBadgeLabel' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3068 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestFailureGuidance' · ×1
  • Unused module-local declaration 'requestFailureGuidance' web/src/admin/storySupport/AdminPagesStoryRuntime.tsx:3090 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'DEMO_TEST_RECHARGE_AMOUNT_LDC' · ×1
  • Unused module-local declaration 'DEMO_TEST_RECHARGE_AMOUNT_LDC' REDACTED:36 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'normalizeRecentAlertsSummary' · ×1
  • Unused module-local declaration 'normalizeRecentAlertsSummary' web/src/api/runtime.ts:1008 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestKindBillingQuickFilterOptions' · ×1
  • Unused module-local declaration 'requestKindBillingQuickFilterOptions' web/src/pages/TokenDetail.tsx:137 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'requestKindProtocolQuickFilterOptions' · ×1
  • Unused module-local declaration 'requestKindProtocolQuickFilterOptions' web/src/pages/TokenDetail.tsx:143 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'statusLabel' · ×1
  • Unused module-local declaration 'statusLabel' web/src/pages/TokenDetail.tsx:174 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected examples/forwardauth-caddy/Caddyfile:4 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 14/16 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Minor — 17 finding(s)
D12 · Dependency Hygiene · Outdated · ×17
  • Outdated: async-compression — `async-compression` is locked at 0.4.42 but 0.4.52 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-compression` 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"` requirement declared in 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 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.51 but 4.6.8 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: data-encoding — `data-encoding` is locked at 2.11.0 but 2.11.1 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p data-encoding` and commit the updated REDACTED.
  • Outdated: futures-util — `futures-util` 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 Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.177 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in 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.35 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` 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"` requirement declared in 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"` requirement declared in 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: 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 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.48.0 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1.37"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • Outdated: tokio-util — `tokio-util` is locked at 0.7.16 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-util` and commit the updated REDACTED.
  • Outdated: tracing-subscriber — `tracing-subscriber` is locked at 0.3.20 but 0.3.23 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tracing-subscriber` and commit the updated REDACTED.
  • Outdated: url — `url` is locked at 2.5.7 but 2.5.8 is the current stable release on crates.io, and it already satisfies the `"2.5"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p url` and commit the updated REDACTED.
  • Outdated: uuid — `uuid` is locked at 1.23.4 but 1.29.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
  • Outdated: webauthn-rs — `webauthn-rs` is locked at 0.6.1-dev but 0.6.2 is the current stable release on crates.io, and it already satisfies the `"0.6.1-dev"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webauthn-rs` and commit the updated REDACTED.

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

Run 01a1e9e3-e7ea-747d-8c48-18985594dbe7 · 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