Public report — claude-relay-service, published 1 Oct 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_258e843829e0473cb274b24482d71a1a
Filed 1 October 2026, 23:54 UTC
Public
Large · 151,289 LoC · 2 projects · rebuild ~0.9 person-years · weakest lens: Code Health (9%)
Findings by grade
178 critical1311 serious91 minor30 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
1 October 2026, 23:52 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
1524findings with an exact file:lineof 1580 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
67/132dimensions across the health lenses151289 LoC · 2 projects — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
The platform is a large, valuable asset currently operating at significant risk, with an overall health score of 26%. While the underlying architecture is sound, the system’s sheer size—representing nearly one person-year of effort to rebuild—magnifies the dangers of its current state. The business faces a critical juncture where technical debt is no longer just a maintenance issue but a direct drag on delivery speed and cost efficiency.
The primary threat is fragile change hotspots concentrated in areas with poor code health. With only 9% of the codebase meeting maintainability standards, modifications carry a high risk of regression and defects. This weakness acts as a velocity tax, plausibly increasing the cost of every change by 6–13%. For a system where tens of thousands of lines are modified annually, this inefficiency compounds, turning routine updates into expensive, slow processes that erode competitive agility.
A secondary concern is operational fragility stemming from low production readiness and accessibility. The system lacks the robust testing and observability required for safe, independent operation by new teams. This creates a single point of failure in knowledge and execution, increasing the cost of outages and making it difficult to onboard talent or scale support without significant overhead. The lack of measured domain modeling and event-driven clarity further obscures the true scope of business logic, adding uncertainty to future planning.
However, the foundation is not broken. The architecture scores well, indicating that the core structure can support change if the surface code is stabilized. The most immediate and high-leverage action is to adopt TypeScript for the frontend. This single step can pay for itself within months by reducing the annual drag on development. Focusing here first protects the largest investment while building the discipline needed to address deeper code health issues systematically.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Raise Code Health 9 → 70 (the Healthy floor) ⇒ headline 26 → ~40.
Code composition — where the lines go
Tests 100%
New since the last scan (100+)
217 finding(s) are new versus the previous scan (2026-09-16) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
0.7× (at 26% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~0.9 person-years of build effort (about ~€140,000 to rebuild). Its weakest lens is Code Health at 9% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
2 hotspot file(s) are also under-tested or single-owner — change there is riskier than the headline suggests.
Evidence: D15 hotspots: 10 churn×complexity hotspot file(s) · D8 coverage: 18 file(s) under 50% coverage · D16 ownership: 0 file(s) ≥90% owned by one author · intersection: incl. unified.js, REDACTED
→ Prioritise tests + a second reviewer on the worst files (unified.js, REDACTED).
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~0.9 person-years to rebuild), and its weakest lens is Code Health at 9%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 6.3–37.9 engineer-days every year, paid as drag on the ~42,222 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–19 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 6–13% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 10,411 line(s) changed over a 90-day window ⇒ ~42,222/year · D1/D2/D4/D6 code quality: averaging 5.6/10 ⇒ a 6–13% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 19 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.6/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 6–13% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 5.6/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
94 modules, 5 dependencies. Every dependency points down the layering — no cycles.
Showing the 40 most-connected modules; 54 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
src.services.balanceProviders.claudeBalanceProvider uses src.services.balanceProviders.baseBalanceProvider. Changing src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.claudeBalanceProvider, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→32 src.services.balanceProviders.claudeConsoleBalanceProvider depends on src.services.balanceProviders.baseBalanceProvider✕
Type pairs
1 distinct (type in src.services.balanceProviders.claudeConsoleBalanceProvider → type in src.services.balanceProviders.baseBalanceProvider) reference.
src.services.balanceProviders.claudeConsoleBalanceProvider uses src.services.balanceProviders.baseBalanceProvider. Changing src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.claudeConsoleBalanceProvider, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→32 src.services.balanceProviders.geminiBalanceProvider depends on src.services.balanceProviders.baseBalanceProvider✕
Type pairs
1 distinct (type in src.services.balanceProviders.geminiBalanceProvider → type in src.services.balanceProviders.baseBalanceProvider) reference.
src.services.balanceProviders.geminiBalanceProvider uses src.services.balanceProviders.baseBalanceProvider. Changing src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.geminiBalanceProvider, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
39→32 src.services.balanceProviders.genericBalanceProvider depends on src.services.balanceProviders.baseBalanceProvider✕
Type pairs
1 distinct (type in src.services.balanceProviders.genericBalanceProvider → type in src.services.balanceProviders.baseBalanceProvider) reference.
src.services.balanceProviders.genericBalanceProvider uses src.services.balanceProviders.baseBalanceProvider. Changing src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.genericBalanceProvider, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→32 src.services.balanceProviders.openaiResponsesBalanceProvider depends on src.services.balanceProviders.baseBalanceProvider✕
Type pairs
1 distinct (type in src.services.balanceProviders.openaiResponsesBalanceProvider → type in src.services.balanceProviders.baseBalanceProvider) reference.
src.services.balanceProviders.openaiResponsesBalanceProvider uses src.services.balanceProviders.baseBalanceProvider. Changing src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.openaiResponsesBalanceProvider, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
At a glance — Code Health · 9% · Critical · gated by D1, D2, D3, R1, R2, R3, R7 ·
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 category
Findings
Severity
A03:2021 — Injection
96
High / Critical
A06:2021 — Vulnerable & Outdated Components
55
High / Critical
A05:2021 — Security Misconfiguration
8
High / Critical
A02:2021 — Cryptographic Failures
6
High / Critical
A04:2021 — Insecure Design
2
Medium
Roadmap
Begin by introducing type safety to the frontend through a build-time check or incremental conversion of high-traffic modules to reduce runtime errors. Simultaneously, decompose overly complex functions and split large files into smaller, focused modules to improve maintainability and readability. Finally, eliminate dead code to reduce maintenance overhead and address specific instances of duplication by extracting shared logic or types where appropriate.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
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.
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
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 — 178
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 — 1311
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 — 91
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 30
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 63 of 67 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 1.0 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 67 dimensions across the health lenses
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
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, 1524 of 1580 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.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (package.json), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 309 further occurrence(s) are not listed individually; the score already reflects all 349.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 630 further occurrence(s) are not listed individually; the score already reflects all 670.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 150 further occurrence(s) are not listed individually; the score already reflects all 190.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 61 further occurrence(s) are not listed individually; the score already reflects all 101.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java and Rust source only, and no C# was loaded and no Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
607 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was handleMessagesRequest at 225. A further 4 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 (anonymous)::parseUsage at 23 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: REDACTED (manage.main at 18). 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.
+ 353 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 (anonymous) (cyclomatic 17) finding(s) in Cyclomatic Complexity — start with REDACTED, system.js, REDACTED. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 (anonymous) (cyclomatic 16) finding(s) in Cyclomatic Complexity — start with droidAccounts.js (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 (anonymous) finding(s) in Cyclomatic Complexity — start with dashboard.js (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 418 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 6 (anonymous) finding(s) in Cognitive Complexity — start with dashboard.js (6). — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 (anonymous) (cognitive 19) finding(s) in Cognitive Complexity — start with REDACTED (2), openaiAccounts.js, geminiAccounts.js. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 5 (anonymous) (cognitive 17) finding(s) in Cognitive Complexity — start with claudeAccounts.js (2), web.js, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes0.0 / 10Critical✓ 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.
Resolve the 58 FunctionTooLong finding(s) in God Classes — start with REDACTED (8), REDACTED (6), REDACTED (5). — One of this dimension's main actionable groups (58 warning-level).
Resolve the 38 FileTooLong finding(s) in God Classes — start with REDACTED, REDACTED, claudeRelayService.js. — One of this dimension's main actionable groups (38 warning-level).
Resolve the 34 MethodTooLong finding(s) in God Classes — start with apiKeyService.js (7), unifiedClaudeScheduler.js (4), REDACTED (4). — One of this dimension's main actionable groups (34 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
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.
2 production modules (npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations, and main-sequence distance (abstractness) is not computed for these modules yet.
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.
Resolve the 7 Low cohesion finding(s) in Cohesion (LCOM4) — start with apiKeyService.js, claudeAccountService.js, costRankService.js. — One of this dimension's main actionable groups (7 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D8 · Code Coverage5.3 / 10Adequate✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 23.2% — 18 file(s) below 50%. Measured from the JavaScript/TypeScript suite (jest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root).
Low coverage: REDACTED · ×18REDACTED
What to do
Resolve the 18 Low coverage finding(s) in Code Coverage — start with REDACTED, REDACTED, unified.js. — One of this dimension's main actionable groups (18 warning-level).
Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
352 test methods: 352 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 352 `it`/`test` case(s) across 33 test file(s) declaring at least one; its tier split is read from package names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
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.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 352 tests.
✓ On the Gold path — maintain.
Detailed fixes: d10_recommendation.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
31 outdated direct production npm dependency(ies) of 36 graded, 0 pinning defect(s), across 2 package.json (2 of them the product) and 3 committed lockfile(s). Development dependencies are deliberately not graded: this dimension grades what SHIPS. Whether any of these packages is DEPRECATED or UNMAINTAINED is not graded — registry.npmjs.org's latest-version answer carries neither, and release age does not stand in for a maintenance status. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
0 of 36 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 36 production dependency(ies) this repository's committed lockfile resolves, across 2 product package.json manifest(s). Its 26 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under MIT, which is its own choice and is not judged here.
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.
Resolve the 10 Hotspot finding(s) in Churn × Complexity Hotspots — start with AccountForm.vue, claudeRelayService.js, dashboard.js. — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.1 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
19 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/services/requestDetailService.js. Counted over 234 of the 267 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
This repository is well documented with a strong README covering the service's purpose, security warning, and an extensive guide for both the main relay service (with a detailed pricing data directory) and the admin SPA. The READMEs are each focused on their own directories (relay service root, claude-code-gemini3-guide docs, web/admin-spa SPA), with clear headings outlining what is present in each document.
Documentation: no architecture or design documentation · ×2README.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
1 of 2 build units (npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
4 finding(s): 0 critical, 4 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
96 finding(s): 0 critical, 63 high, 33 medium, 0 low. 15 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 11 file(s) — `REDACTED`, `scripts/data-transfer-enhanced.js`, `scripts/manage.sh` (line 372), `REDACTED`, `REDACTED`, … (+6 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
+ 11 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (20 issue-level).
Resolve the 12 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (12 issue-level).
No action in Static Analysis (SAST) — all 15 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 (15 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 34 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (25), REDACTED (9). — One of this dimension's main actionable groups (34 issue-level).
Resolve the 12 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (10), REDACTED (2). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 1 Critical CVE 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.
Resolve the 4 High IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D32 · Data Compliance (PII/GDPR)8.1 / 10Strong✓ Tool-verified
What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.
Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using Watchdog's own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.
Resolve the 2 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
30 of 234 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is web/admin-spa/src/views/QuotaCardsView.vue. Counted over 234 of the 267 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 4 Orphaned knowledge finding(s) in Knowledge Freshness — start with QuotaCardsView.vue, accountBalanceService.js, ClaudeCodeTutorial.vue. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 9 Change coupling finding(s) in Change Coupling — start with accounts.js, UsageDetailModal.vue, REDACTED. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with EditApiKeyModal.vue, apiKeyService.js. — 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.
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 27 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives1.7 / 10Critical✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×6) — web/admin-spa/src/components/dashboard/ModelDistribution.vue:26, web/admin-spa/src/components/dashboard/UsageTrend.vue:32, web/admin-spa/src/views/DashboardView.vue:595, …
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels3.6 / 10Weak✓ 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 <label> has no for 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 for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×14) — web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:16, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:20, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:26, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×9) — web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:17, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:23, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:27, …
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:37, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:43, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:69, …
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×13) — web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36, web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:27, web/admin-spa/src/components/accounts/AccountForm.vue:18, …
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.
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.
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×11) — web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:37, web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:39, web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:323, …
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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".
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×25) — web/admin-spa/src/components/accounts/AccountForm.vue:76, web/admin-spa/src/components/accounts/AccountForm.vue:107, web/admin-spa/src/components/accounts/AccountForm.vue:147, …
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
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.
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×10) — web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36, web/admin-spa/src/components/accounts/AccountForm.vue:33, web/admin-spa/src/components/accounts/AccountForm.vue:48, …
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-vuejs-accessibility) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 81 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-vuejs-accessibility, then assert with jest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Do you agree with this assessment?
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
What to do
Run the test suite in CI via an explicit runner step (`npm test` for the toolchain this pipeline already uses) and gate merges on it.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 31168 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
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.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
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.
`axios(` 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 of the 34 files that make outbound calls are unbounded; the first 3 are listed. — REDACTED:551
`axios.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — src/routes/admin/openaiAccounts.js:161
`fetch(` 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/services/balanceProviders/geminiBalanceProvider.js:216
What to do
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`initialize` is async and calls existsSync, mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:47
`loadPricingData` is async and calls existsSync, readFileSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:292
`useFallbackPricing` is async and calls existsSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:315
`reloadPricingData` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:833
`createInitialAdmin` is async and calls existsSync, readFileSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:188
`analyzeLogDirectory` is async and calls readdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:191
`analyzeSingleFile` is async and calls existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:230
`setup` is async and calls existsSync, mkdirSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/setup.js:9
`testAccountDisplay` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/test-account-display.js:12
`testPricingFallback` is async and calls existsSync, copyFileSync, unlinkSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/test-pricing-fallback.js:7
`main` is async and calls existsSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/update-model-pricing.js:216
`_makeClaudeRequest` is async and calls gunzipSync, inflateSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/relay/claudeRelayService.js:1727
`router.get("/check-updates")` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/routes/admin/system.js:93
`router.post("/auth/login")` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/routes/web.js:21
`router.post("/auth/change-password")` is async and calls existsSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/routes/web.js:137
`initialize` is async and calls existsSync, statSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/app.js:50
`initializeAdmin` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/app.js:479
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ 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.
0 typed · 321 plain JS — the untyped files are REDACTED, REDACTED, config/models.js, config/pricingSource.js, REDACTED, scripts/check-redis-keys.js (+315 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
46 duplicated blocks under src/ have copies in at least two of the sibling directories handlers, middleware, models, routes, services, utils (+1 more sibling(s) not listed) — 38 of them are reported below, and 8 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 46 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 46 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 46 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. — REDACTED:154
29 duplicated blocks under web/admin-spa/src/ have copies in at least two of the sibling directories components, stores, utils, views — 23 of them are reported below, and 6 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 29 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 29 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 29 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/admin-spa/src/components/apistats/StatsOverview.vue:478
14 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, scripts, src, web — 8 of them are reported below, and 6 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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. — src/routes/admin/dashboard.js:35
12 duplicated blocks under web/admin-spa/src/components/ have copies in at least two of the sibling directories accounts, admin, apikeys, apistats, user — 9 of them are reported below, and 3 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216
6 duplicated blocks under src/services/ have copies in at least two of the sibling directories account, balanceProviders, relay, scheduler — 2 of them are reported below, and 4 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 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 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 6 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. — src/services/account/claudeAccountService.js:2899
src/services/relay/ccrRelayService.js:59 · src/services/relay/claudeConsoleRelayService.js:69 — the two spans are one implementation copied and then locally edited — 2434 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. — src/services/relay/ccrRelayService.js:59
REDACTED:10 · REDACTED:19 — the two spans are one implementation copied and then locally edited — 2065 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. — REDACTED:10
REDACTED:17 · src/routes/admin/claudeConsoleAccounts.js:20 — the two spans are one implementation copied and then locally edited — 1955 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. — REDACTED:17
REDACTED:566 · REDACTED:530 — the two spans are one implementation copied and then locally edited — 1200 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. — REDACTED:566
REDACTED:211 · REDACTED:107 — the two spans are one implementation copied and then locally edited — 1474 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. — REDACTED:211
src/services/account/azureOpenaiAccountService.js:117 · REDACTED:457 — the two spans are one implementation copied and then locally edited — 1146 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. — src/services/account/azureOpenaiAccountService.js:117
src/routes/admin/droidAccounts.js:341 · src/routes/admin/geminiAccounts.js:291 — the two spans are one implementation copied and then locally edited — 1132 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. — src/routes/admin/droidAccounts.js:341
src/services/account/geminiApiAccountService.js:365 · src/services/account/openaiResponsesAccountService.js:326 — the two spans are one implementation copied and then locally edited — 1056 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. — src/services/account/geminiApiAccountService.js:365
src/services/scheduler/unifiedClaudeScheduler.js:1318 · src/services/scheduler/unifiedOpenAIScheduler.js:636 — the two spans are one implementation copied and then locally edited — 778 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. — src/services/scheduler/unifiedClaudeScheduler.js:1318
src/services/account/ccrAccountService.js:567 · src/services/account/claudeConsoleAccountService.js:1244 — the two spans are one implementation copied and then locally edited — 840 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. — src/services/account/ccrAccountService.js:567
REDACTED:21 · REDACTED:47 — the two spans are one implementation copied and then locally edited — 864 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. — REDACTED:21
src/services/relay/claudeConsoleRelayService.js:106 · src/services/relay/claudeConsoleRelayService.js:576 — the two spans are one implementation copied and then locally edited — 805 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. — src/services/relay/claudeConsoleRelayService.js:106
src/services/account/geminiApiAccountService.js:54 · src/services/account/openaiResponsesAccountService.js:68 — the two spans are one implementation copied and then locally edited — 806 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. — src/services/account/geminiApiAccountService.js:54
web/admin-spa/src/views/AccountUsageRecordsView.vue:309 · web/admin-spa/src/views/ApiKeyUsageRecordsView.vue:302 — the two spans are one implementation copied and then locally edited — 859 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/admin-spa/src/views/AccountUsageRecordsView.vue:309
src/utils/oauthHelper.js:167 · src/utils/oauthHelper.js:387 — 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. — src/utils/oauthHelper.js:167
src/services/account/claudeConsoleAccountService.js:543 · src/services/account/claudeConsoleAccountService.js:845 — the two spans are one implementation copied and then locally edited — 574 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. — src/services/account/claudeConsoleAccountService.js:543
REDACTED:289 · REDACTED:1001 — the two spans are one implementation copied and then locally edited — 428 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. — REDACTED:289
REDACTED:2213 · REDACTED:2508 — 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. — REDACTED:2213
src/services/scheduler/droidScheduler.js:41 · src/services/scheduler/grokScheduler.js:21 — the two spans are one implementation copied and then locally edited — 472 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. — src/services/scheduler/droidScheduler.js:41
REDACTED:1549 · REDACTED:1792 — 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. — REDACTED:1549
src/services/account/claudeAccountService.js:1235 · src/services/account/claudeConsoleAccountService.js:1104 — the two spans are one implementation copied and then locally edited — 431 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. — src/services/account/claudeAccountService.js:1235
web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195 · web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:149 — the two spans are one implementation copied and then locally edited — 321 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/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195
src/routes/admin/bedrockAccounts.js:33 · src/routes/admin/geminiAccounts.js:161 — 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. — src/routes/admin/bedrockAccounts.js:33
web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216 · web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:293 — 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/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216
scripts/data-transfer-enhanced.js:832 · scripts/data-transfer.js:446 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/data-transfer-enhanced.js:832
web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011 · web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1059 — 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/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011
REDACTED:1555 · src/routes/admin/claudeRelayConfig.js:59 — the two spans are one implementation copied and then locally edited — 339 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. — REDACTED:1555
REDACTED:1493 · REDACTED:1671 — 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. — REDACTED:1493
REDACTED:1928 · REDACTED:2118 — 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. — REDACTED:1928
REDACTED:283 · REDACTED:442 — the two spans are one implementation copied and then locally edited — 264 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. — REDACTED:283
src/services/account/bedrockAccountService.js:789 · REDACTED:1502 — 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. — src/services/account/bedrockAccountService.js:789
src/utils/anthropicResponseDump.js:15 · src/utils/antigravityUpstreamResponseDump.js:16 — the two spans are one implementation copied and then locally edited — 313 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. — src/utils/anthropicResponseDump.js:15
src/routes/azureOpenaiRoutes.js:217 · src/routes/azureOpenaiRoutes.js:348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/routes/azureOpenaiRoutes.js:217
src/services/relay/claudeConsoleRelayService.js:1399 · src/services/relay/claudeRelayService.js:3380 — 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. — src/services/relay/claudeConsoleRelayService.js:1399
src/routes/admin/claudeAccounts.js:104 · src/routes/admin/claudeAccounts.js:226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/routes/admin/claudeAccounts.js:104
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.
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/admin-spa/src/main.js:4 imports element-plus/dist/locale/zh-cn.mjs, 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/admin-spa/src/main.js: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.
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.
createAccount has cyclomatic complexity 172 and cognitive complexity 230; 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/admin-spa/src/components/accounts/AccountForm.vue:5492
handleMessagesRequest has cyclomatic complexity 157 and cognitive complexity 282; 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:137
updateAccount has cyclomatic complexity 155 and cognitive complexity 207; 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/admin-spa/src/components/accounts/AccountForm.vue:5940
createAccount has cyclomatic complexity 130 and cognitive complexity 158; 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:458
updateAccount has cyclomatic complexity 122 and cognitive complexity 170; 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:836
handleResponses has cyclomatic complexity 119 and cognitive complexity 167; 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:293
(anonymous) has cyclomatic complexity 119 and cognitive complexity 148; 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:101
handleOAuthSuccess has cyclomatic complexity 115 and cognitive complexity 143; 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/admin-spa/src/components/accounts/AccountForm.vue:5236
relayRequest has cyclomatic complexity 111 and cognitive complexity 210; 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. — src/services/relay/claudeRelayService.js:480
authenticateApiKey has cyclomatic complexity 109 and cognitive complexity 183; 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:440
(anonymous) has cyclomatic complexity 106 and cognitive complexity 139; 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:2108
_getAllAvailableAccounts has cyclomatic complexity 102 and cognitive complexity 194; 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. — src/services/scheduler/unifiedClaudeScheduler.js:515
(anonymous) has cyclomatic complexity 101 and cognitive complexity 211; 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:1247
importData has cyclomatic complexity 96 and cognitive complexity 253; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/data-transfer-enhanced.js:835
(anonymous) has cyclomatic complexity 96 and cognitive complexity 194; 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:1825
relayRequest has cyclomatic complexity 94 and cognitive complexity 149; 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. — src/services/relay/claudeConsoleRelayService.js:23
handleRequest has cyclomatic complexity 91 and cognitive complexity 186; 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:68
recordUsageWithDetails has cyclomatic complexity 85 and cognitive complexity 87; 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. — src/services/apiKeyService.js:1862
(anonymous) has cyclomatic complexity 83 and cognitive complexity 98; 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:2708
handleAnthropicMessagesToGemini has cyclomatic complexity 81 and cognitive complexity 112; 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. — src/services/anthropicGeminiBridgeService.js:1859
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files0.0 / 10Critical✓ 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.
104 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: web/admin-spa/src/components/accounts/AccountForm.vue (6637), web/admin-spa/src/views/AccountsView.vue (5419), REDACTED (4835), web/admin-spa/src/views/ApiKeysView.vue (4687), src/services/relay/claudeRelayService.js (3288), src/services/account/claudeAccountService.js (3131) (+98 more).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage3.4 / 10Weak✓ 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. (×40) — web/admin-spa/src/components/accounts/AccountForm.vue, web/admin-spa/src/views/AccountsView.vue, web/admin-spa/src/views/ApiKeysView.vue, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
32 outdated package(s); JS/npm CVEs scored in D30
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 23 application, 25 tooling and 33 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (23 application, 25 tooling, 33 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 (×34) — web/admin-spa/src/components/accounts/AccountForm.vue, web/admin-spa/src/views/AccountsView.vue, web/admin-spa/src/views/ApiKeysView.vue, …
no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×4) — web/admin-spa/src/components/accounts/OAuthFlow.vue, web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue, web/admin-spa/src/components/accounts/GroupManagementModal.vue, …
no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/layout/MainLayout.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/admin-spa/src/components/layout/AppHeader.vue
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Declared in web/admin-spa/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Do you agree with this assessment?
R9 · Circular Imports4.6 / 10Weak✓ 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.
REDACTED → src/services/accountNameCacheService.js → src/services/account/azureOpenaiAccountService.js → REDACTED (one verified cycle inside a mutually-dependent group of 22 files) — REDACTED
Break each cycle by extracting the shared piece into a module both sides can import.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
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. 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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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).
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.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 59 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — Not applicable: 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 — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
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 18 — an image could not be pulled) — time="2026-10-01T23:53:15Z" level=warning msg="The \"ENCRYPTION_KEY\" variable is not set. Defaulting to a blank string." redis Pulling claude-relay Pulling claude-relay Warning Get "https://registry-1.docker.io/v2/": Forbidden redis Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: redis Pulling claude-relay Pulling claude-relay Warning Get "https://registry-1.docker.io/v2/": Forbidden redis Error Get "https://registry-1.docker.io/v2/": Forbidden WARNING: Some service image(s) must be built from source by running: docker compose build claude-relay Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
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.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
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. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 30 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 tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, 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 applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X28 Index access outside its own emptiness guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×17
Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:76— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:107— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:147— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:178— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:209— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/apistats/StatsOverview.vue:63— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:4— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:70— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:88— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:103— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:138— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:175— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:214— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:253— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/CustomDropdown.vue:4— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/CustomDropdown.vue:41— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> web/admin-spa/src/components/common/ToastNotification.vue:4— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC2 · Forms & labels· <label> that labels no control · ×14
<label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:16— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:20— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:26— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:30— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:36— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:40— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:79— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:113— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountForm.vue:68— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountForm.vue:649— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountForm.vue:718— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/AccountForm.vue:735— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/CcrAccountForm.vue:29— This <label> has no for 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 for="<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/admin-spa/src/components/accounts/CcrAccountForm.vue:44— This <label> has no for 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 for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <button> with no accessible text · ×13
<button> with no accessible text web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:27— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/AccountForm.vue:18— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:28— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue:54— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:279— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:348— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:355— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:365— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:372— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/CcrAccountForm.vue:18— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/GroupManagementModal.vue:18— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/admin-spa/src/components/accounts/GroupManagementModal.vue:163— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels· <input> without a programmatic label · ×10
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:17— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:23— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:27— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:33— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:37— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:43— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:116— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label web/admin-spa/src/components/accounts/AccountForm.vue:721— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:118— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label web/admin-spa/src/components/accounts/CcrAccountForm.vue:32— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
Orphaned knowledge web/admin-spa/src/views/QuotaCardsView.vue— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/services/account/accountBalanceService.js— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/services/codexToOpenAI.js— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
AC2 · Forms & labels· <textarea> without a programmatic label · ×3
<textarea> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:69— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<textarea> without a programmatic label web/admin-spa/src/components/accounts/AccountForm.vue:738— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label web/admin-spa/src/components/accounts/CcrAccountForm.vue:47— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics· Click handler on a non-interactive <th> · ×3
Click handler on a non-interactive <th> web/admin-spa/src/components/settings/ModelPricingSection.vue:77— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <th> web/admin-spa/src/components/settings/ModelPricingSection.vue:87— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <th> web/admin-spa/src/components/settings/ModelPricingSection.vue:97— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <code> · ×2
Click handler on a non-interactive <code> web/admin-spa/src/views/QuotaCardsView.vue:256— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <code> web/admin-spa/src/views/QuotaCardsView.vue:432— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×2
Click handler on a non-interactive <span> web/admin-spa/src/views/QuotaCardsView.vue:441— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> web/admin-spa/src/views/QuotaCardsView.vue:450— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <h4> · ×1
Click handler on a non-interactive <h4> web/admin-spa/src/components/apistats/ModelUsageStats.vue:30— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
FunctionTooLong: api.handleMessagesRequest REDACTED:137— FunctionTooLong — handleMessagesRequest runs 856 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 756 over it, 8.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: anthropicGeminiBridgeService.handleAnthropicMessagesToGemini src/services/anthropicGeminiBridgeService.js:1859— FunctionTooLong — handleAnthropicMessagesToGemini runs 791 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 691 over it, 7.91× 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: auth.authenticateApiKey REDACTED:440— FunctionTooLong — authenticateApiKey runs 557 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 457 over it, 5.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: dashboard.useDashboardStore web/admin-spa/src/stores/dashboard.js:7— FunctionTooLong — useDashboardStore runs 532 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 432 over it, 5.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openaiRoutes.handleResponses REDACTED:293— FunctionTooLong — handleResponses runs 433 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 333 over it, 4.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: apistats.useApiStatsStore web/admin-spa/src/stores/apistats.js:6— FunctionTooLong — useApiStatsStore runs 398 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 298 over it, 3.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: usageStats.router.get("/account-usage-trend") REDACTED:1247— FunctionTooLong — router.get("/account-usage-trend") runs 397 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 297 over it, 3.97× 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: openaiGeminiRoutes.router.post("/v1/chat/completions") REDACTED:192— FunctionTooLong — router.post("/v1/chat/completions") runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: geminiHandlers.handleStandardStreamGenerateContent REDACTED:2506— FunctionTooLong — handleStandardStreamGenerateContent runs 326 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 226 over it, 3.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: apiStats.router.post("/api/user-stats") REDACTED:101— FunctionTooLong — router.post("/api/user-stats") runs 319 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: usageStats.router.get("/api-keys-usage-trend") REDACTED:1825— FunctionTooLong — router.get("/api-keys-usage-trend") runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.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: usageStats.router.get("/usage-costs") REDACTED:2286— FunctionTooLong — router.get("/usage-costs") runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: accounts.useAccountsStore web/admin-spa/src/stores/accounts.js:22— FunctionTooLong — useAccountsStore runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: geminiHandlers.handleMessages REDACTED:395— FunctionTooLong — handleMessages runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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: usageStats.router.get("/usage-trend") REDACTED:539— FunctionTooLong — router.get("/usage-trend") runs 268 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
FunctionTooLong: sync.router.get("/sync/export-accounts") src/routes/admin/sync.js:93— FunctionTooLong — router.get("/sync/export-accounts") runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: data-transfer-enhanced.importData scripts/data-transfer-enhanced.js:835— FunctionTooLong — importData runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: usageStats.router.get("/api-keys/:keyId/usage-records") REDACTED:2708— FunctionTooLong — router.get("/api-keys/:keyId/usage-records") runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openaiRoutes.handleImages REDACTED:971— FunctionTooLong — handleImages runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: geminiHandlers.handleStreamGenerateContent REDACTED:1806— FunctionTooLong — handleStreamGenerateContent runs 254 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openaiClaudeRoutes.handleChatCompletion REDACTED:186— FunctionTooLong — handleChatCompletion runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× 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: usageStats.router.get("/accounts/:accountId/usage-records") REDACTED:3066— FunctionTooLong — router.get("/accounts/:accountId/usage-records") runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: apiKeys.router.put("/api-keys/:keyId") REDACTED:2108— FunctionTooLong — router.put("/api-keys/:keyId") runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: usageStats.router.get("/api-keys/:keyId/model-stats") REDACTED:933— FunctionTooLong — router.get("/api-keys/:keyId/model-stats") runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: usageStats.router.get("/accounts/:accountId/usage-history") REDACTED:247— FunctionTooLong — router.get("/accounts/:accountId/usage-history") runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
+ 33 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file web/admin-spa/src/components/accounts/AccountForm.vue— 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/admin-spa/src/views/AccountsView.vue— 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/admin-spa/src/views/ApiKeysView.vue— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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/admin-spa/src/views/SettingsView.vue— 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 src/services/anthropicGeminiBridgeService.js— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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/admin-spa/src/components/apikeys/EditApiKeyModal.vue— 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/admin-spa/src/views/DashboardView.vue— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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/admin-spa/src/components/apikeys/CreateApiKeyModal.vue— 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 src/services/relay/droidRelayService.js— 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 scripts/data-transfer-enhanced.js— 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/admin-spa/src/components/accounts/OAuthFlow.vue— 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 src/routes/admin/claudeAccounts.js— 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/admin-spa/src/views/QuotaCardsView.vue— 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/admin-spa/src/views/RequestDetailsView.vue— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue— 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 src/services/relay/ccrRelayService.js— 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 src/app.js— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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 src/utils/oauthHelper.js— 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/admin-spa/src/components/accounts/ApiKeyManagementModal.vue— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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.
FileTooLong: REDACTED REDACTED— FileTooLong — 3424 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 74% of them inside a single declaration: QUEUE_STATS_TTL_SECONDS (130-4049). The bar is 500 significant lines; this is 2924 over it, 6.85× 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 — 2334 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 834 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: relay/claudeRelayService.js src/services/relay/claudeRelayService.js— FileTooLong — 2277 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 99% of them inside a single declaration: ClaudeRelayService (33-3666). The bar is 1500 significant lines; this is 777 over it, 1.52× 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: account/claudeAccountService.js src/services/account/claudeAccountService.js— FileTooLong — 2216 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 99% of them inside a single declaration: ClaudeAccountService (42-3583). The bar is 1500 significant lines; this is 716 over it, 1.48× 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: services/apiKeyService.js src/services/apiKeyService.js— FileTooLong — 1927 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 94% of them inside a single declaration: ApiKeyService (170-2866). The bar is 500 significant lines; this is 1427 over it, 3.85× 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 — 1901 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1401 over it, 3.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/anthropicGeminiBridgeService.js src/services/anthropicGeminiBridgeService.js— FileTooLong — 1817 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1317 over it, 3.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: REDACTED REDACTED— FileTooLong — 1762 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1262 over it, 3.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: REDACTED REDACTED— FileTooLong — 1226 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: handleMessagesRequest (137-1468). The bar is 500 significant lines; this is 726 over it, 2.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 — 1206 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 706 over it, 2.41× 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 — 1181 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 681 over it, 2.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: services/requestDetailService.js src/services/requestDetailService.js— FileTooLong — 1125 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 62% of them inside a single declaration: RequestDetailService (634-1624). The bar is 500 significant lines; this is 625 over it, 2.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: scheduler/unifiedClaudeScheduler.js src/services/scheduler/unifiedClaudeScheduler.js— FileTooLong — 1114 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: UnifiedClaudeScheduler (43-1922). The bar is 500 significant lines; this is 614 over it, 2.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1071 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 571 over it, 2.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1004 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DroidAccountService (17-1560). The bar is 500 significant lines; this is 504 over it, 2.01× 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: account/claudeConsoleAccountService.js src/services/account/claudeConsoleAccountService.js— FileTooLong — 983 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ClaudeConsoleAccountService (10-1630). The bar is 500 significant lines; this is 483 over it, 1.97× 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: relay/claudeConsoleRelayService.js src/services/relay/claudeConsoleRelayService.js— FileTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ClaudeConsoleRelayService (17-1532). The bar is 500 significant lines; this is 458 over it, 1.92× 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: relay/droidRelayService.js src/services/relay/droidRelayService.js— FileTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DroidRelayService (21-1571). The bar is 500 significant lines; this is 454 over it, 1.91× 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 — 939 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 439 over it, 1.88× 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 — 792 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 292 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/data-transfer-enhanced.js scripts/data-transfer-enhanced.js— FileTooLong — 792 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 292 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: admin/claudeAccounts.js src/routes/admin/claudeAccounts.js— FileTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 252 over it, 1.50× 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 — 632 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 132 over it, 1.26× 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: scheduler/unifiedOpenAIScheduler.js src/services/scheduler/unifiedOpenAIScheduler.js— FileTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: UnifiedOpenAIScheduler (9-1013). The bar is 500 significant lines; this is 120 over it, 1.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: relay/ccrRelayService.js src/services/relay/ccrRelayService.js— FileTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CcrRelayService (10-967). The bar is 500 significant lines; this is 113 over it, 1.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
MethodTooLong: UnifiedClaudeScheduler._getAllAvailableAccounts src/services/scheduler/unifiedClaudeScheduler.js:515— MethodTooLong — _getAllAvailableAccounts runs 310 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 210 over it, 3.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Application.initialize src/app.js:50— MethodTooLong — initialize runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIResponsesRelayService.handleRequest REDACTED:68— MethodTooLong — handleRequest runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DroidAccountService.createAccount REDACTED:458— MethodTooLong — createAccount runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) 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: DroidAccountService.updateAccount REDACTED:836— MethodTooLong — updateAccount runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RedisClient.incrementTokenUsage REDACTED:1068— MethodTooLong — incrementTokenUsage runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.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.
MethodTooLong: ApiKeyService.recordUsageWithDetails src/services/apiKeyService.js:1862— MethodTooLong — recordUsageWithDetails runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UnifiedClaudeScheduler.selectAccountForApiKey src/services/scheduler/unifiedClaudeScheduler.js:180— MethodTooLong — selectAccountForApiKey runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DroidRelayService._handleStreamRequest src/services/relay/droidRelayService.js:415— MethodTooLong — _handleStreamRequest runs 191 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× 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: WeeklyClaudeCostInitService.backfillCurrentWeekClaudeCosts src/services/weeklyClaudeCostInitService.js:69— MethodTooLong — backfillCurrentWeekClaudeCosts runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.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: UnifiedGeminiScheduler._getAllAvailableAccounts src/services/scheduler/unifiedGeminiScheduler.js:224— MethodTooLong — _getAllAvailableAccounts runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ApiKeyService.generateApiKey src/services/apiKeyService.js:176— MethodTooLong — generateApiKey runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ApiKeyService.getAllApiKeysFast src/services/apiKeyService.js:1052— MethodTooLong — getAllApiKeysFast runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UnifiedOpenAIScheduler.selectAccountForApiKey src/services/scheduler/unifiedOpenAIScheduler.js:122— MethodTooLong — selectAccountForApiKey runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RedisClient.incrementAccountUsage REDACTED:1381— MethodTooLong — incrementAccountUsage runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.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: ClaudeAccountService.createAccount src/services/account/claudeAccountService.js:81— MethodTooLong — createAccount runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.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: PricingService.calculateCost src/services/pricingService.js:513— MethodTooLong — calculateCost runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.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: BedrockRelayService.handleStreamRequest src/services/relay/bedrockRelayService.js:243— MethodTooLong — handleStreamRequest runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIResponsesRelayService._handleStreamResponse REDACTED:476— MethodTooLong — _handleStreamResponse runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GrokRelayService.handleRequest REDACTED:43— MethodTooLong — handleRequest runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ApiKeyService.getAllApiKeys src/services/apiKeyService.js:867— MethodTooLong — getAllApiKeys runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.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.
MethodTooLong: RedisClient.migrateUsageIndex REDACTED:202— MethodTooLong — migrateUsageIndex runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: ClaudeAccountService.updateAccount src/services/account/claudeAccountService.js:740— MethodTooLong — updateAccount runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ApiKeyService.validateApiKey src/services/apiKeyService.js:360— MethodTooLong — validateApiKey runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ClaudeAccountService.refreshAccountToken src/services/account/claudeAccountService.js:263— MethodTooLong — refreshAccountToken runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
ClassTooLong: ClaudeRelayService src/services/relay/claudeRelayService.js:33— ClassTooLong — 2247 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 1847 over it, 5.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ClaudeAccountService src/services/account/claudeAccountService.js:42— ClassTooLong — 2186 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 1786 over it, 5.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: ApiKeyService src/services/apiKeyService.js:170— ClassTooLong — 1817 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 1417 over it, 4.54× 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: UnifiedClaudeScheduler src/services/scheduler/unifiedClaudeScheduler.js:43— ClassTooLong — 1094 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 694 over it, 2.74× 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: DroidAccountService REDACTED:17— ClassTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 594 over it, 2.49× 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: ClaudeConsoleAccountService src/services/account/claudeConsoleAccountService.js:10— ClassTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 574 over it, 2.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ClaudeConsoleRelayService src/services/relay/claudeConsoleRelayService.js:17— ClassTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 542 over it, 2.36× 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: DroidRelayService src/services/relay/droidRelayService.js:21— ClassTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 539 over it, 2.35× 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: RequestDetailService src/services/requestDetailService.js:634— ClassTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 295 over it, 1.74× 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: UnifiedOpenAIScheduler src/services/scheduler/unifiedOpenAIScheduler.js:9— ClassTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 212 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: CcrRelayService src/services/relay/ccrRelayService.js:10— ClassTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 204 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: CcrAccountService src/services/account/ccrAccountService.js:8— ClassTooLong — 574 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 174 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AccountBalanceService src/services/account/accountBalanceService.js:7— ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 147 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PricingService src/services/pricingService.js:8— ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 138 over it, 1.35× 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: Application src/app.js:44— ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 138 over it, 1.35× 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: OpenAIResponsesRelayService REDACTED:47— ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 132 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UnifiedGeminiScheduler src/services/scheduler/unifiedGeminiScheduler.js:22— ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 112 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BedrockAccountService src/services/account/bedrockAccountService.js:10— ClassTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 109 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GrokAccountService src/services/account/grokAccountService.js:16— ClassTooLong — 479 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 79 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BedrockRelayService src/services/relay/bedrockRelayService.js:12— ClassTooLong — 479 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 79 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WebhookService src/services/webhookService.js:11— ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 74 over it, 1.19× 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: LdapService src/services/ldapService.js:6— ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 23 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: QuotaCardService src/services/quotaCardService.js:10— ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 21 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CodexToOpenAIConverter src/services/codexToOpenAI.js:6— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 18 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.
Sync-over-async blocking src/services/pricingService.js:47— `initialize` is async and calls existsSync, mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:292— `loadPricingData` is async and calls existsSync, readFileSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:315— `useFallbackPricing` is async and calls existsSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:833— `reloadPricingData` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:188— `createInitialAdmin` is async and calls existsSync, readFileSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:191— `analyzeLogDirectory` is async and calls readdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:230— `analyzeSingleFile` is async and calls existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/setup.js:9— `setup` is async and calls existsSync, mkdirSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/test-account-display.js:12— `testAccountDisplay` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/test-pricing-fallback.js:7— `testPricingFallback` is async and calls existsSync, copyFileSync, unlinkSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/update-model-pricing.js:216— `main` is async and calls existsSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/relay/claudeRelayService.js:1727— `_makeClaudeRequest` is async and calls gunzipSync, inflateSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/routes/admin/system.js:93— `router.get("/check-updates")` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/routes/web.js:21— `router.post("/auth/login")` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/routes/web.js:137— `router.post("/auth/change-password")` is async and calls existsSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/app.js:50— `initialize` is async and calls existsSync, statSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/app.js:479— `initializeAdmin` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
D30 · Dependency Vulnerabilities· Medium CVE · ×12
Hotspot: web/admin-spa/src/components/accounts/AccountForm.vue web/admin-spa/src/components/accounts/AccountForm.vue:5492— web/admin-spa/src/components/accounts/AccountForm.vue changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 172 in createAccount at line 5492. 4 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- web/admin-spa/src/components/accounts/AccountForm.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/services/relay/claudeRelayService.js src/services/relay/claudeRelayService.js:2154— src/services/relay/claudeRelayService.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture at line 2154. 4 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- src/services/relay/claudeRelayService.js`: 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/admin-spa/src/stores/dashboard.js web/admin-spa/src/stores/dashboard.js:7— web/admin-spa/src/stores/dashboard.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 147 in dashboard.useDashboardStore at line 7. 2 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- web/admin-spa/src/stores/dashboard.js`: 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/routes/unified.js src/routes/unified.js:115— src/routes/unified.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in unified.routeToBackend at line 115. 4 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- src/routes/unified.js`: 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:971— REDACTED changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in openaiRoutes.handleImages at line 971. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00: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/services/scheduler/unifiedClaudeScheduler.js src/services/scheduler/unifiedClaudeScheduler.js:515— src/services/scheduler/unifiedClaudeScheduler.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in UnifiedClaudeScheduler._getAllAvailableAccounts at line 515. 2 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- src/services/scheduler/unifiedClaudeScheduler.js`: 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:43— REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in GrokRelayService.handleRequest at line 43. 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00: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/services/account/claudeAccountService.js src/services/account/claudeAccountService.js:546— src/services/account/claudeAccountService.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in ClaudeAccountService.getAllAccounts at line 546. 4 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- src/services/account/claudeAccountService.js`: 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/utils/grokHelper.js src/utils/grokHelper.js:211— src/utils/grokHelper.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in grokHelper.isBlockedHost at line 211. 4 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-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- src/utils/grokHelper.js`: 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/admin-spa/src/components/accounts/OAuthFlow.vue web/admin-spa/src/components/accounts/OAuthFlow.vue:1113— web/admin-spa/src/components/accounts/OAuthFlow.vue changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in exchangeCode at line 1113. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-12..2026-09-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-12 06:15:21 +00:00' --until='2026-09-10 06:15:21 +00:00' --full-history --no-merges -- web/admin-spa/src/components/accounts/OAuthFlow.vue`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Change coupling: accounts.js ↔ AccountsView.vue web/admin-spa/src/stores/accounts.js— `web/admin-spa/src/stores/accounts.js` and `web/admin-spa/src/views/AccountsView.vue` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `bae39d54` feat: 支持Gemini-Api接入; `2fc84a6a` feat: 新增Droid cli支持; `08946c67` feat: 新增 OpenAI-Responses 账户管理功能和独立自动停止标记机制 — run `git show` on any of them.
Change coupling: UsageDetailModal.vue ↔ ApiKeysView.vue web/admin-spa/src/components/apikeys/UsageDetailModal.vue— `web/admin-spa/src/components/apikeys/UsageDetailModal.vue` and `web/admin-spa/src/views/ApiKeysView.vue` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c0c944f9` mod: 补充API KEY详情页进度条; `9fe2918a` feat: keep API key stats modal and add timeline entry point; `92ec3ffc` feat: API Keys页面恢复今日时间选项并设为默认 — run `git show` on any of them.
Change coupling: REDACTED ↔ AccountForm.vue REDACTED— `REDACTED` and `web/admin-spa/src/components/accounts/AccountForm.vue` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `201d95c8` [fix] Droid: dynamic x-api-provider and custom User-Agent support (at that commit the file was still `src/services/droidAccountService.js`); `1f9afc78` feat: 添加Droid账户API Key管理功能 (at that commit the file was still `src/services/droidAccountService.js`); `0b261084` feat: droid apikey异常自动移除 (at that commit the file was still `src/services/droidAccountService.js`) — run `git show` on any of them.
Change coupling: REDACTED ↔ LimitConfig.vue REDACTED— `REDACTED` and `web/admin-spa/src/components/apistats/LimitConfig.vue` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `955b2af0` feat: add per-API-key weekly cost reset day/hour configuration; `baafebbf` fix: correct API key cost calculation and UI display issues; `f9c397cc` feat: api-stats页面增加周限总限查询 — run `git show` on any of them.
Change coupling: CreateApiKeyModal.vue ↔ ApiKeysView.vue web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue— `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue` and `web/admin-spa/src/views/ApiKeysView.vue` change together 59% of the time (20 of the 34 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 20 shared commits counted here, the most recent 3 are `53553c7e` fix: 修复gemini api类型账户绑定显示问题; `dea69641` fix: 修复apikeys页面部分bug; `42db2718` feat: droid平台账户数据统计及调度能力 — run `git show` on any of them.
Change coupling: BatchEditApiKeyModal.vue ↔ CreateApiKeyModal.vue web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue— `web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue` and `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue` change together 56% of the time (9 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `48c14f4e` fix: 移除1m模型限制和配套的apikey功能; `5d345691` feat: 支持按 API Key 控制 1M 上下文窗口访问; `955b2af0` feat: add per-API-key weekly cost reset day/hour configuration — run `git show` on any of them.
Change coupling: AccountUsageDetailModal.vue ↔ AccountsView.vue web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue— `web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue` and `web/admin-spa/src/views/AccountsView.vue` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c7701b80` feat(grok): show SuperGrok Heavy quota and fix OAuth account test; `37a95023` feat(grok): show rolling 5h/1d/7d/30d usage for custom-relay accounts; `9b0d0bee` fix: 账户时间线入口与路由修复 - 移除账户列表下拉/卡片的时间线入口,仅保留详情弹窗顶部按钮 - ActionDropdow… — run `git show` on any of them.
Change coupling: geminiRoutes.js ↔ standardGeminiRoutes.js src/routes/geminiRoutes.js— `src/routes/geminiRoutes.js` and `src/routes/standardGeminiRoutes.js` 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `a4dcfb84` refactor: 重构gemini转部分; `bae39d54` feat: 支持Gemini-Api接入; `9eccc7da` 实现SSE心跳机制和非阻塞响应结束 — run `git show` on any of them.
Change coupling: AccountForm.vue ↔ AccountSelector.vue web/admin-spa/src/components/accounts/AccountForm.vue— `web/admin-spa/src/components/accounts/AccountForm.vue` and `web/admin-spa/src/components/common/AccountSelector.vue` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `bae39d54` feat: 支持Gemini-Api接入; `42db2718` feat: droid平台账户数据统计及调度能力; `08946c67` feat: 新增 OpenAI-Responses 账户管理功能和独立自动停止标记机制 — run `git show` on any of them.
(anonymous) (cyclomatic 17) REDACTED:52— (anonymous) has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 17) src/routes/admin/system.js:93— (anonymous) 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.
(anonymous) (cyclomatic 17) REDACTED:459— (anonymous) 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.
(anonymous) (cyclomatic 17) src/routes/admin/geminiAccounts.js:301— (anonymous) 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.
(anonymous) (cyclomatic 17) src/routes/admin/claudeAccounts.js:536— (anonymous) has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 543, 592). 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.
(anonymous) (cyclomatic 17) REDACTED:1736— (anonymous) has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 17) web/admin-spa/src/router/index.js:188— (anonymous) 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.
Low cohesion: ApiKeyService (LCOM4 14) src/services/apiKeyService.js:170— ApiKeyService's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ClaudeAccountService (LCOM4 13) src/services/account/claudeAccountService.js:42— ClaudeAccountService's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CostRankService (LCOM4 7) src/services/costRankService.js:66— CostRankService's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ClaudeConsoleAccountService (LCOM4 6) src/services/account/claudeConsoleAccountService.js:10— ClaudeConsoleAccountService's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CcrAccountService (LCOM4 4) src/services/account/ccrAccountService.js:8— CcrAccountService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: UserMessageQueueService (LCOM4 4) src/services/userMessageQueueService.js:26— UserMessageQueueService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ClaudeConsoleRelayService (LCOM4 4) src/services/relay/claudeConsoleRelayService.js:17— ClaudeConsoleRelayService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AC1 · Text alternatives· <canvas> without a text alternative · ×6
<canvas> without a text alternative web/admin-spa/src/components/dashboard/ModelDistribution.vue:26— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative web/admin-spa/src/components/dashboard/UsageTrend.vue:32— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:595— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:685— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:732— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:784— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
(anonymous) (cyclomatic 16) REDACTED:848— (anonymous) has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cyclomatic 16) REDACTED:192— (anonymous) 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.
(anonymous) (cyclomatic 16) src/routes/admin/droidAccounts.js:293— (anonymous) has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
(anonymous) (cyclomatic 16) src/routes/admin/droidAccounts.js:479— (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 552, 517, 516). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
(anonymous) (cyclomatic 16) src/routes/admin/bedrockAccounts.js:118— (anonymous) has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cyclomatic 16) REDACTED:1383— (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1411). 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.
(anonymous)::getEffectiveGranularity::loadDashboardData (cognitive 44) web/admin-spa/src/stores/dashboard.js:235— (anonymous)::getEffectiveGranularity::loadDashboardData has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 38, if/else 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous)::countAccountStats (cognitive 21) src/routes/admin/dashboard.js:84— (anonymous)::countAccountStats has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (6 pts), if/else 4 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::getEffectiveGranularity::loadAccountUsageTrend (cognitive 21) web/admin-spa/src/stores/dashboard.js:458— (anonymous)::getEffectiveGranularity::loadAccountUsageTrend has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 3 (6 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::getEffectiveGranularity::loadApiKeysTrend (cognitive 19) web/admin-spa/src/stores/dashboard.js:409— (anonymous)::getEffectiveGranularity::loadApiKeysTrend has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), boolean chains 5, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::setTrendGranularity (cognitive 17) web/admin-spa/src/stores/dashboard.js:614— (anonymous)::setTrendGranularity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::refreshChartsData (cognitive 16) web/admin-spa/src/stores/dashboard.js:668— (anonymous)::refreshChartsData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyMethods: RedisClient REDACTED:141— TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClaudeAccountService src/services/account/claudeAccountService.js:42— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClaudeRelayService src/services/relay/claudeRelayService.js:33— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ApiKeyService src/services/apiKeyService.js:170— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClaudeConsoleAccountService src/services/account/claudeConsoleAccountService.js:10— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WebhookService src/services/webhookService.js:11— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:28— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue:54— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/apistats/StatsOverview.vue:285— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/common/UnifiedTestModal.vue:44— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
(anonymous)::getEffectiveGranularity::loadDashboardData (cyclomatic 47) web/admin-spa/src/stores/dashboard.js:235— (anonymous)::getEffectiveGranularity::loadDashboardData has cyclomatic complexity 47 (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.
(anonymous)::parseUsage (cyclomatic 26) REDACTED:90— (anonymous)::parseUsage 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.
(anonymous)::parseUsage (cyclomatic 26) REDACTED:79— (anonymous)::parseUsage 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.
(anonymous)::countAccountStats (cyclomatic 18) src/routes/admin/dashboard.js:84— (anonymous)::countAccountStats 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.
(anonymous)::getEffectiveGranularity::loadAccountUsageTrend (cyclomatic 16) web/admin-spa/src/stores/dashboard.js:458— (anonymous)::getEffectiveGranularity::loadAccountUsageTrend 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.
(anonymous) (cyclomatic 21) src/routes/admin/openaiAccounts.js:110— (anonymous) has cyclomatic complexity 21 (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.
(anonymous) (cyclomatic 21) REDACTED:219— (anonymous) 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.
(anonymous) (cyclomatic 21) src/routes/admin/claudeAccounts.js:717— (anonymous) 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.
(anonymous) (cyclomatic 21) REDACTED:112— (anonymous) has cyclomatic complexity 21 (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.
(anonymous) (cyclomatic 21) REDACTED:860— (anonymous) 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.
(anonymous) (cognitive 19) src/routes/admin/openaiAccounts.js:230— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (3 pts), error handling 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 3 belong to 3 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.
(anonymous) (cognitive 19) src/routes/admin/geminiAccounts.js:155— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 16 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.
(anonymous) (cognitive 19) REDACTED:112— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, error handling 1, ternaries 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.
(anonymous) (cognitive 19) REDACTED:15— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 16 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.
(anonymous) (cognitive 19) REDACTED:106— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(anonymous) (cognitive 17) src/routes/web.js:137— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 2, 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.
(anonymous) (cognitive 17) REDACTED:52— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 6, boolean chains 5 (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.
(anonymous) (cognitive 17) src/routes/admin/claudeAccounts.js:209— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4, boolean chains 3, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 17) src/routes/admin/claudeAccounts.js:536— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 543, 592). 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.
(anonymous) (cognitive 17) REDACTED:959— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 4). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AC3 · Page structure· Heading level jumps from h4 to h6 · ×4
Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:323— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/CodexTutorial.vue:26— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/DroidCliTutorial.vue:36— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/GeminiCliTutorial.vue:144— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×4
Heading level jumps from h1 to h3 web/admin-spa/src/components/user/UserApiKeysManager.vue:202— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 web/admin-spa/src/components/user/UserUsageStats.vue:173— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 web/admin-spa/src/views/UserDashboardView.vue:269— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 web/admin-spa/src/views/UserManagementView.vue:227— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
(anonymous) (cyclomatic 34) src/routes/azureOpenaiRoutes.js:161— (anonymous) has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 3 function items 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.
(anonymous) (cyclomatic 34) src/routes/azureOpenaiRoutes.js:292— (anonymous) has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 3 function items 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.
(anonymous) (cyclomatic 34) src/routes/admin/openaiAccounts.js:320— (anonymous) 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.
(anonymous) (cyclomatic 34) REDACTED:177— (anonymous) has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 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.
(anonymous) (cyclomatic 19) src/routes/admin/droidAccounts.js:68— (anonymous) 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. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
(anonymous) (cyclomatic 19) src/routes/admin/droidAccounts.js:144— (anonymous) 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. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
(anonymous) (cyclomatic 19) src/routes/admin/claudeAccounts.js:393— (anonymous) has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 2 function literals inside it that branch. 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.
(anonymous) (cyclomatic 19) src/routes/admin/accountGroups.js:90— (anonymous) 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.
(anonymous) (cognitive 28) src/routes/azureOpenaiRoutes.js:423— (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 28) REDACTED:791— (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, ternaries 2 (3 pts), loops 2, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 820, 924). 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.
(anonymous) (cognitive 28) src/routes/admin/claudeConsoleAccounts.js:118— (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 17, if/else 7 (8 pts), ternaries 2, error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cognitive 28) src/routes/admin/claudeAccounts.js:393— (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (5 pts), error handling 3 (4 pts) (nesting depth added 10). Of this number, 16 points are the body's own statements and 12 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.
(anonymous) (cognitive 27) REDACTED:459— (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 pts), boolean chains 4, error handling 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.
(anonymous) (cognitive 27) src/routes/admin/droidAccounts.js:68— (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (8 pts), boolean chains 6, error handling 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.
(anonymous) (cognitive 27) REDACTED:182— (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, loops 1 (3 pts), error handling 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.
(anonymous) (cognitive 27) web/admin-spa/src/router/index.js:188— (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 21) src/routes/admin/claudeConsoleAccounts.js:20— (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 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.
(anonymous) (cognitive 21) REDACTED:17— (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 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.
(anonymous) (cognitive 21) REDACTED:2460— (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 21) web/admin-spa/src/stores/auth.js:7— (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts), error handling 3 (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function items inside it that branch (loadOemSettings, login, verifyToken, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cognitive 16) src/routes/admin/droidAccounts.js:293— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 2). Of this number, 15 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.
(anonymous) (cognitive 16) src/routes/admin/droidAccounts.js:479— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), error handling 4 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 517, 552, 516). 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.
(anonymous) (cognitive 16) src/routes/admin/claudeAccounts.js:92— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 3, if/else 3, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 16) REDACTED:1383— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, error handling 2. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1411). 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.
(anonymous) (cyclomatic 18) src/routes/web.js:137— (anonymous) 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.
(anonymous) (cyclomatic 18) REDACTED:182— (anonymous) 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.
(anonymous) (cyclomatic 18) REDACTED:106— (anonymous) 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.
(anonymous) (cognitive 36) src/routes/azureOpenaiRoutes.js:161— (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). Of this number, 33 points are the body's own statements and 3 belong to 3 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.
(anonymous) (cognitive 36) src/routes/azureOpenaiRoutes.js:292— (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). Of this number, 33 points are the body's own statements and 3 belong to 3 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.
(anonymous) (cognitive 36) REDACTED:13— (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 16, ternaries 5 (9 pts), if/else 5 (7 pts), loops 3, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 20 belong to 5 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.
handleAnthropicMessagesToGemini::finalize (cognitive 29) src/services/anthropicGeminiBridgeService.js:2573— handleAnthropicMessagesToGemini::finalize has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 pts), boolean chains 6, error handling 2 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleAnthropicMessagesToGemini::resolveFunctionCallArgs (cognitive 21) src/services/anthropicGeminiBridgeService.js:2486— handleAnthropicMessagesToGemini::resolveFunctionCallArgs has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 7, if/else 4, error handling 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.
handleAnthropicMessagesToGemini::flushPendingToolCallById (cognitive 16) src/services/anthropicGeminiBridgeService.js:2532— handleAnthropicMessagesToGemini::flushPendingToolCallById has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(anonymous) (cognitive 26) REDACTED:219— (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, error handling 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.
(anonymous) (cognitive 26) src/routes/admin/dashboard.js:23— (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 16, ternaries 4 (7 pts), loops 3 (4 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.
(anonymous) (cognitive 26) src/routes/admin/claudeAccounts.js:717— (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, error handling 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.
(anonymous) (cognitive 24) REDACTED:590— (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), error handling 2, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 713, 658, 697, …). 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.
(anonymous) (cognitive 24) REDACTED:273— (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), boolean chains 2, 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.
(anonymous) (cognitive 24) src/routes/admin/accountGroups.js:90— (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Outbound HTTP without resilience REDACTED:551— `axios(` 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 of the 34 files that make outbound calls are unbounded; the first 3 are listed.
Outbound HTTP without resilience src/routes/admin/openaiAccounts.js:161— `axios.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src/services/balanceProviders/geminiBalanceProvider.js:216— `fetch(` 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.
AC3 · Page structure· Heading level jumps from h3 to h5 · ×2
Heading level jumps from h3 to h5 web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:37— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h3 to h5 web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:39— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Low contrast Tailwind colour pair (3.9:1) web/admin-spa/src/components/accounts/AccountForm.vue:33— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (3.9:1) web/admin-spa/src/components/accounts/AccountForm.vue:48— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.1:1) web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:184— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast Tailwind colour pair (2.1:1) web/admin-spa/src/components/settings/ModelPricingSection.vue:22— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
usageStats.router.get("/api-keys/:keyId/usage-records") (cyclomatic 118) REDACTED:2708— usageStats.router.get("/api-keys/:keyId/usage-records") has cyclomatic complexity 118 (threshold 15). Of this number, 82 points are the body's own statements and 36 belong to 5 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.
usageStats.router.get("/api-keys/:keyId/model-stats") (cyclomatic 76) REDACTED:933— usageStats.router.get("/api-keys/:keyId/model-stats") has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usageStats.router.get("/accounts/:accountId/usage-records") (cyclomatic 103) REDACTED:3066— usageStats.router.get("/accounts/:accountId/usage-records") has cyclomatic complexity 103 (threshold 15). Of this number, 79 points are the body's own statements and 24 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usageStats.router.get("/accounts/:accountId/usage-history") (cyclomatic 56) REDACTED:247— usageStats.router.get("/accounts/:accountId/usage-history") has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 belong to one function literal inside it that branches. 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.
(anonymous) (cyclomatic 24) src/routes/admin/dashboard.js:23— (anonymous) 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.
(anonymous) (cyclomatic 24) src/routes/admin/claudeConsoleAccounts.js:211— (anonymous) 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.
handleAnthropicMessagesToGemini::resolveFunctionCallArgs (cyclomatic 23) src/services/anthropicGeminiBridgeService.js:2486— handleAnthropicMessagesToGemini::resolveFunctionCallArgs 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.
handleAnthropicMessagesToGemini::finalize (cyclomatic 22) src/services/anthropicGeminiBridgeService.js:2573— handleAnthropicMessagesToGemini::finalize 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.
(anonymous) (cyclomatic 20) REDACTED:412— (anonymous) has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
(anonymous) (cyclomatic 20) web/admin-spa/src/stores/auth.js:7— (anonymous) has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 8 function items inside it that branch (loadOemSettings, login, verifyToken, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
usageStats.router.get("/api-keys/:keyId/usage-records") (cognitive 134) REDACTED:2708— usageStats.router.get("/api-keys/:keyId/usage-records") has cognitive complexity 134 (threshold 15). Drivers by points: boolean chains 59, if/else 28 (47 pts), ternaries 16 (19 pts), loops 5 (6 pts), error handling 2 (3 pts) (nesting depth added 24). Of this number, 97 points are the body's own statements and 37 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usageStats.router.get("/api-keys/:keyId/model-stats") (cognitive 122) REDACTED:933— usageStats.router.get("/api-keys/:keyId/model-stats") has cognitive complexity 122 (threshold 15). Drivers by points: if/else 27 (61 pts), boolean chains 44, loops 6 (12 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 42). 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.
usageStats.router.get("/accounts/:accountId/usage-records") (cognitive 127) REDACTED:3066— usageStats.router.get("/accounts/:accountId/usage-records") has cognitive complexity 127 (threshold 15). Drivers by points: boolean chains 52, if/else 18 (45 pts), ternaries 16 (19 pts), loops 5 (8 pts), error handling 2 (3 pts) (nesting depth added 34). Of this number, 103 points are the body's own statements and 24 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usageStats.router.get("/accounts/:accountId/usage-history") (cognitive 53) REDACTED:247— usageStats.router.get("/accounts/:accountId/usage-history") has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 25, if/else 10 (17 pts), ternaries 6, error handling 2, loops 2, match/switch 1 (nesting depth added 7). Of this number, 38 points are the body's own statements and 15 belong to one function literal inside it that branches. 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.
routeToBackend::end (cognitive 38) src/routes/unified.js:200— routeToBackend::end has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (9 pts), error handling 1 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
routeToBackend::write (cognitive 28) src/routes/unified.js:148— routeToBackend::write has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (7 pts), error handling 1 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_handleStreamResponse::parseSSEForUsage (cognitive 34) REDACTED:499— _handleStreamResponse::parseSSEForUsage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (28 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_handleStreamResponse::parseSSEForUsage (cognitive 21) REDACTED:275— _handleStreamResponse::parseSSEForUsage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 34) REDACTED:412— (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (6 pts), error handling 3 (5 pts), boolean chains 3, ternaries 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.
(anonymous) (cognitive 34) src/routes/admin/claudeConsoleAccounts.js:211— (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 8, loops 1 (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.
(anonymous) (cognitive 32) REDACTED:139— (anonymous) has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (7 pts), ternaries 3 (6 pts), loops 3, error handling 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 12 belong to 5 function items 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.
(anonymous) (cognitive 32) web/admin-spa/src/stores/theme.js:157— (anonymous) has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 16, if/else 13, boolean chains 3. Most of this is not in the body itself: 0 of the 32 points are its own statements and the rest belongs to 19 function items inside it that branch (applyColorScheme, initTheme, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cognitive 25) REDACTED:192— (anonymous) has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (3 pts), boolean chains 2, 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.
(anonymous) (cognitive 25) src/routes/admin/geminiAccounts.js:301— (anonymous) has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 1 (3 pts), error handling 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.
(anonymous) (cognitive 22) REDACTED:1477— (anonymous) has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 22) src/routes/admin/system.js:93— (anonymous) has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, ternaries 2 (4 pts), error handling 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.
(anonymous) (cognitive 18) src/routes/admin/openaiAccounts.js:110— (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, error handling 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.
(anonymous) (cognitive 18) web/admin-spa/src/stores/apiKeys.js:6— (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, ternaries 3 (4 pts), boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 10 function items inside it that branch (sortApiKeys, fetchApiKeys, createApiKey, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Change-coupling hub: EditApiKeyModal.vue → apiKeyService.js, BatchEditApiKeyModal.vue, CreateApiKeyModal.vue, AccountSelector.vue, ApiKeysView.vue web/admin-spa/src/components/apikeys/EditApiKeyModal.vue— `web/admin-spa/src/components/apikeys/EditApiKeyModal.vue` changes together with 5 other files — `src/services/apiKeyService.js`, `web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue`, `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue`, `web/admin-spa/src/components/common/AccountSelector.vue`, `web/admin-spa/src/views/ApiKeysView.vue` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: apiKeyService.js → BatchEditApiKeyModal.vue, CreateApiKeyModal.vue, UsageDetailModal.vue src/services/apiKeyService.js— `src/services/apiKeyService.js` changes together with 3 other files — `web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue`, `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue`, `web/admin-spa/src/components/apikeys/UsageDetailModal.vue` — 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.
Duplicated block (72 lines × 2 locations) src/routes/admin/bedrockAccounts.js:33— src/routes/admin/bedrockAccounts.js:33 · src/routes/admin/geminiAccounts.js:161 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (72 lines × 2 locations) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216— web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216 · web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:293 — 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 (61 lines × 2 locations) REDACTED:1493— REDACTED:1493 · REDACTED:1671 — 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 (61 lines × 2 locations) REDACTED:1928— REDACTED:1928 · REDACTED:2118 — 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 (58 matched lines × 2 locations) · ×2
Duplicated block with local edits (58 matched lines × 2 locations) REDACTED:283— REDACTED:283 · REDACTED:442 — the two spans are one implementation copied and then locally edited — 264 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.
Duplicated block with local edits (58 matched lines × 2 locations) src/utils/anthropicResponseDump.js:15— src/utils/anthropicResponseDump.js:15 · src/utils/antigravityUpstreamResponseDump.js:16 — the two spans are one implementation copied and then locally edited — 313 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (57 lines × 2 locations) src/routes/azureOpenaiRoutes.js:217— src/routes/azureOpenaiRoutes.js:217 · src/routes/azureOpenaiRoutes.js:348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (57 lines × 2 locations) src/services/relay/claudeConsoleRelayService.js:1399— src/services/relay/claudeConsoleRelayService.js:1399 · src/services/relay/claudeRelayService.js:3380 — 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.
AC3 · Page structure· Heading level jumps from h2 to h4 · ×1
Heading level jumps from h2 to h4 web/admin-spa/src/views/SettingsView.vue:999— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:37— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-vuejs-accessibility) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 81 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
handleMessagesRequest (cyclomatic 225) REDACTED:137— handleMessagesRequest has cyclomatic complexity 225 (threshold 15). Of this number, 157 points are the body's own statements and 68 belong to 17 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.
anthropicGeminiBridgeService.handleAnthropicMessagesToGemini (cyclomatic 221) src/services/anthropicGeminiBridgeService.js:1859— anthropicGeminiBridgeService.handleAnthropicMessagesToGemini has cyclomatic complexity 221 (threshold 15). Of this number, 81 points are the body's own statements and 140 belong to 16 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.
ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177) src/services/relay/claudeRelayService.js:2154— ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture has cyclomatic complexity 177 (threshold 15). Most of this is not in the body itself: 2 of the 177 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 2216, 2712, 2857, …). 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.
openaiRoutes.handleResponses (cyclomatic 148) REDACTED:293— openaiRoutes.handleResponses has cyclomatic complexity 148 (threshold 15). Of this number, 119 points are the body's own statements and 29 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.useDashboardStore (cyclomatic 147) web/admin-spa/src/stores/dashboard.js:7— dashboard.useDashboardStore has cyclomatic complexity 147 (threshold 15). Of this number, 136 points are the body's own statements and 11 belong to 6 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.
_makeClaudeConsoleStreamRequest (cyclomatic 143) src/services/relay/claudeConsoleRelayService.js:744— _makeClaudeConsoleStreamRequest has cyclomatic complexity 143 (threshold 15). Most of this is not in the body itself: 1 of the 143 points is its own statement and the rest belongs to 22 function items inside it that branch ((anonymous)::(anonymous)::(anonymous), (anonymous)::(anonymous)::(anonymous), (anonymous)::(anonymous)::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
usageStats.router.get("/account-usage-trend") (cyclomatic 134) REDACTED:1247— usageStats.router.get("/account-usage-trend") has cyclomatic complexity 134 (threshold 15). Of this number, 119 points are the body's own statements and 15 belong to 9 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.
(anonymous) (cyclomatic 134) REDACTED:1247— (anonymous) has cyclomatic complexity 134 (threshold 15). Of this number, 101 points are the body's own statements and 33 belong to 19 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.
DroidAccountService.createAccount (cyclomatic 131) REDACTED:458— DroidAccountService.createAccount has cyclomatic complexity 131 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DroidAccountService.updateAccount (cyclomatic 130) REDACTED:836— DroidAccountService.updateAccount has cyclomatic complexity 130 (threshold 15). Of this number, 123 points are the body's own statements and 7 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.
apiStats.router.post("/api/user-stats") (cyclomatic 128) REDACTED:101— apiStats.router.post("/api/user-stats") has cyclomatic complexity 128 (threshold 15). Of this number, 119 points are the body's own statements and 9 belong to 3 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.
(anonymous) (cyclomatic 128) REDACTED:101— (anonymous) has cyclomatic complexity 128 (threshold 15). Of this number, 119 points are the body's own statements and 9 belong to 3 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.
relayRequest (cyclomatic 124) src/services/relay/claudeRelayService.js:480— relayRequest has cyclomatic complexity 124 (threshold 15). Of this number, 111 points are the body's own statements and 13 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.
authenticateApiKey (cyclomatic 119) REDACTED:440— authenticateApiKey has cyclomatic complexity 119 (threshold 15). Of this number, 109 points are the body's own statements and 10 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.
(anonymous) (cyclomatic 119) REDACTED:2708— (anonymous) has cyclomatic complexity 119 (threshold 15). Of this number, 83 points are the body's own statements and 36 belong to 15 function items 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.
sanitizeMaxTokens (cyclomatic 117) REDACTED:944— sanitizeMaxTokens has cyclomatic complexity 117 (threshold 15). Most of this is not in the body itself: 2 of the 117 points are its own statements and the rest belongs to 23 function items inside it that branch ((anonymous), (anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
apiKeys.router.put("/api-keys/:keyId") (cyclomatic 108) REDACTED:2108— apiKeys.router.put("/api-keys/:keyId") has cyclomatic complexity 108 (threshold 15). Of this number, 107 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.
(anonymous) (cyclomatic 108) REDACTED:2108— (anonymous) has cyclomatic complexity 108 (threshold 15). Of this number, 106 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.
(anonymous) (cyclomatic 105) REDACTED:3066— (anonymous) has cyclomatic complexity 105 (threshold 15). Of this number, 81 points are the body's own statements and 24 belong to 6 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.
apistats.useApiStatsStore (cyclomatic 104) web/admin-spa/src/stores/apistats.js:6— apistats.useApiStatsStore has cyclomatic complexity 104 (threshold 15). Of this number, 77 points are the body's own statements and 27 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.
(anonymous) (cyclomatic 104) web/admin-spa/src/stores/apistats.js:6— (anonymous) has cyclomatic complexity 104 (threshold 15). Most of this is not in the body itself: 1 of the 104 points is its own statement and the rest belongs to 27 function items inside it that branch ((anonymous), queryStats, switchPeriod, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
sync.router.get("/sync/export-accounts") (cyclomatic 103) src/routes/admin/sync.js:93— sync.router.get("/sync/export-accounts") has cyclomatic complexity 103 (threshold 15). Of this number, 58 points are the body's own statements and 45 belong to one function literal inside it that branches. 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.
(anonymous) (cyclomatic 103) src/routes/admin/sync.js:93— (anonymous) has cyclomatic complexity 103 (threshold 15). Of this number, 58 points are the body's own statements and 45 belong to one function literal inside it that branches. 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.
UnifiedClaudeScheduler._getAllAvailableAccounts (cyclomatic 102) src/services/scheduler/unifiedClaudeScheduler.js:515— UnifiedClaudeScheduler._getAllAvailableAccounts has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
data-transfer-enhanced.importData (cyclomatic 96) scripts/data-transfer-enhanced.js:835— data-transfer-enhanced.importData has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usageStats.router.get("/api-keys-usage-trend") (cyclomatic 96) REDACTED:1825— usageStats.router.get("/api-keys-usage-trend") has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
relayRequest (cyclomatic 96) src/services/relay/claudeConsoleRelayService.js:23— relayRequest has cyclomatic complexity 96 (threshold 15). Of this number, 94 points are the body's own statements and 2 belong to 7 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.
(anonymous) (cyclomatic 96) REDACTED:1825— (anonymous) has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
handleRequest (cyclomatic 93) REDACTED:68— handleRequest has cyclomatic complexity 93 (threshold 15). Of this number, 91 points are the body's own statements and 2 belong to 11 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.
openaiRoutes.handleImages (cyclomatic 90) REDACTED:971— openaiRoutes.handleImages has cyclomatic complexity 90 (threshold 15). Of this number, 63 points are the body's own statements and 27 belong to 4 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.
openaiGeminiRoutes.router.post("/v1/chat/completions") (cyclomatic 89) REDACTED:192— openaiGeminiRoutes.router.post("/v1/chat/completions") has cyclomatic complexity 89 (threshold 15). Of this number, 52 points are the body's own statements and 37 belong to 4 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.
(anonymous) (cyclomatic 89) REDACTED:192— (anonymous) has cyclomatic complexity 89 (threshold 15). Of this number, 52 points are the body's own statements and 37 belong to 4 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.
geminiHandlers.handleStandardStreamGenerateContent (cyclomatic 88) REDACTED:2506— geminiHandlers.handleStandardStreamGenerateContent has cyclomatic complexity 88 (threshold 15). Of this number, 49 points are the body's own statements and 39 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.
recordUsageWithDetails (cyclomatic 85) src/services/apiKeyService.js:1862— recordUsageWithDetails has cyclomatic complexity 85 (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.
apiKeys.router.post("/api-keys") (cyclomatic 82) REDACTED:1472— apiKeys.router.post("/api-keys") has cyclomatic complexity 82 (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.
(anonymous) (cyclomatic 82) REDACTED:1472— (anonymous) has cyclomatic complexity 82 (threshold 15). Of this number, 81 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
data-transfer-enhanced.exportData (cyclomatic 80) scripts/data-transfer-enhanced.js:478— data-transfer-enhanced.exportData has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usageStats.router.get("/usage-trend") (cyclomatic 79) REDACTED:539— usageStats.router.get("/usage-trend") has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 79) REDACTED:539— (anonymous) has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
geminiSchemaCleaner.cleanJsonSchemaForGemini (cyclomatic 78) src/utils/geminiSchemaCleaner.js:87— geminiSchemaCleaner.cleanJsonSchemaForGemini has cyclomatic complexity 78 (threshold 15). Of this number, 74 points are the body's own statements and 4 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.
relayRequest (cyclomatic 78) src/services/relay/ccrRelayService.js:16— relayRequest has cyclomatic complexity 78 (threshold 15). Of this number, 76 points are the body's own statements and 2 belong to 8 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.
ApiKeyService.getAllApiKeysFast (cyclomatic 77) src/services/apiKeyService.js:1052— ApiKeyService.getAllApiKeysFast has cyclomatic complexity 77 (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.
(anonymous) (cyclomatic 76) REDACTED:933— (anonymous) has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
unified.buildGeminiRequestFromOpenAI (cyclomatic 74) src/routes/unified.js:557— unified.buildGeminiRequestFromOpenAI has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 72) src/routes/admin/claudeRelayConfig.js:38— (anonymous) has cyclomatic complexity 72 (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.
claudeRelayConfig.router.put("/claude-relay-config") (cyclomatic 71) src/routes/admin/claudeRelayConfig.js:38— claudeRelayConfig.router.put("/claude-relay-config") has cyclomatic complexity 71 (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.
UnifiedGeminiScheduler._getAllAvailableAccounts (cyclomatic 69) src/services/scheduler/unifiedGeminiScheduler.js:224— UnifiedGeminiScheduler._getAllAvailableAccounts has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
handleStreamGenerateContent (cyclomatic 68) REDACTED:1806— handleStreamGenerateContent has cyclomatic complexity 68 (threshold 15). Of this number, 36 points are the body's own statements and 32 belong to 9 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.
calculateKeyStats (cyclomatic 68) REDACTED:1073— calculateKeyStats has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usageStats.router.get("/usage-costs") (cyclomatic 64) REDACTED:2286— usageStats.router.get("/usage-costs") has cyclomatic complexity 64 (threshold 15). Of this number, 60 points are the body's own statements and 4 belong 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.
_makeCcrStreamRequest (cyclomatic 64) src/services/relay/ccrRelayService.js:561— _makeCcrStreamRequest has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 1 of the 64 points is its own statement and the rest belongs to 19 function items inside it that branch ((anonymous)::(anonymous), (anonymous)::(anonymous)::(anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cyclomatic 64) REDACTED:2286— (anonymous) has cyclomatic complexity 64 (threshold 15). Of this number, 60 points are the body's own statements and 4 belong to 6 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.
anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents (cyclomatic 63) src/services/anthropicGeminiBridgeService.js:1026— anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
handleMessages (cyclomatic 62) REDACTED:395— handleMessages has cyclomatic complexity 62 (threshold 15). Of this number, 42 points are the body's own statements and 20 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.
antigravityClient.request (cyclomatic 61) src/services/antigravityClient.js:259— antigravityClient.request has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 13 of the 61 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 366, 307, 321, …). 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.
openaiClaudeRoutes.handleChatCompletion (cyclomatic 61) REDACTED:186— openaiClaudeRoutes.handleChatCompletion has cyclomatic complexity 61 (threshold 15). Of this number, 35 points are the body's own statements and 26 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.
azureOpenaiRelayService.handleStreamResponse (cyclomatic 61) src/services/relay/azureOpenaiRelayService.js:270— azureOpenaiRelayService.handleStreamResponse has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 2 of the 61 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 470, 322, 408, …). 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.
PricingService.calculateCost (cyclomatic 59) src/services/pricingService.js:513— PricingService.calculateCost 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.
anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools (cyclomatic 59) src/services/anthropicGeminiBridgeService.js:773— anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 4 of the 59 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 779, 910, 859, …). 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.
apiKeys.router.put("/api-keys/batch") (cyclomatic 58) REDACTED:1882— apiKeys.router.put("/api-keys/batch") has cyclomatic complexity 58 (threshold 15). Of this number, 56 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.
(anonymous) (cyclomatic 58) REDACTED:1882— (anonymous) has cyclomatic complexity 58 (threshold 15). Of this number, 56 points are the body's own statements and 2 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.
WebhookConfigService.validatePlatformConfig (cyclomatic 56) src/services/webhookConfigService.js:109— WebhookConfigService.validatePlatformConfig has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fix-usage-stats.fixUsageStats (cyclomatic 56) scripts/fix-usage-stats.js:23— fix-usage-stats.fixUsageStats has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
unified.routeToBackend (cyclomatic 56) src/routes/unified.js:115— unified.routeToBackend has cyclomatic complexity 56 (threshold 15). Of this number, 22 points are the body's own statements and 34 belong to 6 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.
(anonymous) (cyclomatic 56) REDACTED:247— (anonymous) has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 belong to one function item inside it that branches. 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.
backfillCurrentWeekClaudeCosts (cyclomatic 53) src/services/weeklyClaudeCostInitService.js:69— backfillCurrentWeekClaudeCosts has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnifiedClaudeScheduler._isAccountAvailable (cyclomatic 51) src/services/scheduler/unifiedClaudeScheduler.js:1047— UnifiedClaudeScheduler._isAccountAvailable has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generateApiKey (cyclomatic 51) src/services/apiKeyService.js:176— generateApiKey has cyclomatic complexity 51 (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.
ApiKeyService.getAllApiKeys (cyclomatic 49) src/services/apiKeyService.js:867— ApiKeyService.getAllApiKeys has cyclomatic complexity 49 (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.
handleRequest (cyclomatic 49) REDACTED:43— handleRequest has cyclomatic complexity 49 (threshold 15). Of this number, 47 points are the body's own statements and 2 belong to 9 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.
data-transfer.formatCSVValue (cyclomatic 48) scripts/data-transfer.js:146— data-transfer.formatCSVValue has cyclomatic complexity 48 (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.
ClaudeRelayService.relayStreamRequestWithUsageCapture (cyclomatic 48) src/services/relay/claudeRelayService.js:1883— ClaudeRelayService.relayStreamRequestWithUsageCapture has cyclomatic complexity 48 (threshold 15). Of this number, 42 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openaiAccounts.router.put("/:id") (cyclomatic 48) src/routes/admin/openaiAccounts.js:479— openaiAccounts.router.put("/:id") has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 48) src/routes/admin/openaiAccounts.js:479— (anonymous) has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
api.router.post("/v1/messages/count_tokens") (cyclomatic 47) REDACTED:1673— api.router.post("/v1/messages/count_tokens") has cyclomatic complexity 47 (threshold 15). Of this number, 35 points are the body's own statements and 12 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.
droidAccounts.router.get("/droid-accounts") (cyclomatic 47) src/routes/admin/droidAccounts.js:144— droidAccounts.router.get("/droid-accounts") has cyclomatic complexity 47 (threshold 15). Of this number, 19 points are the body's own statements and 28 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.
initialize (cyclomatic 47) src/app.js:50— initialize has cyclomatic complexity 47 (threshold 15). Of this number, 18 points are the body's own statements and 29 belong to 16 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.
(anonymous) (cyclomatic 47) REDACTED:1673— (anonymous) has cyclomatic complexity 47 (threshold 15). Of this number, 35 points are the body's own statements and 12 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.
BedrockRelayService.handleStreamRequest (cyclomatic 46) src/services/relay/bedrockRelayService.js:243— BedrockRelayService.handleStreamRequest has cyclomatic complexity 46 (threshold 15). Of this number, 44 points are the body's own statements and 2 belong 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.
ApiKeyService.validateApiKey (cyclomatic 46) src/services/apiKeyService.js:360— ApiKeyService.validateApiKey has cyclomatic complexity 46 (threshold 15). Of this number, 43 points are the body's own statements and 3 belong to 3 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.
UnifiedClaudeScheduler.selectAccountForApiKey (cyclomatic 46) src/services/scheduler/unifiedClaudeScheduler.js:180— UnifiedClaudeScheduler.selectAccountForApiKey has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
geminiHandlers.handleStandardGenerateContent (cyclomatic 46) REDACTED:2212— geminiHandlers.handleStandardGenerateContent has cyclomatic complexity 46 (threshold 15). Of this number, 45 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.
geminiApiAccounts.router.get("/gemini-api-accounts") (cyclomatic 46) REDACTED:13— geminiApiAccounts.router.get("/gemini-api-accounts") has cyclomatic complexity 46 (threshold 15). Of this number, 16 points are the body's own statements and 30 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.
DroidRelayService._handleStreamRequest (cyclomatic 46) src/services/relay/droidRelayService.js:415— DroidRelayService._handleStreamRequest has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 464, 542, 597, …). 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.
dashboard.router.get("/dashboard") (cyclomatic 45) src/routes/admin/dashboard.js:23— dashboard.router.get("/dashboard") has cyclomatic complexity 45 (threshold 15). Of this number, 24 points are the body's own statements and 21 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.
apiStats.router.post("/api/batch-stats") (cyclomatic 45) REDACTED:590— apiStats.router.post("/api/batch-stats") has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 8 of the 45 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 713, 658, 697). 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.
(anonymous) (cyclomatic 45) REDACTED:590— (anonymous) has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 8 of the 45 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 713, 658, 697, …). 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.
relayRequest (cyclomatic 45) src/services/relay/droidRelayService.js:184— relayRequest has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClaudeAccountService.updateAccount (cyclomatic 43) src/services/account/claudeAccountService.js:740— ClaudeAccountService.updateAccount has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
data-transfer.importData (cyclomatic 43) scripts/data-transfer.js:449— data-transfer.importData has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClaudeConsoleRelayService.relayStreamRequestWithUsageCapture (cyclomatic 43) src/services/relay/claudeConsoleRelayService.js:491— ClaudeConsoleRelayService.relayStreamRequestWithUsageCapture has cyclomatic complexity 43 (threshold 15). Of this number, 38 points are the body's own statements and 5 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.
geminiHandlers.handleGenerateContent (cyclomatic 43) REDACTED:1563— geminiHandlers.handleGenerateContent has cyclomatic complexity 43 (threshold 15). Of this number, 42 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.
buildRequestFromOpenAI (cyclomatic 43) src/services/codexToOpenAI.js:393— buildRequestFromOpenAI has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations (cyclomatic 43) src/services/anthropicGeminiBridgeService.js:779— convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
data-transfer.exportData (cyclomatic 42) scripts/data-transfer.js:276— data-transfer.exportData has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionHelper.generateSessionHash (cyclomatic 42) src/utils/sessionHelper.js:12— SessionHelper.generateSessionHash has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openaiResponsesAccounts.router.get("/openai-responses-accounts") (cyclomatic 42) REDACTED:24— openaiResponsesAccounts.router.get("/openai-responses-accounts") has cyclomatic complexity 42 (threshold 15). Of this number, 16 points are the body's own statements and 26 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.
grokAccounts.router.get("/grok-accounts") (cyclomatic 42) REDACTED:139— grokAccounts.router.get("/grok-accounts") 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 2 function literals inside it that branch (lines 188, 216). 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.
OpenAIResponsesRelayService._handleStreamResponse (cyclomatic 41) REDACTED:476— OpenAIResponsesRelayService._handleStreamResponse has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 584, 499, 556, …). 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.
RedisClient.getApiKeysPaginated (cyclomatic 40) REDACTED:856— RedisClient.getApiKeysPaginated has cyclomatic complexity 40 (threshold 15). Of this number, 25 points are the body's own statements and 15 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
anthropicGeminiBridgeService.normalizeAnthropicMessages (cyclomatic 40) src/services/anthropicGeminiBridgeService.js:568— anthropicGeminiBridgeService.normalizeAnthropicMessages has cyclomatic complexity 40 (threshold 15). Of this number, 20 points are the body's own statements and 20 belong to 4 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.
backfillSingleKey (cyclomatic 40) src/services/weeklyClaudeCostInitService.js:309— backfillSingleKey has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
relayStreamRequestWithUsageCapture (cyclomatic 40) src/services/relay/ccrRelayService.js:373— relayStreamRequestWithUsageCapture has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 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.
UnifiedClaudeScheduler._isModelSupportedByAccount (cyclomatic 39) src/services/scheduler/unifiedClaudeScheduler.js:49— UnifiedClaudeScheduler._isModelSupportedByAccount 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.
webhook.router.post("/test") (cyclomatic 39) src/routes/webhook.js:116— webhook.router.post("/test") has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 belong 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.
CostInitService.initializeApiKeyCosts (cyclomatic 39) src/services/costInitService.js:140— CostInitService.initializeApiKeyCosts 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.
(anonymous) (cyclomatic 39) src/routes/webhook.js:116— (anonymous) has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 belong 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.
UnifiedClaudeScheduler.selectAccountFromGroup (cyclomatic 38) src/services/scheduler/unifiedClaudeScheduler.js:1529— UnifiedClaudeScheduler.selectAccountFromGroup has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnifiedOpenAIScheduler.selectAccountForApiKey (cyclomatic 38) src/services/scheduler/unifiedOpenAIScheduler.js:122— UnifiedOpenAIScheduler.selectAccountForApiKey has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
handleAzureOpenAIRequest (cyclomatic 38) src/services/relay/azureOpenaiRelayService.js:16— handleAzureOpenAIRequest has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buildAntigravityQuota (cyclomatic 38) src/services/balanceProviders/geminiBalanceProvider.js:61— buildAntigravityQuota has cyclomatic complexity 38 (threshold 15). Of this number, 24 points are the body's own statements and 14 belong to 5 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.
RedisClient.getAccountSessionWindowUsage (cyclomatic 37) REDACTED:3892— RedisClient.getAccountSessionWindowUsage has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApiKeyService.validateApiKeyForStats (cyclomatic 37) src/services/apiKeyService.js:559— ApiKeyService.validateApiKeyForStats 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.
apiStats.router.post("/api/user-model-stats") (cyclomatic 37) REDACTED:1319— apiStats.router.post("/api/user-model-stats") has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
accounts.useAccountsStore (cyclomatic 37) web/admin-spa/src/stores/accounts.js:22— accounts.useAccountsStore has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 19 function literals inside it that branch (lines 51, 144, 162, …). 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.
migrateUsageIndex (cyclomatic 37) REDACTED:202— migrateUsageIndex has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 37) web/admin-spa/src/stores/accounts.js:22— (anonymous) has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 51 function items inside it that branch (fetchAccounts, toggleAccount, deleteAccount, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openaiAccountService.createAccount (cyclomatic 36) REDACTED:437— openaiAccountService.createAccount has cyclomatic complexity 36 (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.
UnifiedOpenAIScheduler._getAllAvailableAccounts (cyclomatic 36) src/services/scheduler/unifiedOpenAIScheduler.js:356— UnifiedOpenAIScheduler._getAllAvailableAccounts has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
geminiAccountService.updateAccount (cyclomatic 35) REDACTED:602— geminiAccountService.updateAccount 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.
ClaudeAccountService.selectAccountForApiKey (cyclomatic 34) src/services/account/claudeAccountService.js:1072— ClaudeAccountService.selectAccountForApiKey has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body's own statements and 9 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.
ClaudeConsoleAccountService.updateAccount (cyclomatic 34) src/services/account/claudeConsoleAccountService.js:299— ClaudeConsoleAccountService.updateAccount has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
geminiAccountService.createAccount (cyclomatic 34) REDACTED:444— geminiAccountService.createAccount has cyclomatic complexity 34 (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.
openaiAccountService.refreshAccountToken (cyclomatic 34) REDACTED:271— openaiAccountService.refreshAccountToken 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.
DroidAccountService.refreshAccessToken (cyclomatic 34) REDACTED:1213— DroidAccountService.refreshAccessToken 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.
openaiAccounts.router.post("/") (cyclomatic 34) src/routes/admin/openaiAccounts.js:320— openaiAccounts.router.post("/") 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.
AccountNameCacheService.refresh (cyclomatic 33) src/services/accountNameCacheService.js:41— AccountNameCacheService.refresh has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 belong 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.
data-transfer-enhanced.exportUsageStats (cyclomatic 33) scripts/data-transfer-enhanced.js:148— data-transfer-enhanced.exportUsageStats 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.
data-transfer-enhanced.importUsageStats (cyclomatic 33) scripts/data-transfer-enhanced.js:299— data-transfer-enhanced.importUsageStats has cyclomatic complexity 33 (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.
ClaudeRelayService._processRequestBody (cyclomatic 33) src/services/relay/claudeRelayService.js:1196— ClaudeRelayService._processRequestBody has cyclomatic complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 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.
apiKeys.router.get("/api-keys") (cyclomatic 33) REDACTED:177— apiKeys.router.get("/api-keys") has cyclomatic complexity 33 (threshold 15). Of this number, 32 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.
dashboard.router.get("/model-stats") (cyclomatic 33) src/routes/admin/dashboard.js:407— dashboard.router.get("/model-stats") has cyclomatic complexity 33 (threshold 15). Of this number, 29 points are the body's own statements and 4 belong 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.
QuotaCardService.redeemCard (cyclomatic 33) src/services/quotaCardService.js:293— QuotaCardService.redeemCard 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.
azureOpenaiRoutes.router.post("/chat/completions") (cyclomatic 33) src/routes/azureOpenaiRoutes.js:161— azureOpenaiRoutes.router.post("/chat/completions") has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. 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. This shape REPEATS in the file: one other method here (azureOpenaiRoutes.router.post("/responses")) 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.
azureOpenaiRoutes.router.post("/responses") (cyclomatic 33) src/routes/azureOpenaiRoutes.js:292— azureOpenaiRoutes.router.post("/responses") has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. 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. This shape REPEATS in the file: one other method here (azureOpenaiRoutes.router.post("/chat/completions")) 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.
(anonymous) (cyclomatic 33) src/routes/admin/dashboard.js:407— (anonymous) has cyclomatic complexity 33 (threshold 15). Of this number, 29 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.
DroidRelayService._parseOpenAIUsageFromSSE (cyclomatic 32) src/services/relay/droidRelayService.js:756— DroidRelayService._parseOpenAIUsageFromSSE has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DroidRelayService._processRequestBody (cyclomatic 32) src/services/relay/droidRelayService.js:1135— DroidRelayService._processRequestBody has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 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.
batchGetAccountGroupsByIndex (cyclomatic 32) src/services/accountGroupService.js:521— batchGetAccountGroupsByIndex has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 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.
_getAccountBalanceForAccount (cyclomatic 32) src/services/account/accountBalanceService.js:283— _getAccountBalanceForAccount 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.
openaiAccountService.refreshAccessToken (cyclomatic 31) REDACTED:117— openaiAccountService.refreshAccessToken has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApiKeyService._resolveAccountByUsageRecord (cyclomatic 31) src/services/apiKeyService.js:2222— ApiKeyService._resolveAccountByUsageRecord has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong 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.
GeminiToOpenAIConverter._convertGeminiChunkToOpenAI (cyclomatic 31) src/services/geminiToOpenAI.js:198— GeminiToOpenAIConverter._convertGeminiChunkToOpenAI has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
apiStats.router.post("/api/batch-model-stats") (cyclomatic 31) REDACTED:791— apiStats.router.post("/api/batch-model-stats") has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 820). 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.
azureOpenaiRelayService.extractUsageDataRobust (cyclomatic 31) src/services/relay/azureOpenaiRelayService.js:620— azureOpenaiRelayService.extractUsageDataRobust has cyclomatic complexity 31 (threshold 15). Of this number, 21 points are the body's own statements and 10 belong 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.
(anonymous) (cyclomatic 31) REDACTED:791— (anonymous) has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 820, 924). 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.
logger.safeStringify (cyclomatic 30) REDACTED:10— logger.safeStringify has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong 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.
UnifiedGeminiScheduler.selectAccountFromGroup (cyclomatic 30) src/services/scheduler/unifiedGeminiScheduler.js:699— UnifiedGeminiScheduler.selectAccountFromGroup 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.
UnifiedOpenAIScheduler.selectAccountFromGroup (cyclomatic 30) src/services/scheduler/unifiedOpenAIScheduler.js:818— UnifiedOpenAIScheduler.selectAccountFromGroup 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.
GeminiToOpenAIConverter.convertResponse (cyclomatic 30) src/services/geminiToOpenAI.js:97— GeminiToOpenAIConverter.convertResponse has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 101). 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.
theme.useThemeStore (cyclomatic 30) web/admin-spa/src/stores/theme.js:157— theme.useThemeStore has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 230, 187, 165, …). 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.
_captureRequestDetail (cyclomatic 30) src/services/apiKeyService.js:2145— _captureRequestDetail has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cyclomatic 30) web/admin-spa/src/stores/theme.js:157— (anonymous) has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 19 function items inside it that branch (applyColorScheme, initTheme, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProxyHelper.createProxyAgent (cyclomatic 29) src/utils/proxyHelper.js:21— ProxyHelper.createProxyAgent 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.
ClaudeAccountService._normalizeExtInfo (cyclomatic 29) src/services/account/claudeAccountService.js:3456— ClaudeAccountService._normalizeExtInfo 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.
antigravityClient.normalizeAntigravityEnvelope (cyclomatic 29) src/services/antigravityClient.js:188— antigravityClient.normalizeAntigravityEnvelope 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.
RedisClient.getAccountUsageStats (cyclomatic 29) REDACTED:2338— RedisClient.getAccountUsageStats has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 2400). 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.
claudeConsoleAccounts.router.post("/claude-console-accounts") (cyclomatic 29) src/routes/admin/claudeConsoleAccounts.js:118— claudeConsoleAccounts.router.post("/claude-console-accounts") has cyclomatic complexity 29 (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.
openaiGeminiRoutes.convertMessagesToGemini (cyclomatic 29) REDACTED:40— openaiGeminiRoutes.convertMessagesToGemini has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 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.
updateIndex (cyclomatic 29) src/services/apiKeyIndexService.js:305— updateIndex 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.
createAccount (cyclomatic 29) src/services/account/grokAccountService.js:71— createAccount has cyclomatic complexity 29 (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.
(anonymous) (cyclomatic 29) src/routes/admin/claudeConsoleAccounts.js:118— (anonymous) has cyclomatic complexity 29 (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.
anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent (cyclomatic 28) src/services/anthropicGeminiBridgeService.js:1623— anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 28) src/routes/azureOpenaiRoutes.js:423— (anonymous) 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.
sanitizeMaxTokens (cyclomatic 28) REDACTED:457— sanitizeMaxTokens has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 11 function items inside it that branch ((anonymous), (anonymous)::(anonymous), (anonymous)::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
antigravityClient.normalizeAntigravityThinking (cyclomatic 27) src/services/antigravityClient.js:123— antigravityClient.normalizeAntigravityThinking 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.
ServiceRatesService.getServiceFromModel (cyclomatic 27) src/services/serviceRatesService.js:146— ServiceRatesService.getServiceFromModel has cyclomatic complexity 27 (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.
OpenAIResponsesRelayService._handle429Error (cyclomatic 27) REDACTED:804— OpenAIResponsesRelayService._handle429Error 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.
geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") (cyclomatic 27) REDACTED:460— geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 559, 533, 472, …). 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.
droidAccounts.router.put("/droid-accounts/:id") (cyclomatic 27) src/routes/admin/droidAccounts.js:351— droidAccounts.router.put("/droid-accounts/:id") has cyclomatic complexity 27 (threshold 15). Of this number, 26 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.
BalanceScriptService.execute (cyclomatic 27) src/services/balanceScriptService.js:62— BalanceScriptService.execute has cyclomatic complexity 27 (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.
azureOpenaiRoutes.router.post("/embeddings") (cyclomatic 27) src/routes/azureOpenaiRoutes.js:423— azureOpenaiRoutes.router.post("/embeddings") 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.
(anonymous) (cyclomatic 27) src/routes/admin/droidAccounts.js:351— (anonymous) has cyclomatic complexity 27 (threshold 15). Of this number, 26 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.
ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts (cyclomatic 26) src/services/account/claudeAccountService.js:3275— ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts 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.
RedisClient.batchGetAccountDailyCost (cyclomatic 26) REDACTED:2021— RedisClient.batchGetAccountDailyCost has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ApiKeyService.updateApiKey (cyclomatic 26) src/services/apiKeyService.js:1328— ApiKeyService.updateApiKey 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.
errorSanitizer.mapToErrorCode (cyclomatic 26) src/utils/errorSanitizer.js:75— errorSanitizer.mapToErrorCode 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.
DroidScheduler.selectAccount (cyclomatic 26) src/services/scheduler/droidScheduler.js:97— DroidScheduler.selectAccount has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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.
LdapService.authenticateUserCredentials (cyclomatic 26) src/services/ldapService.js:514— LdapService.authenticateUserCredentials has cyclomatic complexity 26 (threshold 15). Of this number, 25 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.
handleStreamResponse (cyclomatic 26) src/services/relay/geminiRelayService.js:109— handleStreamResponse 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.
_normalizeUsageSnapshot (cyclomatic 26) src/services/relay/droidRelayService.js:896— _normalizeUsageSnapshot has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
GrokAccountService.updateAccount (cyclomatic 25) src/services/account/grokAccountService.js:289— GrokAccountService.updateAccount has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CostCalculator.buildLegacyCostResult (cyclomatic 25) src/utils/costCalculator.js:199— CostCalculator.buildLegacyCostResult has cyclomatic complexity 25 (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.
ClaudeRelayService._enforceCacheControlLimit (cyclomatic 25) src/services/relay/claudeRelayService.js:1466— ClaudeRelayService._enforceCacheControlLimit has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1501, 1526, 1473, …). 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.
rateLimitHelper.updateRateLimitCounters (cyclomatic 25) src/utils/rateLimitHelper.js:12— rateLimitHelper.updateRateLimitCounters 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.
CodexToOpenAIConverter.convertResponse (cyclomatic 25) src/services/codexToOpenAI.js:84— CodexToOpenAIConverter.convertResponse 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.
claudeAccounts.router.post("/claude-accounts") (cyclomatic 25) src/routes/admin/claudeAccounts.js:606— claudeAccounts.router.post("/claude-accounts") has cyclomatic complexity 25 (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.
apiStats.router.post("/api-key/test-openai") (cyclomatic 25) REDACTED:1165— apiStats.router.post("/api-key/test-openai") has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1258, 1238). 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.
(anonymous) (cyclomatic 25) src/routes/admin/claudeAccounts.js:606— (anonymous) has cyclomatic complexity 25 (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.
ClaudeAccountService.createAccount (cyclomatic 24) src/services/account/claudeAccountService.js:81— ClaudeAccountService.createAccount 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.
openaiAccountService.selectAvailableAccount (cyclomatic 24) REDACTED:829— openaiAccountService.selectAvailableAccount has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong 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.
requestDetailHelper.sanitizeValue (cyclomatic 24) REDACTED:385— requestDetailHelper.sanitizeValue 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.
auth.requestLogger (cyclomatic 24) REDACTED:1765— auth.requestLogger has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1795). 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.
UnifiedGeminiScheduler.selectAccountForApiKey (cyclomatic 24) src/services/scheduler/unifiedGeminiScheduler.js:55— UnifiedGeminiScheduler.selectAccountForApiKey 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.
anthropicGeminiBridgeService.canEnableAntigravityThinking (cyclomatic 24) src/services/anthropicGeminiBridgeService.js:1221— anthropicGeminiBridgeService.canEnableAntigravityThinking has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic (cyclomatic 24) src/services/anthropicGeminiBridgeService.js:1300— anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic 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.
claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") (cyclomatic 24) src/routes/admin/claudeConsoleAccounts.js:211— claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") 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.
sendGeminiRequest (cyclomatic 24) src/services/relay/geminiRelayService.js:229— sendGeminiRequest 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.
refreshAccountToken (cyclomatic 24) src/services/account/claudeAccountService.js:263— refreshAccountToken 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.
ClaudeAccountService.getAllAccounts (cyclomatic 23) src/services/account/claudeAccountService.js:546— ClaudeAccountService.getAllAccounts has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 552). 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.
geminiAccountService.selectAvailableAccount (cyclomatic 23) REDACTED:849— geminiAccountService.selectAvailableAccount has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong 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.
BedrockRelayService.handleNonStreamRequest (cyclomatic 23) src/services/relay/bedrockRelayService.js:108— BedrockRelayService.handleNonStreamRequest 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.
GeminiApiAccountService.getAllAccounts (cyclomatic 23) src/services/account/geminiApiAccountService.js:201— GeminiApiAccountService.getAllAccounts 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.
BillingEventPublisher.publishBillingEvent (cyclomatic 23) src/services/billingEventPublisher.js:24— BillingEventPublisher.publishBillingEvent has cyclomatic complexity 23 (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.
debug-redis-keys.debugRedisKeys (cyclomatic 23) scripts/debug-redis-keys.js:11— debug-redis-keys.debugRedisKeys 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.
ClaudeCodeValidator.hasClaudeCodeSystemPrompt (cyclomatic 23) src/validators/clients/claudeCodeValidator.js:51— ClaudeCodeValidator.hasClaudeCodeSystemPrompt 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.
anthropicGeminiBridgeService.handleAnthropicCountTokensToGemini (cyclomatic 23) src/services/anthropicGeminiBridgeService.js:3008— anthropicGeminiBridgeService.handleAnthropicCountTokensToGemini 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.
GrokScheduler.selectAccount (cyclomatic 23) src/services/scheduler/grokScheduler.js:69— GrokScheduler.selectAccount has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong 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.
usageStats.getUsageDataByIndex (cyclomatic 23) REDACTED:23— usageStats.getUsageDataByIndex has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 63, 26, 43, …). 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.
antigravityRelayService.handleStreamResponse (cyclomatic 22) src/services/relay/antigravityRelayService.js:32— antigravityRelayService.handleStreamResponse 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.
geminiHandlers.handleCountTokens (cyclomatic 22) REDACTED:1439— geminiHandlers.handleCountTokens 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.
apiStats.router.post("/api-key/test-gemini") (cyclomatic 22) REDACTED:1013— apiStats.router.post("/api-key/test-gemini") has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 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.
recordUsage (cyclomatic 22) src/services/apiKeyService.js:1669— recordUsage 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.
rebuildIndexes (cyclomatic 22) src/services/apiKeyIndexService.js:146— rebuildIndexes 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.
ClaudeAccountService.selectAvailableAccount (cyclomatic 21) src/services/account/claudeAccountService.js:969— ClaudeAccountService.selectAvailableAccount has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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.
openaiAccountService.updateAccount (cyclomatic 21) REDACTED:573— openaiAccountService.updateAccount 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.
CcrAccountService.updateAccount (cyclomatic 21) src/services/account/ccrAccountService.js:242— CcrAccountService.updateAccount 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.
RedisClient.getUsageStats (cyclomatic 21) REDACTED:1688— RedisClient.getUsageStats has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 1720). 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.
redis.redisClient.migrateGlobalStats (cyclomatic 21) REDACTED:5302— redis.redisClient.migrateGlobalStats has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 5325). 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.
requestDetailHelper.extractPreviewReasoningInfo (cyclomatic 21) REDACTED:289— requestDetailHelper.extractPreviewReasoningInfo 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.
OpenAIToClaudeConverter._convertStreamEvent (cyclomatic 21) src/services/openaiToClaude.js:410— OpenAIToClaudeConverter._convertStreamEvent 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.
UnifiedOpenAIScheduler._isAccountAvailable (cyclomatic 21) src/services/scheduler/unifiedOpenAIScheduler.js:522— UnifiedOpenAIScheduler._isAccountAvailable 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.
apiKeys.getApiKeysSortedByCostCustom (cyclomatic 21) REDACTED:517— apiKeys.getApiKeysSortedByCostCustom has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 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.
apiKeys.router.get("/accounts/binding-counts") (cyclomatic 21) REDACTED:860— apiKeys.router.get("/accounts/binding-counts") 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.
claudeAccounts.router.put("/claude-accounts/:accountId") (cyclomatic 21) src/routes/admin/claudeAccounts.js:717— claudeAccounts.router.put("/claude-accounts/:accountId") 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.
ccrAccounts.router.post("/") (cyclomatic 21) REDACTED:112— ccrAccounts.router.post("/") has cyclomatic complexity 21 (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.
geminiApiAccounts.router.put("/gemini-api-accounts/:id") (cyclomatic 21) REDACTED:219— geminiApiAccounts.router.put("/gemini-api-accounts/:id") 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.
openaiAccounts.router.post("/exchange-code") (cyclomatic 21) src/routes/admin/openaiAccounts.js:110— openaiAccounts.router.post("/exchange-code") has cyclomatic complexity 21 (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.
waitForConcurrencySlot (cyclomatic 21) REDACTED:248— waitForConcurrencySlot 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.
_sumModelCostsByKeysPattern (cyclomatic 21) src/services/account/accountBalanceService.js:575— _sumModelCostsByKeysPattern 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.
ClaudeAccountService.fetchAndUpdateAccountProfile (cyclomatic 20) src/services/account/claudeAccountService.js:2329— ClaudeAccountService.fetchAndUpdateAccountProfile 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.
ClaudeAccountService.updateSessionWindowStatus (cyclomatic 20) src/services/account/claudeAccountService.js:3049— ClaudeAccountService.updateSessionWindowStatus 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.
BedrockAccountService.updateAccount (cyclomatic 20) src/services/account/bedrockAccountService.js:280— BedrockAccountService.updateAccount has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
grokHelper.isBlockedHost (cyclomatic 20) src/utils/grokHelper.js:211— grokHelper.isBlockedHost 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.
PricingService.getModelPricing (cyclomatic 20) src/services/pricingService.js:355— PricingService.getModelPricing 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.
RedisClient.getKeyIdsWithModels (cyclomatic 20) REDACTED:1584— RedisClient.getKeyIdsWithModels 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.
RedisClient._sumModelCostsForAccountDays (cyclomatic 20) REDACTED:2184— RedisClient._sumModelCostsForAccountDays has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
RedisClient.getTodayStats (cyclomatic 20) REDACTED:2931— RedisClient.getTodayStats 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.
redis.redisClient.batchGetApiKeyStats (cyclomatic 20) REDACTED:4988— redis.redisClient.batchGetApiKeyStats has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CcrRelayService._parseSSELineForUsage (cyclomatic 20) src/services/relay/ccrRelayService.js:887— CcrRelayService._parseSSELineForUsage has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
auth.errorHandler (cyclomatic 20) REDACTED:1925— auth.errorHandler 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.
openaiRoutes.getOpenAIAuthToken (cyclomatic 20) REDACTED:178— openaiRoutes.getOpenAIAuthToken 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.
apiKeys.getApiKeysSortedByCostPrecomputed (cyclomatic 20) REDACTED:409— apiKeys.getApiKeysSortedByCostPrecomputed has cyclomatic complexity 20 (threshold 15). Of this number, 18 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.
geminiBalanceProvider.normalizeQuotaCategory (cyclomatic 20) src/services/balanceProviders/geminiBalanceProvider.js:27— geminiBalanceProvider.normalizeQuotaCategory has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
auth.useAuthStore (cyclomatic 20) web/admin-spa/src/stores/auth.js:7— auth.useAuthStore has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
startCleanupTasks (cyclomatic 20) src/app.js:674— startCleanupTasks has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 714, 676, 801, …). 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.
exchangeCodeForTokens (cyclomatic 20) src/utils/oauthHelper.js:156— exchangeCodeForTokens 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.
exchangeSetupTokenCode (cyclomatic 20) src/utils/oauthHelper.js:375— exchangeSetupTokenCode 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.
authenticateAdmin (cyclomatic 20) REDACTED:1360— authenticateAdmin has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleStandardStreamGenerateContent::handleEventBlock (cyclomatic 20) REDACTED:2801— handleStandardStreamGenerateContent::handleEventBlock has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
modelHelper.isOpus45OrNewer (cyclomatic 19) src/utils/modelHelper.js:98— modelHelper.isOpus45OrNewer 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.
ClaudeAccountService.buildClaudeUsageSnapshot (cyclomatic 19) src/services/account/claudeAccountService.js:2177— ClaudeAccountService.buildClaudeUsageSnapshot has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 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.
ClaudeConsoleAccountService.getAllAccounts (cyclomatic 19) src/services/account/claudeConsoleAccountService.js:169— ClaudeConsoleAccountService.getAllAccounts 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.
antigravityUpstreamDump.dumpAntigravityUpstreamRequest (cyclomatic 19) src/utils/antigravityUpstreamDump.js:67— antigravityUpstreamDump.dumpAntigravityUpstreamRequest has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
geminiAccountService.fetchAvailableModelsAntigravity (cyclomatic 19) REDACTED:97— geminiAccountService.fetchAvailableModelsAntigravity has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong 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.
DroidAccountService._refreshTokensWithWorkOS (cyclomatic 19) REDACTED:337— DroidAccountService._refreshTokensWithWorkOS 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.
ClaudeRelayService._transformToolNamesInRequestBody (cyclomatic 19) src/services/relay/claudeRelayService.js:309— ClaudeRelayService._transformToolNamesInRequestBody has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 318, 336, 353, …). 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.
ClaudeRelayService._makeClaudeRequest (cyclomatic 19) src/services/relay/claudeRelayService.js:1727— ClaudeRelayService._makeClaudeRequest has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1761, 1788, 1839). 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.
ClaudeRelayService.testAccountConnectionSync (cyclomatic 19) src/services/relay/claudeRelayService.js:3517— ClaudeRelayService.testAccountConnectionSync has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 3537). 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.
auth.authenticateUserOrAdmin (cyclomatic 19) REDACTED:1560— auth.authenticateUserOrAdmin 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.
geminiHandlers.buildGeminiApiUrl (cyclomatic 19) REDACTED:88— geminiHandlers.buildGeminiApiUrl 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.
geminiHandlers.handleLoadCodeAssist (cyclomatic 19) REDACTED:1123— geminiHandlers.handleLoadCodeAssist 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.
geminiHandlers.handleOnboardUser (cyclomatic 19) REDACTED:1225— geminiHandlers.handleOnboardUser 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.
accountGroups.router.get("/:groupId/members") (cyclomatic 19) src/routes/admin/accountGroups.js:90— accountGroups.router.get("/:groupId/members") 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.
claudeAccounts.router.get("/claude-accounts") (cyclomatic 19) src/routes/admin/claudeAccounts.js:393— claudeAccounts.router.get("/claude-accounts") has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to one function literal inside it that branches. 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.
droidAccounts.router.post("/droid-accounts/exchange-code") (cyclomatic 19) src/routes/admin/droidAccounts.js:68— droidAccounts.router.post("/droid-accounts/exchange-code") 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.
browserFallback.browserFallbackMiddleware (cyclomatic 19) src/middleware/browserFallback.js:7— browserFallback.browserFallbackMiddleware has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong 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.
_normalizeRecord (cyclomatic 19) src/services/requestDetailService.js:697— _normalizeRecord 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.
_scanTagsFallback (cyclomatic 19) REDACTED:681— _scanTagsFallback has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse (cyclomatic 19) src/services/relay/claudeRelayService.js:2475— _makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse 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.
azureOpenaiAccountService.createAccount (cyclomatic 18) src/services/account/azureOpenaiAccountService.js:113— azureOpenaiAccountService.createAccount has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BedrockAccountService.getAccount (cyclomatic 18) src/services/account/bedrockAccountService.js:109— BedrockAccountService.getAccount 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.
BedrockAccountService.testAccountConnection (cyclomatic 18) src/services/account/bedrockAccountService.js:528— BedrockAccountService.testAccountConnection 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.
requestDetailHelper.extractAnthropicReasoningInfo (cyclomatic 18) REDACTED:147— requestDetailHelper.extractAnthropicReasoningInfo 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.
RequestDetailService._findRequestTimestampInRange (cyclomatic 18) src/services/requestDetailService.js:998— RequestDetailService._findRequestTimestampInRange 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.
migrate-usage-index.migrate (cyclomatic 18) scripts/migrate-usage-index.js:15— migrate-usage-index.migrate 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.
ClaudeCodeValidator.validate (cyclomatic 18) src/validators/clients/claudeCodeValidator.js:128— ClaudeCodeValidator.validate 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.
requestIdentityService.resolveAccountId (cyclomatic 18) src/services/requestIdentityService.js:205— requestIdentityService.resolveAccountId has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CodexCliValidator.validate (cyclomatic 18) src/validators/clients/codexCliValidator.js:35— CodexCliValidator.validate 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.
geminiRelayService.countTokens (cyclomatic 18) src/services/relay/geminiRelayService.js:443— geminiRelayService.countTokens 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.
ccrAccounts.router.put("/:accountId") (cyclomatic 18) REDACTED:182— ccrAccounts.router.put("/:accountId") 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.
azureOpenaiAccounts.router.post("/azure-openai-accounts") (cyclomatic 18) REDACTED:106— azureOpenaiAccounts.router.post("/azure-openai-accounts") 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.
grokAccounts.router.post("/grok-accounts/:accountId/test") (cyclomatic 18) REDACTED:412— grokAccounts.router.post("/grok-accounts/:accountId/test") 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.
QuotaCardService.createCard (cyclomatic 18) src/services/quotaCardService.js:88— QuotaCardService.createCard has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
web.router.post("/auth/change-password") (cyclomatic 18) src/routes/web.js:137— web.router.post("/auth/change-password") 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.
DroidRelayService._parseAnthropicUsageFromSSE (cyclomatic 18) src/services/relay/droidRelayService.js:706— DroidRelayService._parseAnthropicUsageFromSSE 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.
RateLimitCleanupService.cleanupClaudeAccounts (cyclomatic 18) src/services/rateLimitCleanupService.js:211— RateLimitCleanupService.cleanupClaudeAccounts 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.
request::attemptRequest (cyclomatic 18) src/services/antigravityClient.js:366— request::attemptRequest 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.
handleChatCompletion::usageCallback (cyclomatic 18) REDACTED:280— handleChatCompletion::usageCallback has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
getUsageStats::handleLegacyData (cyclomatic 18) REDACTED:1720— getUsageStats::handleLegacyData has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_handleStreamRequest::(anonymous)::handleStreamError (cyclomatic 18) src/services/relay/droidRelayService.js:464— _handleStreamRequest::(anonymous)::handleStreamError 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.
_handleBedrockError (cyclomatic 18) src/services/relay/bedrockRelayService.js:762— _handleBedrockError 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.
setAccountRateLimited (cyclomatic 18) REDACTED:942— setAccountRateLimited 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.
ClaudeAccountService.updateSessionWindow (cyclomatic 17) src/services/account/claudeAccountService.js:1874— ClaudeAccountService.updateSessionWindow 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.
azureOpenaiAccountService.updateAccount (cyclomatic 17) src/services/account/azureOpenaiAccountService.js:205— azureOpenaiAccountService.updateAccount 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.
azureOpenaiAccountService.selectAvailableAccount (cyclomatic 17) src/services/account/azureOpenaiAccountService.js:386— azureOpenaiAccountService.selectAvailableAccount has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CcrAccountService.getAllAccounts (cyclomatic 17) src/services/account/ccrAccountService.js:134— CcrAccountService.getAllAccounts has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
grokQuota.formatWindow (cyclomatic 17) src/utils/grokQuota.js:351— grokQuota.formatWindow has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CostCalculator.buildDetailedPricingResult (cyclomatic 17) src/utils/costCalculator.js:144— CostCalculator.buildDetailedPricingResult has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RedisClient._parseApiKeyData (cyclomatic 17) REDACTED:768— RedisClient._parseApiKeyData 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.
RedisClient.incrementTokenUsage (cyclomatic 17) REDACTED:1068— RedisClient.incrementTokenUsage 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.
RedisClient.getAccountDailyCostFallback (cyclomatic 17) REDACTED:2114— RedisClient.getAccountDailyCostFallback has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
data-transfer-enhanced.sanitizeData (cyclomatic 17) scripts/data-transfer-enhanced.js:421— data-transfer-enhanced.sanitizeData 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.
reset-request-detail-retention-hours.resetRequestDetailRetentionHours (cyclomatic 17) scripts/reset-request-detail-retention-hours.js:58— reset-request-detail-retention-hours.resetRequestDetailRetentionHours 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.
ClaudeRelayService._createTestStreamTransformer (cyclomatic 17) src/services/relay/claudeRelayService.js:3380— ClaudeRelayService._createTestStreamTransformer has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 3383). 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.
ClaudeConsoleRelayService._createTestStreamTransformer (cyclomatic 17) src/services/relay/claudeConsoleRelayService.js:1399— ClaudeConsoleRelayService._createTestStreamTransformer has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 1402). 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.
geminiHandlers.handleRetrieveUserQuota (cyclomatic 17) REDACTED:1340— geminiHandlers.handleRetrieveUserQuota 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.
apiKeys.router.post("/api-keys/batch") (cyclomatic 17) REDACTED:1736— apiKeys.router.post("/api-keys/batch") has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
oauthHelper.getOrganizationInfo (cyclomatic 17) src/utils/oauthHelper.js:614— oauthHelper.getOrganizationInfo 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.
claudeAccounts.router.get("/claude-accounts/usage") (cyclomatic 17) src/routes/admin/claudeAccounts.js:536— claudeAccounts.router.get("/claude-accounts/usage") has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 543, 592). 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.
geminiAccounts.router.put("/:accountId") (cyclomatic 17) src/routes/admin/geminiAccounts.js:301— geminiAccounts.router.put("/:accountId") 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.
openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") (cyclomatic 17) REDACTED:459— openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BalanceScriptService.mapExtractorResult (cyclomatic 17) src/services/balanceScriptService.js:177— BalanceScriptService.mapExtractorResult 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.
system.router.get("/check-updates") (cyclomatic 17) src/routes/admin/system.js:93— system.router.get("/check-updates") 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.
apiStats.router.post("/api/redeem-card") (cyclomatic 17) REDACTED:1529— apiStats.router.post("/api/redeem-card") has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DroidRelayService._handleUpstreamClientError (cyclomatic 17) src/services/relay/droidRelayService.js:1361— DroidRelayService._handleUpstreamClientError 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.
userRoutes.router.post("/login") (cyclomatic 17) REDACTED:52— userRoutes.router.post("/login") has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GeminiBalanceProvider.queryBalance (cyclomatic 17) src/services/balanceProviders/geminiBalanceProvider.js:191— GeminiBalanceProvider.queryBalance 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.
index.router.beforeEach() (cyclomatic 17) web/admin-spa/src/router/index.js:188— index.router.beforeEach() 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.
queryWithIndex (cyclomatic 17) src/services/apiKeyIndexService.js:432— queryWithIndex has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 4 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.
migrateAlltimeModelStats (cyclomatic 17) REDACTED:379— migrateAlltimeModelStats 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.
handleGeminiUpstreamError (cyclomatic 17) REDACTED:27— handleGeminiUpstreamError 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.
handleStreamResponse::(anonymous)::parseSSEForUsage (cyclomatic 17) src/services/relay/azureOpenaiRelayService.js:322— handleStreamResponse::(anonymous)::parseSSEForUsage 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.
ApiKeyIndexService.addToIndex (cyclomatic 16) src/services/apiKeyIndexService.js:255— ApiKeyIndexService.addToIndex has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClaudeAccountService.updateClaudeUsageSnapshot (cyclomatic 16) src/services/account/claudeAccountService.js:2259— ClaudeAccountService.updateClaudeUsageSnapshot 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.
geminiAccountService.refreshAccountToken (cyclomatic 16) REDACTED:996— geminiAccountService.refreshAccountToken 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.
openaiAccountService.getAllAccounts (cyclomatic 16) REDACTED:682— openaiAccountService.getAllAccounts 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.
grokHelper.isBlockedIPv4 (cyclomatic 16) src/utils/grokHelper.js:185— grokHelper.isBlockedIPv4 has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RedisClient.getAccountDailyCost (cyclomatic 16) REDACTED:1959— RedisClient.getAccountDailyCost has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RequestDetailService._resolveAccountInfo (cyclomatic 16) src/services/requestDetailService.js:928— RequestDetailService._resolveAccountInfo has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
geminiHandlers.normalizeAxiosStreamError (cyclomatic 16) REDACTED:322— geminiHandlers.normalizeAxiosStreamError has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GrokRelayService._handleStreamResponse (cyclomatic 16) REDACTED:248— GrokRelayService._handleStreamResponse 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 275, 267, 307, …). 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.
apiKeys.router.post("/api-keys/batch-last-usage") (cyclomatic 16) REDACTED:1383— apiKeys.router.post("/api-keys/batch-last-usage") has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1411). 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.
bedrockAccounts.router.post("/") (cyclomatic 16) src/routes/admin/bedrockAccounts.js:118— bedrockAccounts.router.post("/") has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") (cyclomatic 16) REDACTED:192— openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") 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.
workosOAuthHelper.pollDeviceAuthorization (cyclomatic 16) src/utils/workosOAuthHelper.js:104— workosOAuthHelper.pollDeviceAuthorization 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.
droidAccounts.router.post("/droid-accounts") (cyclomatic 16) src/routes/admin/droidAccounts.js:293— droidAccounts.router.post("/droid-accounts") has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
droidAccounts.router.get("/droid-accounts/:id") (cyclomatic 16) src/routes/admin/droidAccounts.js:479— droidAccounts.router.get("/droid-accounts/:id") has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 552, 517). 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.
AccountBalanceService._getBalanceFromScript (cyclomatic 16) src/services/account/accountBalanceService.js:439— AccountBalanceService._getBalanceFromScript has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LdapService.extractDN (cyclomatic 16) src/services/ldapService.js:58— LdapService.extractDN has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LdapService.extractUserInfo (cyclomatic 16) src/services/ldapService.js:445— LdapService.extractUserInfo has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
userRoutes.router.get("/quota-info") (cyclomatic 16) REDACTED:848— userRoutes.router.get("/quota-info") has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RateLimitCleanupService.cleanupClaudeConsoleAccounts (cyclomatic 16) src/services/rateLimitCleanupService.js:306— RateLimitCleanupService.cleanupClaudeConsoleAccounts 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.
unstableUpstreamHelper.normalizeErrorPayload (cyclomatic 16) src/utils/unstableUpstreamHelper.js:17— unstableUpstreamHelper.normalizeErrorPayload has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
getAllTempUnavailable (cyclomatic 16) src/utils/upstreamErrorHelper.js:429— getAllTempUnavailable 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.
headerValue (cyclomatic 16) src/utils/grokQuota.js:55— headerValue has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
handleMessagesRequest (cognitive 406) REDACTED:137— handleMessagesRequest has cognitive complexity 406 (threshold 15). Drivers by points: if/else 102 (256 pts), boolean chains 89, error handling 15 (43 pts), ternaries 8 (18 pts) (nesting depth added 192). Of this number, 282 points are the body's own statements and 124 belong to 17 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.
anthropicGeminiBridgeService.handleAnthropicMessagesToGemini (cognitive 321) src/services/anthropicGeminiBridgeService.js:1859— anthropicGeminiBridgeService.handleAnthropicMessagesToGemini has cognitive complexity 321 (threshold 15). Drivers by points: if/else 101 (186 pts), boolean chains 70, ternaries 21 (41 pts), error handling 10 (19 pts), loops 4 (5 pts) (nesting depth added 115). Of this number, 105 points are the body's own statements and 216 belong to 16 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.
ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320) src/services/relay/claudeRelayService.js:2154— ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture has cognitive complexity 320 (threshold 15). Drivers by points: if/else 101 (207 pts), boolean chains 58, error handling 14 (42 pts), ternaries 4 (12 pts), loops 1 (nesting depth added 142). Most of this is not in the body itself: 1 of the 320 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 2216, 2712, 2857, …). 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.
_makeClaudeConsoleStreamRequest (cognitive 302) src/services/relay/claudeConsoleRelayService.js:744— _makeClaudeConsoleStreamRequest has cognitive complexity 302 (threshold 15). Drivers by points: if/else 76 (184 pts), error handling 15 (51 pts), boolean chains 41, ternaries 9 (24 pts), loops 1 (2 pts) (nesting depth added 160). Most of this is not in the body itself: 0 of the 302 points are its own statements and the rest belongs to 22 function items inside it that branch ((anonymous)::(anonymous)::(anonymous), (anonymous)::(anonymous)::(anonymous), (anonymous)::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
data-transfer-enhanced.importData (cognitive 254) scripts/data-transfer-enhanced.js:835— data-transfer-enhanced.importData has cognitive complexity 254 (threshold 15). Drivers by points: if/else 54 (137 pts), loops 23 (76 pts), error handling 6 (15 pts), ternaries 6 (15 pts), boolean chains 11 (nesting depth added 154). 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.
(anonymous) (cognitive 247) REDACTED:1247— (anonymous) has cognitive complexity 247 (threshold 15). Drivers by points: if/else 38 (115 pts), boolean chains 62, loops 17 (41 pts), ternaries 12 (28 pts), error handling 1 (nesting depth added 117). Of this number, 211 points are the body's own statements and 36 belong to 19 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.
relayRequest (cognitive 225) src/services/relay/claudeRelayService.js:480— relayRequest has cognitive complexity 225 (threshold 15). Drivers by points: if/else 59 (116 pts), error handling 15 (42 pts), ternaries 14 (33 pts), boolean chains 31, loops 2, other 1 (nesting depth added 103). Of this number, 210 points are the body's own statements and 15 belong to 12 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.
usageStats.router.get("/account-usage-trend") (cognitive 221) REDACTED:1247— usageStats.router.get("/account-usage-trend") has cognitive complexity 221 (threshold 15). Drivers by points: if/else 38 (115 pts), boolean chains 62, loops 17 (41 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 102). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
authenticateApiKey (cognitive 214) REDACTED:440— authenticateApiKey has cognitive complexity 214 (threshold 15). Drivers by points: if/else 51 (117 pts), error handling 16 (54 pts), boolean chains 41, ternaries 1 (2 pts) (nesting depth added 105). Of this number, 183 points are the body's own statements and 31 belong to 19 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.
handleResponses (cognitive 205) REDACTED:293— handleResponses has cognitive complexity 205 (threshold 15). Drivers by points: if/else 69 (102 pts), boolean chains 50, error handling 12 (24 pts), ternaries 11 (24 pts), loops 4 (5 pts) (nesting depth added 59). Of this number, 167 points are the body's own statements and 38 belong to 10 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.
anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents (cognitive 198) src/services/anthropicGeminiBridgeService.js:1026— anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents has cognitive complexity 198 (threshold 15). Drivers by points: if/else 27 (112 pts), ternaries 10 (55 pts), boolean chains 21, error handling 1 (6 pts), loops 2 (4 pts) (nesting depth added 137). 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.
data-transfer-enhanced.exportData (cognitive 196) scripts/data-transfer-enhanced.js:478— data-transfer-enhanced.exportData has cognitive complexity 196 (threshold 15). Drivers by points: if/else 40 (126 pts), boolean chains 20, ternaries 7 (19 pts), loops 9 (18 pts), error handling 3 (13 pts) (nesting depth added 117). 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.
usageStats.router.get("/api-keys-usage-trend") (cognitive 194) REDACTED:1825— usageStats.router.get("/api-keys-usage-trend") has cognitive complexity 194 (threshold 15). Drivers by points: if/else 32 (105 pts), boolean chains 51, loops 16 (37 pts), error handling 1 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_getAllAvailableAccounts (cognitive 194) src/services/scheduler/unifiedClaudeScheduler.js:515— _getAllAvailableAccounts has cognitive complexity 194 (threshold 15). Drivers by points: if/else 59 (143 pts), boolean chains 33, loops 5 (8 pts), error handling 2 (6 pts), ternaries 1 (4 pts) (nesting depth added 94). 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.
(anonymous) (cognitive 194) REDACTED:1825— (anonymous) has cognitive complexity 194 (threshold 15). Drivers by points: if/else 32 (105 pts), boolean chains 51, loops 16 (37 pts), error handling 1 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleRequest (cognitive 188) REDACTED:68— handleRequest has cognitive complexity 188 (threshold 15). Drivers by points: if/else 37 (88 pts), error handling 13 (49 pts), boolean chains 34, ternaries 5 (13 pts), loops 1 (4 pts) (nesting depth added 98). Of this number, 186 points are the body's own statements and 2 belong to 11 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.
updateAccount (cognitive 178) REDACTED:836— updateAccount has cognitive complexity 178 (threshold 15). Drivers by points: if/else 57 (89 pts), ternaries 19 (43 pts), boolean chains 38, error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 60). Of this number, 170 points are the body's own statements and 8 belong to 3 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.
apiStats.router.post("/api/user-stats") (cognitive 165) REDACTED:101— apiStats.router.post("/api/user-stats") has cognitive complexity 165 (threshold 15). Drivers by points: boolean chains 79, if/else 31 (63 pts), error handling 8 (12 pts), ternaries 6 (7 pts), loops 2 (4 pts) (nesting depth added 39). Of this number, 151 points are the body's own statements and 14 belong to 3 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.
dashboard.useDashboardStore (cognitive 165) web/admin-spa/src/stores/dashboard.js:7— dashboard.useDashboardStore has cognitive complexity 165 (threshold 15). Drivers by points: if/else 65 (86 pts), boolean chains 65, error handling 7, ternaries 5 (6 pts), match/switch 1 (nesting depth added 22). Of this number, 154 points are the body's own statements and 11 belong to 6 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, 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.
(anonymous) (cognitive 161) REDACTED:101— (anonymous) has cognitive complexity 161 (threshold 15). Drivers by points: boolean chains 72, if/else 31 (63 pts), error handling 8 (12 pts), ternaries 8 (10 pts), loops 2 (4 pts) (nesting depth added 40). Of this number, 148 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createAccount (cognitive 159) REDACTED:458— createAccount has cognitive complexity 159 (threshold 15). Drivers by points: if/else 32 (69 pts), boolean chains 54, ternaries 17 (29 pts), error handling 4 (7 pts) (nesting depth added 52). Of this number, 158 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.
usageStats.router.get("/usage-trend") (cognitive 157) REDACTED:539— usageStats.router.get("/usage-trend") has cognitive complexity 157 (threshold 15). Drivers by points: if/else 27 (85 pts), boolean chains 41, loops 12 (30 pts), error handling 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 155) REDACTED:192— (anonymous) has cognitive complexity 155 (threshold 15). Drivers by points: if/else 39 (83 pts), boolean chains 35, error handling 8 (19 pts), ternaries 5 (16 pts), loops 1 (2 pts) (nesting depth added 67). Of this number, 70 points are the body's own statements and 85 belong to 4 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.
openaiGeminiRoutes.router.post("/v1/chat/completions") (cognitive 153) REDACTED:192— openaiGeminiRoutes.router.post("/v1/chat/completions") has cognitive complexity 153 (threshold 15). Drivers by points: if/else 39 (83 pts), boolean chains 35, error handling 8 (19 pts), ternaries 4 (14 pts), loops 1 (2 pts) (nesting depth added 66). Of this number, 68 points are the body's own statements and 85 belong to 4 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.
relayRequest (cognitive 151) src/services/relay/claudeConsoleRelayService.js:23— relayRequest has cognitive complexity 151 (threshold 15). Drivers by points: if/else 42 (56 pts), ternaries 22 (50 pts), error handling 11 (26 pts), boolean chains 19 (nesting depth added 57). Of this number, 149 points are the body's own statements and 2 belong to 7 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.
(anonymous) (cognitive 145) REDACTED:539— (anonymous) has cognitive complexity 145 (threshold 15). Drivers by points: if/else 27 (85 pts), loops 12 (30 pts), boolean chains 29, error handling 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sanitizeMaxTokens (cognitive 142) REDACTED:944— sanitizeMaxTokens has cognitive complexity 142 (threshold 15). Drivers by points: if/else 49 (72 pts), boolean chains 43, error handling 15 (20 pts), ternaries 2 (4 pts), loops 3 (nesting depth added 30). Most of this is not in the body itself: 1 of the 142 points is its own statement and the rest belongs to 23 function items inside it that branch ((anonymous), (anonymous), (anonymous)::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cognitive 142) REDACTED:2108— (anonymous) has cognitive complexity 142 (threshold 15). Drivers by points: if/else 64 (96 pts), boolean chains 40, error handling 3 (6 pts) (nesting depth added 35). Of this number, 139 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.
_getAllAvailableAccounts (cognitive 137) src/services/scheduler/unifiedGeminiScheduler.js:224— _getAllAvailableAccounts has cognitive complexity 137 (threshold 15). Drivers by points: if/else 29 (96 pts), boolean chains 27, ternaries 5 (11 pts), loops 2 (3 pts) (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
(anonymous) (cognitive 135) REDACTED:2708— (anonymous) has cognitive complexity 135 (threshold 15). Drivers by points: boolean chains 59, if/else 28 (47 pts), ternaries 16 (19 pts), loops 5 (6 pts), error handling 2 (3 pts), other 1 (nesting depth added 24). Of this number, 98 points are the body's own statements and 37 belong to 15 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.
apiKeys.router.put("/api-keys/:keyId") (cognitive 131) REDACTED:2108— apiKeys.router.put("/api-keys/:keyId") has cognitive complexity 131 (threshold 15). Drivers by points: if/else 64 (96 pts), boolean chains 29, error handling 3 (6 pts) (nesting depth added 35). Of this number, 129 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.
buildGeminiRequestFromOpenAI (cognitive 128) src/routes/unified.js:557— buildGeminiRequestFromOpenAI has cognitive complexity 128 (threshold 15). Drivers by points: if/else 47 (79 pts), boolean chains 17, ternaries 3 (12 pts), loops 5 (11 pts), error handling 2 (9 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 128) REDACTED:3066— (anonymous) has cognitive complexity 128 (threshold 15). Drivers by points: boolean chains 52, if/else 18 (45 pts), ternaries 16 (19 pts), loops 5 (8 pts), error handling 2 (3 pts), other 1 (nesting depth added 34). Of this number, 104 points are the body's own statements and 24 belong to 6 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.
(anonymous) (cognitive 126) src/routes/admin/sync.js:93— (anonymous) has cognitive complexity 126 (threshold 15). Drivers by points: boolean chains 60, if/else 23 (38 pts), ternaries 10 (13 pts), error handling 6 (12 pts), loops 3 (nesting depth added 24). Of this number, 75 points are the body's own statements and 51 belong to one function literal inside it that branches. 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.
sync.router.get("/sync/export-accounts") (cognitive 124) src/routes/admin/sync.js:93— sync.router.get("/sync/export-accounts") has cognitive complexity 124 (threshold 15). Drivers by points: boolean chains 59, if/else 23 (38 pts), error handling 6 (12 pts), ternaries 9 (12 pts), loops 3 (nesting depth added 24). Of this number, 74 points are the body's own statements and 50 belong to one function literal inside it that branches. 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.
geminiHandlers.handleStandardStreamGenerateContent (cognitive 121) REDACTED:2506— geminiHandlers.handleStandardStreamGenerateContent has cognitive complexity 121 (threshold 15). Drivers by points: if/else 48 (70 pts), boolean chains 27, error handling 8 (15 pts), ternaries 5 (8 pts), loops 1 (nesting depth added 32). Of this number, 73 points are the body's own statements and 48 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.
openaiRoutes.handleImages (cognitive 121) REDACTED:971— openaiRoutes.handleImages has cognitive complexity 121 (threshold 15). Drivers by points: if/else 33 (52 pts), boolean chains 33, ternaries 8 (21 pts), error handling 7 (14 pts), loops 1 (nesting depth added 39). Of this number, 78 points are the body's own statements and 43 belong to 4 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.
relayRequest (cognitive 117) src/services/relay/ccrRelayService.js:16— relayRequest has cognitive complexity 117 (threshold 15). Drivers by points: if/else 35 (49 pts), ternaries 11 (24 pts), error handling 9 (23 pts), boolean chains 21 (nesting depth added 41). Of this number, 115 points are the body's own statements and 2 belong to 8 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.
handleMessages (cognitive 116) REDACTED:395— handleMessages has cognitive complexity 116 (threshold 15). Drivers by points: if/else 29 (59 pts), boolean chains 25, error handling 7 (20 pts), loops 2 (6 pts), ternaries 3 (6 pts) (nesting depth added 50). Of this number, 64 points are the body's own statements and 52 belong to 7 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.
azureOpenaiRelayService.handleStreamResponse (cognitive 112) src/services/relay/azureOpenaiRelayService.js:270— azureOpenaiRelayService.handleStreamResponse has cognitive complexity 112 (threshold 15). Drivers by points: if/else 41 (84 pts), boolean chains 11, error handling 5 (8 pts), loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 51). Most of this is not in the body itself: 1 of the 112 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 322, 470, 408, …). 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.
apistats.useApiStatsStore (cognitive 111) web/admin-spa/src/stores/apistats.js:6— apistats.useApiStatsStore has cognitive complexity 111 (threshold 15). Drivers by points: if/else 50 (53 pts), boolean chains 46, error handling 9, ternaries 3 (nesting depth added 3). Of this number, 80 points are the body's own statements and 31 belong to 5 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, 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.
backfillCurrentWeekClaudeCosts (cognitive 111) src/services/weeklyClaudeCostInitService.js:69— backfillCurrentWeekClaudeCosts has cognitive complexity 111 (threshold 15). Drivers by points: if/else 17 (53 pts), loops 12 (26 pts), boolean chains 17, ternaries 2 (8 pts), error handling 3 (6 pts), other 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 109) web/admin-spa/src/stores/apistats.js:6— (anonymous) has cognitive complexity 109 (threshold 15). Drivers by points: if/else 50 (53 pts), boolean chains 41, error handling 9, ternaries 6 (nesting depth added 3). Most of this is not in the body itself: 0 of the 109 points are its own statements and the rest belongs to 27 function items inside it that branch ((anonymous), queryStats, switchPeriod, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
usageStats.router.get("/usage-costs") (cognitive 107) REDACTED:2286— usageStats.router.get("/usage-costs") has cognitive complexity 107 (threshold 15). Drivers by points: if/else 24 (56 pts), boolean chains 33, loops 7 (16 pts), error handling 1, ternaries 1 (nesting depth added 41). Of this number, 103 points are the body's own statements and 4 belong to one function literal inside it that branches. 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.
cleanJsonSchemaForGemini (cognitive 107) src/utils/geminiSchemaCleaner.js:87— cleanJsonSchemaForGemini has cognitive complexity 107 (threshold 15). Drivers by points: if/else 32 (55 pts), boolean chains 33, ternaries 7 (10 pts), loops 4 (9 pts) (nesting depth added 31). Of this number, 104 points are the body's own statements and 3 belong to 4 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.
_makeCcrStreamRequest (cognitive 107) src/services/relay/ccrRelayService.js:561— _makeCcrStreamRequest has cognitive complexity 107 (threshold 15). Drivers by points: if/else 36 (60 pts), error handling 9 (25 pts), boolean chains 15, ternaries 3 (6 pts), loops 1 (nesting depth added 43). Most of this is not in the body itself: 0 of the 107 points are its own statements and the rest belongs to 19 function items inside it that branch ((anonymous)::(anonymous), (anonymous)::(anonymous)::(anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cognitive 106) REDACTED:933— (anonymous) has cognitive complexity 106 (threshold 15). Drivers by points: if/else 27 (61 pts), boolean chains 28, loops 6 (12 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 42). 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.
apiKeys.router.put("/api-keys/batch") (cognitive 102) REDACTED:1882— apiKeys.router.put("/api-keys/batch") has cognitive complexity 102 (threshold 15). Drivers by points: if/else 40 (79 pts), boolean chains 8, error handling 3 (6 pts), match/switch 1 (4 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 48). Of this number, 94 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 102) REDACTED:1882— (anonymous) has cognitive complexity 102 (threshold 15). Drivers by points: if/else 40 (79 pts), boolean chains 8, error handling 3 (6 pts), match/switch 1 (4 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 48). Of this number, 94 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
antigravityClient.request (cognitive 101) src/services/antigravityClient.js:259— antigravityClient.request has cognitive complexity 101 (threshold 15). Drivers by points: if/else 23 (51 pts), error handling 6 (17 pts), boolean chains 16, ternaries 5 (12 pts), loops 3 (5 pts) (nesting depth added 48). Of this number, 20 points are the body's own statements and 81 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiKeyService.getAllApiKeysFast (cognitive 101) src/services/apiKeyService.js:1052— ApiKeyService.getAllApiKeysFast has cognitive complexity 101 (threshold 15). Drivers by points: boolean chains 54, if/else 22 (34 pts), error handling 4 (10 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 19). 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.
selectAccountForApiKey (cognitive 100) src/services/scheduler/unifiedOpenAIScheduler.js:122— selectAccountForApiKey has cognitive complexity 100 (threshold 15). Drivers by points: if/else 31 (78 pts), ternaries 3 (15 pts), boolean chains 6, error handling 1 (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
(anonymous) (cognitive 97) REDACTED:2286— (anonymous) has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (56 pts), boolean chains 23, loops 7 (16 pts), error handling 1, ternaries 1 (nesting depth added 41). Of this number, 93 points are the body's own statements and 4 belong to 6 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.
WebhookConfigService.validatePlatformConfig (cognitive 96) src/services/webhookConfigService.js:109— WebhookConfigService.validatePlatformConfig has cognitive complexity 96 (threshold 15). Drivers by points: if/else 33 (76 pts), boolean chains 9, ternaries 3 (8 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 49). 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.
data-transfer.importData (cognitive 95) scripts/data-transfer.js:449— data-transfer.importData has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 6 (15 pts), error handling 4 (10 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 49). 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.
api.router.post("/v1/messages/count_tokens") (cognitive 94) REDACTED:1673— api.router.post("/v1/messages/count_tokens") has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (67 pts), boolean chains 12, error handling 4 (10 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 47). Of this number, 79 points are the body's own statements and 15 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.
(anonymous) (cognitive 94) REDACTED:1673— (anonymous) has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (67 pts), boolean chains 12, error handling 4 (10 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 47). Of this number, 79 points are the body's own statements and 15 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.
fix-usage-stats.fixUsageStats (cognitive 92) scripts/fix-usage-stats.js:23— fix-usage-stats.fixUsageStats has cognitive complexity 92 (threshold 15). Drivers by points: if/else 16 (43 pts), boolean chains 28, error handling 5 (10 pts), loops 6 (8 pts), ternaries 1 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedClaudeScheduler._isModelSupportedByAccount (cognitive 92) src/services/scheduler/unifiedClaudeScheduler.js:49— UnifiedClaudeScheduler._isModelSupportedByAccount has cognitive complexity 92 (threshold 15). Drivers by points: if/else 18 (42 pts), ternaries 9 (39 pts), boolean chains 7, error handling 1 (4 pts) (nesting depth added 57). 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.
handleStreamGenerateContent (cognitive 91) REDACTED:1806— handleStreamGenerateContent has cognitive complexity 91 (threshold 15). Drivers by points: if/else 28 (37 pts), ternaries 10 (21 pts), boolean chains 20, error handling 7 (12 pts), loops 1 (nesting depth added 25). Of this number, 46 points are the body's own statements and 45 belong to 9 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.
anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools (cognitive 88) src/services/anthropicGeminiBridgeService.js:773— anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools has cognitive complexity 88 (threshold 15). Drivers by points: if/else 31 (62 pts), boolean chains 18, loops 2 (5 pts), ternaries 3 (nesting depth added 34). Most of this is not in the body itself: 3 of the 88 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 779, 910, 811, …). 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.
recordUsageWithDetails (cognitive 87) src/services/apiKeyService.js:1862— recordUsageWithDetails has cognitive complexity 87 (threshold 15). Drivers by points: boolean chains 48, if/else 16 (24 pts), other 8, error handling 5 (6 pts), ternaries 1 (nesting depth added 9). 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.
selectAccountForApiKey (cognitive 87) src/services/scheduler/unifiedClaudeScheduler.js:180— selectAccountForApiKey has cognitive complexity 87 (threshold 15). Drivers by points: if/else 39 (74 pts), boolean chains 11, error handling 1, ternaries 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.
UnifiedClaudeScheduler.selectAccountFromGroup (cognitive 86) src/services/scheduler/unifiedClaudeScheduler.js:1529— UnifiedClaudeScheduler.selectAccountFromGroup has cognitive complexity 86 (threshold 15). Drivers by points: if/else 27 (70 pts), boolean chains 7, ternaries 3 (7 pts), error handling 1, loops 1 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
handleRequest (cognitive 85) REDACTED:43— handleRequest has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (39 pts), error handling 7 (24 pts), boolean chains 16, ternaries 3 (6 pts) (nesting depth added 39). Of this number, 83 points are the body's own statements and 2 belong to 9 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.
BedrockRelayService.handleStreamRequest (cognitive 83) src/services/relay/bedrockRelayService.js:243— BedrockRelayService.handleStreamRequest has cognitive complexity 83 (threshold 15). Drivers by points: if/else 20 (42 pts), ternaries 8 (23 pts), boolean chains 10, error handling 4 (7 pts), loops 1 (nesting depth added 40). Of this number, 80 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
apiKeys.calculateKeyStats (cognitive 83) REDACTED:1073— apiKeys.calculateKeyStats has cognitive complexity 83 (threshold 15). Drivers by points: if/else 27 (47 pts), boolean chains 25, loops 7 (10 pts), error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedClaudeScheduler._isAccountAvailable (cognitive 82) src/services/scheduler/unifiedClaudeScheduler.js:1047— UnifiedClaudeScheduler._isAccountAvailable has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (70 pts), boolean chains 7, error handling 3 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openaiClaudeRoutes.handleChatCompletion (cognitive 81) REDACTED:186— openaiClaudeRoutes.handleChatCompletion has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 33, error handling 3 (4 pts) (nesting depth added 21). Of this number, 52 points are the body's own statements and 29 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.
updateAccount (cognitive 81) src/services/account/claudeAccountService.js:740— updateAccount has cognitive complexity 81 (threshold 15). Drivers by points: if/else 23 (40 pts), ternaries 7 (28 pts), boolean chains 9, error handling 2 (3 pts), loops 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
(anonymous) (cognitive 81) REDACTED:1472— (anonymous) has cognitive complexity 81 (threshold 15). Drivers by points: boolean chains 40, if/else 28 (33 pts), ternaries 5 (7 pts), error handling 1 (nesting depth added 7). Of this number, 80 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
data-transfer.exportData (cognitive 76) scripts/data-transfer.js:276— data-transfer.exportData has cognitive complexity 76 (threshold 15). Drivers by points: if/else 18 (33 pts), ternaries 7 (19 pts), boolean chains 10, loops 4 (8 pts), error handling 2 (6 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
backfillSingleKey (cognitive 75) src/services/weeklyClaudeCostInitService.js:309— backfillSingleKey has cognitive complexity 75 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 16, loops 5 (11 pts), ternaries 2 (8 pts), error handling 3 (7 pts), other 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeRelayService.relayStreamRequestWithUsageCapture (cognitive 74) src/services/relay/claudeRelayService.js:1883— ClaudeRelayService.relayStreamRequestWithUsageCapture has cognitive complexity 74 (threshold 15). Drivers by points: if/else 18 (31 pts), ternaries 9 (25 pts), boolean chains 12, error handling 4 (6 pts) (nesting depth added 31). Of this number, 68 points are the body's own statements and 6 belong to 2 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.
convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations (cognitive 74) src/services/anthropicGeminiBridgeService.js:779— convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations has cognitive complexity 74 (threshold 15). Drivers by points: if/else 27 (58 pts), boolean chains 11, loops 2 (5 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedOpenAIScheduler._getAllAvailableAccounts (cognitive 73) src/services/scheduler/unifiedOpenAIScheduler.js:356— UnifiedOpenAIScheduler._getAllAvailableAccounts has cognitive complexity 73 (threshold 15). Drivers by points: if/else 18 (54 pts), boolean chains 13, error handling 1 (4 pts), loops 2 (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.
apiKeys.router.post("/api-keys") (cognitive 72) REDACTED:1472— apiKeys.router.post("/api-keys") has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (33 pts), boolean chains 31, ternaries 5 (7 pts), error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DroidRelayService._handleStreamRequest (cognitive 72) src/services/relay/droidRelayService.js:415— DroidRelayService._handleStreamRequest has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (52 pts), boolean chains 20 (nesting depth added 24). Most of this is not in the body itself: 0 of the 72 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 464, 542, 622, …). 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.
(anonymous) (cognitive 72) src/routes/admin/claudeRelayConfig.js:38— (anonymous) has cognitive complexity 72 (threshold 15). Drivers by points: if/else 40 (49 pts), boolean chains 17, error handling 2 (3 pts), ternaries 1 (2 pts), other 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.
claudeRelayConfig.router.put("/claude-relay-config") (cognitive 71) src/routes/admin/claudeRelayConfig.js:38— claudeRelayConfig.router.put("/claude-relay-config") has cognitive complexity 71 (threshold 15). Drivers by points: if/else 40 (49 pts), boolean chains 17, error handling 2 (3 pts), ternaries 1 (2 pts) (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.
relayStreamRequestWithUsageCapture (cognitive 71) src/services/relay/ccrRelayService.js:373— relayStreamRequestWithUsageCapture has cognitive complexity 71 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 7 (22 pts), boolean chains 13, error handling 4 (10 pts) (nesting depth added 33). Of this number, 67 points are the body's own statements and 4 belong to 2 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.
buildRequestFromOpenAI (cognitive 70) src/services/codexToOpenAI.js:393— buildRequestFromOpenAI has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 6 (13 pts), boolean chains 10, ternaries 2 (9 pts), match/switch 1 (2 pts), other 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openaiAccounts.router.put("/:id") (cognitive 69) src/routes/admin/openaiAccounts.js:479— openaiAccounts.router.put("/:id") has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (50 pts), boolean chains 14, error handling 3 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
relayStreamRequestWithUsageCapture (cognitive 68) src/services/relay/claudeConsoleRelayService.js:491— relayStreamRequestWithUsageCapture has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 7 (22 pts), boolean chains 13, error handling 5 (9 pts) (nesting depth added 27). Of this number, 62 points are the body's own statements and 6 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.
webhook.router.post("/test") (cognitive 67) src/routes/webhook.js:116— webhook.router.post("/test") has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (40 pts), error handling 5 (12 pts), ternaries 5 (10 pts), boolean chains 5 (nesting depth added 27). Of this number, 61 points are the body's own statements and 6 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.
(anonymous) (cognitive 66) src/routes/webhook.js:116— (anonymous) has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (40 pts), error handling 5 (12 pts), ternaries 5 (10 pts), boolean chains 4 (nesting depth added 27). Of this number, 60 points are the body's own statements and 6 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.
ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts (cognitive 65) src/services/account/claudeAccountService.js:3275— ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (41 pts), error handling 3 (9 pts), ternaries 2 (8 pts), boolean chains 6, loops 1 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
data-transfer-enhanced.importUsageStats (cognitive 65) scripts/data-transfer-enhanced.js:299— data-transfer-enhanced.importUsageStats has cognitive complexity 65 (threshold 15). Drivers by points: loops 16 (45 pts), if/else 14 (18 pts), boolean chains 1, error handling 1 (nesting depth added 33). 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.
geminiHandlers.handleStandardGenerateContent (cognitive 65) REDACTED:2212— geminiHandlers.handleStandardGenerateContent has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 16, error handling 4 (8 pts), ternaries 3 (6 pts) (nesting depth added 19). Of this number, 64 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.
(anonymous) (cognitive 65) src/routes/admin/openaiAccounts.js:479— (anonymous) has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (50 pts), boolean chains 8, error handling 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAIResponsesRelayService._handleStreamResponse (cognitive 64) REDACTED:476— OpenAIResponsesRelayService._handleStreamResponse has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 11, error handling 4 (7 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 28). Most of this is not in the body itself: 0 of the 64 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 499, 584, 556, …). 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.
initialize (cognitive 64) src/app.js:50— initialize has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (38 pts), error handling 12 (17 pts), boolean chains 9 (nesting depth added 17). Of this number, 23 points are the body's own statements and 41 belong to 16 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.
calculateCost (cognitive 64) src/services/pricingService.js:513— calculateCost has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 31, if/else 15 (19 pts), ternaries 10 (14 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ApiKeyService.getAllApiKeys (cognitive 63) src/services/apiKeyService.js:867— ApiKeyService.getAllApiKeys has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 27, if/else 14 (26 pts), error handling 5 (9 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionHelper.generateSessionHash (cognitive 63) src/utils/sessionHelper.js:12— SessionHelper.generateSessionHash has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 12, loops 4 (9 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
refreshAccountToken (cognitive 63) REDACTED:271— refreshAccountToken has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 9, error handling 4 (8 pts), ternaries 1 (2 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
logger.safeStringify (cognitive 61) REDACTED:10— logger.safeStringify has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (30 pts), ternaries 4 (13 pts), loops 3 (8 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 32). Of this number, 38 points are the body's own statements and 23 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.
batchGetAccountGroupsByIndex (cognitive 59) src/services/accountGroupService.js:521— batchGetAccountGroupsByIndex has cognitive complexity 59 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 4 (12 pts), loops 7 (12 pts), ternaries 3 (8 pts), boolean chains 6 (nesting depth added 29). Of this number, 57 points are the body's own statements and 2 belong to 8 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.
migrateUsageIndex (cognitive 59) REDACTED:202— migrateUsageIndex has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 18 (24 pts), boolean chains 3, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
anthropicGeminiBridgeService.normalizeAnthropicMessages (cognitive 58) src/services/anthropicGeminiBridgeService.js:568— anthropicGeminiBridgeService.normalizeAnthropicMessages has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (45 pts), boolean chains 10, loops 3 (nesting depth added 20). Of this number, 31 points are the body's own statements and 27 belong to 4 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.
UnifiedGeminiScheduler.selectAccountFromGroup (cognitive 57) src/services/scheduler/unifiedGeminiScheduler.js:699— UnifiedGeminiScheduler.selectAccountFromGroup has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (50 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DroidRelayService._processRequestBody (cognitive 57) src/services/relay/droidRelayService.js:1135— DroidRelayService._processRequestBody has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 12 (nesting depth added 23). Of this number, 54 points are the body's own statements and 3 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.
droidAccounts.router.get("/droid-accounts") (cognitive 56) src/routes/admin/droidAccounts.js:144— droidAccounts.router.get("/droid-accounts") has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 31, if/else 4 (8 pts), loops 7 (8 pts), ternaries 4 (8 pts), error handling 1 (nesting depth added 9). Of this number, 28 points are the body's own statements and 28 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.
dashboard.router.get("/dashboard") (cognitive 56) src/routes/admin/dashboard.js:23— dashboard.router.get("/dashboard") has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 21, ternaries 4 (7 pts), loops 3 (4 pts), error handling 1 (nesting depth added 10). Of this number, 32 points are the body's own statements and 24 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
relayRequest (cognitive 56) src/services/relay/droidRelayService.js:184— relayRequest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 16, error handling 4 (10 pts), ternaries 5 (6 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, 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.
getAllAccounts (cognitive 56) src/services/account/geminiApiAccountService.js:201— getAllAccounts has cognitive complexity 56 (threshold 15). Drivers by points: if/else 7 (24 pts), error handling 2 (12 pts), boolean chains 9, ternaries 2 (9 pts), loops 2 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
handleGenerateContent (cognitive 55) REDACTED:1563— handleGenerateContent has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 14, if/else 12 (14 pts), error handling 3 (5 pts) (nesting depth added 15). Of this number, 52 points are the body's own statements and 3 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.
(anonymous) (cognitive 55) REDACTED:247— (anonymous) has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 25, if/else 10 (17 pts), ternaries 7 (8 pts), error handling 2, loops 2, match/switch 1 (nesting depth added 8). Of this number, 40 points are the body's own statements and 15 belong to one function item inside it that branches. 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.
selectAccountFromGroup (cognitive 54) src/services/scheduler/unifiedOpenAIScheduler.js:818— selectAccountFromGroup has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
handleStreamResponse (cognitive 54) src/services/relay/geminiRelayService.js:109— handleStreamResponse has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (33 pts), error handling 4 (11 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 53) REDACTED:177— (anonymous) has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 9, ternaries 6 (9 pts), error handling 2 (3 pts), loops 1 (nesting depth added 18). Of this number, 49 points are the body's own statements and 4 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.
RedisClient.getAccountSessionWindowUsage (cognitive 51) REDACTED:3892— RedisClient.getAccountSessionWindowUsage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 16, loops 4 (5 pts), error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data-transfer-enhanced.exportUsageStats (cognitive 51) scripts/data-transfer-enhanced.js:148— data-transfer-enhanced.exportUsageStats has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 9, boolean chains 6, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedGeminiScheduler.selectAccountForApiKey (cognitive 51) src/services/scheduler/unifiedGeminiScheduler.js:55— UnifiedGeminiScheduler.selectAccountForApiKey has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (37 pts), ternaries 3 (10 pts), boolean chains 3, error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
geminiApiAccounts.router.get("/gemini-api-accounts") (cognitive 51) REDACTED:13— geminiApiAccounts.router.get("/gemini-api-accounts") has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 31, ternaries 5 (9 pts), if/else 5 (7 pts), loops 3, error handling 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 29 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.
selectAccountForApiKey (cognitive 51) src/services/account/claudeAccountService.js:1072— selectAccountForApiKey has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 8, error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 18). Of this number, 35 points are the body's own statements and 16 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CostInitService.initializeApiKeyCosts (cognitive 50) src/services/costInitService.js:140— CostInitService.initializeApiKeyCosts has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 9 (13 pts), boolean chains 11 (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.
generateApiKey (cognitive 50) src/services/apiKeyService.js:176— generateApiKey has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 39, other 5, ternaries 3, error handling 2, if/else 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.
apiStats.router.post("/api/user-model-stats") (cognitive 49) REDACTED:1319— apiStats.router.post("/api/user-model-stats") has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 19, ternaries 1 (3 pts), error handling 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validateApiKey (cognitive 49) src/services/apiKeyService.js:360— validateApiKey has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 23, if/else 12 (14 pts), error handling 6 (7 pts), ternaries 5 (nesting depth added 3). Of this number, 46 points are the body's own statements and 3 belong to 3 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.
apiKeys.router.get("/api-keys") (cognitive 48) REDACTED:177— apiKeys.router.get("/api-keys") has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 9, ternaries 5 (6 pts), error handling 1, loops 1 (nesting depth added 15). Of this number, 46 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.
openaiAccounts.router.post("/") (cognitive 48) src/routes/admin/openaiAccounts.js:320— openaiAccounts.router.post("/") has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 12, error handling 3 (5 pts), ternaries 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.
openaiResponsesAccounts.router.get("/openai-responses-accounts") (cognitive 48) REDACTED:24— openaiResponsesAccounts.router.get("/openai-responses-accounts") has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 29, ternaries 4 (8 pts), if/else 5 (7 pts), loops 3, error handling 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 26 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.
(anonymous) (cognitive 48) src/routes/admin/openaiAccounts.js:320— (anonymous) has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 12, error handling 3 (5 pts), ternaries 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.
grokAccounts.router.get("/grok-accounts") (cognitive 47) REDACTED:139— grokAccounts.router.get("/grok-accounts") has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 30, if/else 5 (7 pts), ternaries 3 (6 pts), loops 3, error handling 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 27 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.
handleAzureOpenAIRequest (cognitive 47) src/services/relay/azureOpenaiRelayService.js:16— handleAzureOpenAIRequest has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 17, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
requestDetailHelper.sanitizeValue (cognitive 46) REDACTED:385— requestDetailHelper.sanitizeValue has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GeminiToOpenAIConverter._convertGeminiChunkToOpenAI (cognitive 46) src/services/geminiToOpenAI.js:198— GeminiToOpenAIConverter._convertGeminiChunkToOpenAI has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azureOpenaiRelayService.extractUsageDataRobust (cognitive 46) src/services/relay/azureOpenaiRelayService.js:620— azureOpenaiRelayService.extractUsageDataRobust has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 12, loops 2 (5 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 17). Of this number, 26 points are the body's own statements and 20 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.
getApiKeysPaginated (cognitive 46) REDACTED:856— getApiKeysPaginated has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 13 (14 pts), boolean chains 10, error handling 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 22 points are the body's own statements and 24 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.
handleStreamResponse::(anonymous)::parseSSEForUsage (cognitive 46) src/services/relay/azureOpenaiRelayService.js:322— handleStreamResponse::(anonymous)::parseSSEForUsage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (36 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
antigravityClient.normalizeAntigravityEnvelope (cognitive 45) src/services/antigravityClient.js:188— antigravityClient.normalizeAntigravityEnvelope has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 10, ternaries 3 (8 pts), error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuotaCardService.redeemCard (cognitive 45) src/services/quotaCardService.js:293— QuotaCardService.redeemCard has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 13, match/switch 1 (2 pts), ternaries 1 (2 pts), error handling 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.
updateAccount (cognitive 45) REDACTED:602— updateAccount has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 9, ternaries 4 (8 pts), error handling 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
apiStats.router.post("/api/batch-stats") (cognitive 44) REDACTED:590— apiStats.router.post("/api/batch-stats") has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 30, if/else 8 (9 pts), ternaries 2 (3 pts), error handling 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 713, 658, 697). 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.
convertMessagesToGemini (cognitive 44) REDACTED:40— convertMessagesToGemini has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 17). Most of this is not in the body itself: 8 of the 44 points are its own statements and the rest belongs to 3 function items inside it that branch (extractTextContent, extractTextContent::(anonymous), extractTextContent::(anonymous)). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_handle429Error (cognitive 44) REDACTED:804— _handle429Error has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (21 pts), error handling 4 (11 pts), boolean chains 7, loops 1 (3 pts), ternaries 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openaiAccountService.refreshAccessToken (cognitive 43) REDACTED:117— openaiAccountService.refreshAccessToken has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 8, 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.
DroidRelayService._parseOpenAIUsageFromSSE (cognitive 43) src/services/relay/droidRelayService.js:756— DroidRelayService._parseOpenAIUsageFromSSE has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 15, error handling 2 (4 pts), 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.
(anonymous) (cognitive 43) web/admin-spa/src/stores/accounts.js:22— (anonymous) has cognitive complexity 43 (threshold 15). Drivers by points: if/else 27, ternaries 14 (15 pts), boolean chains 1 (nesting depth added 1). Most of this is not in the body itself: 0 of the 43 points are its own statements and the rest belongs to 51 function items inside it that branch (sortAccounts, fetchAccounts, toggleAccount, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ClaudeRelayService._processRequestBody (cognitive 42) src/services/relay/claudeRelayService.js:1196— ClaudeRelayService._processRequestBody has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 11, ternaries 1 (nesting depth added 12). Of this number, 40 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.router.get("/model-stats") (cognitive 42) src/routes/admin/dashboard.js:407— dashboard.router.get("/model-stats") has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (14 pts), ternaries 3 (6 pts), loops 4 (5 pts), error handling 1 (nesting depth added 9). Of this number, 38 points are the body's own statements and 4 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.
accounts.useAccountsStore (cognitive 41) web/admin-spa/src/stores/accounts.js:22— accounts.useAccountsStore has cognitive complexity 41 (threshold 15). Drivers by points: if/else 27, ternaries 13, boolean chains 1. Most of this is not in the body itself: 0 of the 41 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 51, 144, 162, …). 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.
updateIndex (cognitive 41) src/services/apiKeyIndexService.js:305— updateIndex has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, ternaries 3 (6 pts), loops 3 (5 pts), other 2, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse (cognitive 41) src/services/relay/claudeRelayService.js:2475— _makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse has cognitive complexity 41 (threshold 15). Drivers by points: error handling 7 (20 pts), if/else 11 (17 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createAccount (cognitive 41) REDACTED:444— createAccount has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 17, ternaries 10 (16 pts), if/else 5 (6 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 41) src/routes/admin/droidAccounts.js:144— (anonymous) has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 16, if/else 4 (8 pts), loops 7 (8 pts), ternaries 4 (8 pts), error handling 1 (nesting depth added 9). Of this number, 28 points are the body's own statements and 13 belong to 3 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.
antigravityRelayService.handleStreamResponse (cognitive 40) src/services/relay/antigravityRelayService.js:32— antigravityRelayService.handleStreamResponse has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 9, error handling 1 (3 pts), loops 2 (3 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.
getOpenAIAuthToken (cognitive 40) REDACTED:178— getOpenAIAuthToken has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 4 (11 pts), ternaries 3 (7 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedisClient.getKeyIdsWithModels (cognitive 39) REDACTED:1584— RedisClient.getKeyIdsWithModels has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 8 (17 pts), boolean chains 3 (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.
_scanTagsFallback (cognitive 39) REDACTED:681— _scanTagsFallback has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (10 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 21). Of this number, 38 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.
refreshAccessToken (cognitive 39) REDACTED:1213— refreshAccessToken has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (16 pts), ternaries 4 (6 pts), error handling 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.
createAccount (cognitive 39) src/services/account/claudeAccountService.js:81— createAccount has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 13 (24 pts), boolean chains 6, if/else 5 (6 pts), error handling 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccountNameCacheService.refresh (cognitive 38) src/services/accountNameCacheService.js:41— AccountNameCacheService.refresh has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (16 pts), if/else 6 (11 pts), boolean chains 5, error handling 3, loops 2 (3 pts) (nesting depth added 8). Of this number, 27 points are the body's own statements and 11 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.
apiStats.router.post("/api/batch-model-stats") (cognitive 38) REDACTED:791— apiStats.router.post("/api/batch-model-stats") has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (16 pts), ternaries 2 (3 pts), loops 2, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 12 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 820). 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.
rebuildIndexes (cognitive 38) src/services/apiKeyIndexService.js:146— rebuildIndexes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (9 pts), ternaries 3 (9 pts), boolean chains 5, error handling 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.
updateAccount (cognitive 38) src/services/account/claudeConsoleAccountService.js:299— updateAccount has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
refreshAccountToken (cognitive 38) src/services/account/claudeAccountService.js:263— refreshAccountToken has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 4 (11 pts), boolean chains 5, ternaries 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.
BedrockRelayService.handleNonStreamRequest (cognitive 37) src/services/relay/bedrockRelayService.js:108— BedrockRelayService.handleNonStreamRequest has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (9 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
waitForConcurrencySlot (cognitive 37) REDACTED:248— waitForConcurrencySlot has cognitive complexity 37 (threshold 15). Drivers by points: error handling 10 (23 pts), if/else 7 (11 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.
_handleStreamRequest::(anonymous)::handleStreamError (cognitive 37) src/services/relay/droidRelayService.js:464— _handleStreamRequest::(anonymous)::handleStreamError has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 8 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sanitizeMaxTokens (cognitive 37) REDACTED:457— sanitizeMaxTokens has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, error handling 4 (6 pts), loops 1, ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 11 function items inside it that branch ((anonymous), (anonymous)::(anonymous), (anonymous)::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") (cognitive 36) REDACTED:460— geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, error handling 4 (6 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 559, 533, 472, …). 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.
validateApiKeyForStats (cognitive 36) src/services/apiKeyService.js:559— validateApiKeyForStats has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 20, if/else 6 (7 pts), error handling 5 (6 pts), ternaries 3 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
createAccount (cognitive 36) REDACTED:437— createAccount has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 19, ternaries 12 (14 pts), if/else 3 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openaiAccountService.getAllAccounts (cognitive 35) REDACTED:682— openaiAccountService.getAllAccounts has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 3 (8 pts), boolean chains 4, error handling 1 (4 pts), loops 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.
RedisClient.batchGetAccountDailyCost (cognitive 35) REDACTED:2021— RedisClient.batchGetAccountDailyCost has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 10, loops 5 (7 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data-transfer.formatCSVValue (cognitive 35) scripts/data-transfer.js:146— data-transfer.formatCSVValue has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 8 (18 pts), error handling 2 (5 pts), if/else 3 (5 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DroidScheduler.selectAccount (cognitive 35) src/services/scheduler/droidScheduler.js:97— DroidScheduler.selectAccount has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 32 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.
updateRateLimitCounters (cognitive 35) src/utils/rateLimitHelper.js:12— updateRateLimitCounters has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 11, error handling 3 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildAntigravityQuota (cognitive 35) src/services/balanceProviders/geminiBalanceProvider.js:61— buildAntigravityQuota has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 11, ternaries 5 (6 pts), other 2, loops 1 (nesting depth added 5). Of this number, 24 points are the body's own statements and 11 belong to 5 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.
(anonymous) (cognitive 35) src/routes/admin/dashboard.js:407— (anonymous) has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 9, ternaries 3 (6 pts), loops 4 (5 pts), error handling 1 (nesting depth added 9). Of this number, 31 points are the body's own statements and 4 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.
ApiKeyService._resolveAccountByUsageRecord (cognitive 34) src/services/apiKeyService.js:2222— ApiKeyService._resolveAccountByUsageRecord has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 7). Of this number, 32 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.
ClaudeRelayService._enforceCacheControlLimit (cognitive 34) src/services/relay/claudeRelayService.js:1466— ClaudeRelayService._enforceCacheControlLimit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 7, loops 4 (5 pts) (nesting depth added 10). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1501, 1526, 1473, …). 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.
warmupInterceptor.isWarmupRequest (cognitive 34) src/utils/warmupInterceptor.js:15— warmupInterceptor.isWarmupRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent (cognitive 34) src/services/anthropicGeminiBridgeService.js:1623— anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9, ternaries 4 (8 pts), loops 1 (nesting depth added 10). Of this number, 23 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
geminiHandlers.buildGeminiApiUrl (cognitive 34) REDACTED:88— geminiHandlers.buildGeminiApiUrl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 4 (11 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.
claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") (cognitive 34) src/routes/admin/claudeConsoleAccounts.js:211— claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 8, loops 1 (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.
azureOpenaiRoutes.router.post("/chat/completions") (cognitive 34) src/routes/azureOpenaiRoutes.js:161— azureOpenaiRoutes.router.post("/chat/completions") has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Of this number, 31 points are the body's own statements and 3 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. This shape REPEATS in the file: one other method here (azureOpenaiRoutes.router.post("/responses")) 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.
azureOpenaiRoutes.router.post("/responses") (cognitive 34) src/routes/azureOpenaiRoutes.js:292— azureOpenaiRoutes.router.post("/responses") has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Of this number, 31 points are the body's own statements and 3 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. This shape REPEATS in the file: one other method here (azureOpenaiRoutes.router.post("/chat/completions")) 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.
_normalizeExtInfo (cognitive 34) src/services/account/claudeAccountService.js:3456— _normalizeExtInfo has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
migrate-usage-index.migrate (cognitive 33) scripts/migrate-usage-index.js:15— migrate-usage-index.migrate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 8 (12 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiToOpenAIConverter.convertResponse (cognitive 33) src/services/geminiToOpenAI.js:97— GeminiToOpenAIConverter.convertResponse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 5 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 101). 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.
GrokScheduler.selectAccount (cognitive 33) src/services/scheduler/grokScheduler.js:69— GrokScheduler.selectAccount has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 29 points are the body's own statements and 4 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.
request::attemptRequest (cognitive 33) src/services/antigravityClient.js:366— request::attemptRequest has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (11 pts), boolean chains 5, error handling 2 (4 pts), 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.
sendGeminiRequest (cognitive 33) src/services/relay/geminiRelayService.js:229— sendGeminiRequest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 9, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updateSessionWindowStatus (cognitive 33) src/services/account/claudeAccountService.js:3049— updateSessionWindowStatus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, error handling 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 33) REDACTED:24— (anonymous) has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (8 pts), if/else 5 (7 pts), loops 3, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 17 belong to 5 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.
geminiAccountService.getAllAccounts (cognitive 32) REDACTED:774— geminiAccountService.getAllAccounts has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 2 (5 pts), boolean chains 4, error handling 1 (4 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unified.routeToBackend (cognitive 32) src/routes/unified.js:115— unified.routeToBackend has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 8 (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.
theme.useThemeStore (cognitive 32) web/admin-spa/src/stores/theme.js:157— theme.useThemeStore has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 16, if/else 13, boolean chains 3. Most of this is not in the body itself: 0 of the 32 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 230, 187, 165, …). 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.
selectAvailableAccount (cognitive 32) src/services/account/claudeAccountService.js:969— selectAvailableAccount has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 13). Of this number, 18 points are the body's own statements and 14 belong to 4 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.
anthropicGeminiBridgeService.summarizeAntigravityRequestForDebug (cognitive 31) src/services/anthropicGeminiBridgeService.js:407— anthropicGeminiBridgeService.summarizeAntigravityRequestForDebug has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), ternaries 3 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
apiStats.router.post("/api-key/test-openai") (cognitive 31) REDACTED:1165— apiStats.router.post("/api-key/test-openai") has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, error handling 4 (6 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1258, 1238). 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.
_getAccountBalanceForAccount (cognitive 31) src/services/account/accountBalanceService.js:283— _getAccountBalanceForAccount has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 12, other 2, ternaries 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.
requestDetailHelper.extractPreviewReasoningInfo (cognitive 30) REDACTED:289— requestDetailHelper.extractPreviewReasoningInfo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 2 (7 pts), boolean chains 6 (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.
LogSessionAnalyzer.displayResults (cognitive 30) REDACTED:313— LogSessionAnalyzer.displayResults has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (10 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
anthropicGeminiBridgeService.canEnableAntigravityThinking (cognitive 30) src/services/anthropicGeminiBridgeService.js:1221— anthropicGeminiBridgeService.canEnableAntigravityThinking has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 10, loops 3 (4 pts) (nesting depth added 8). Of this number, 29 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.
exchangeCodeForTokens (cognitive 30) src/utils/oauthHelper.js:156— exchangeCodeForTokens has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, ternaries 2, error handling 1, other 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.
exchangeSetupTokenCode (cognitive 30) src/utils/oauthHelper.js:375— exchangeSetupTokenCode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, ternaries 2, error handling 1, other 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.
createAccount (cognitive 30) src/services/account/grokAccountService.js:71— createAccount has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 17, if/else 4 (6 pts), ternaries 6, other 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cognitive 30) src/routes/admin/droidAccounts.js:351— (anonymous) has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 11, error handling 3 (4 pts), ternaries 1 (nesting depth added 4). Of this number, 29 points are the body's own statements and 1 belongs 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, 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.
geminiAccountService.fetchAvailableModelsAntigravity (cognitive 29) REDACTED:97— geminiAccountService.fetchAvailableModelsAntigravity has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 11). Of this number, 24 points are the body's own statements and 5 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.
openaiAccountService.selectAvailableAccount (cognitive 29) REDACTED:829— openaiAccountService.selectAvailableAccount has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 9). Of this number, 26 points are the body's own statements and 3 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.
debug-redis-keys.debugRedisKeys (cognitive 29) scripts/debug-redis-keys.js:11— debug-redis-keys.debugRedisKeys has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 6 (10 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
errorSanitizer.mapToErrorCode (cognitive 29) src/utils/errorSanitizer.js:75— errorSanitizer.mapToErrorCode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ClaudeCodeValidator.hasClaudeCodeSystemPrompt (cognitive 29) src/validators/clients/claudeCodeValidator.js:51— ClaudeCodeValidator.hasClaudeCodeSystemPrompt has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 7 (10 pts), boolean chains 6, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexToOpenAIConverter.convertResponse (cognitive 29) src/services/codexToOpenAI.js:84— CodexToOpenAIConverter.convertResponse has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (13 pts), ternaries 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.
apiKeys.router.get("/accounts/binding-counts") (cognitive 29) REDACTED:860— apiKeys.router.get("/accounts/binding-counts") has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, error handling 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.
grokAccounts.router.post("/grok-accounts/:accountId/test") (cognitive 29) REDACTED:412— grokAccounts.router.post("/grok-accounts/:accountId/test") has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (6 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updateApiKey (cognitive 29) src/services/apiKeyService.js:1328— updateApiKey has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, ternaries 2 (8 pts), error handling 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 29) REDACTED:860— (anonymous) has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, error handling 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.
geminiAccountService.selectAvailableAccount (cognitive 28) REDACTED:849— geminiAccountService.selectAvailableAccount has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 9). Of this number, 26 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.
RedisClient.getAccountUsageStats (cognitive 28) REDACTED:2338— RedisClient.getAccountUsageStats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 10, ternaries 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedisClient.getTodayStats (cognitive 28) REDACTED:2931— RedisClient.getTodayStats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 9, loops 2 (4 pts), error handling 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.
ClaudeRelayService.testAccountConnectionSync (cognitive 28) src/services/relay/claudeRelayService.js:3517— ClaudeRelayService.testAccountConnectionSync has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 11). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 3537). 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.
anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic (cognitive 28) src/services/anthropicGeminiBridgeService.js:1300— anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
claudeAccounts.router.get("/claude-accounts") (cognitive 28) src/routes/admin/claudeAccounts.js:393— claudeAccounts.router.get("/claude-accounts") has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (5 pts), error handling 3 (4 pts) (nesting depth added 10). Of this number, 16 points are the body's own statements and 12 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.
claudeConsoleAccounts.router.post("/claude-console-accounts") (cognitive 28) src/routes/admin/claudeConsoleAccounts.js:118— claudeConsoleAccounts.router.post("/claude-console-accounts") has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 17, if/else 7 (8 pts), ternaries 2, error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
apiStats.router.post("/api-key/test-gemini") (cognitive 28) REDACTED:1013— apiStats.router.post("/api-key/test-gemini") has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 4 (6 pts), boolean chains 5, loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1105, 1085). 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.
authenticateUserCredentials (cognitive 28) src/services/ldapService.js:514— authenticateUserCredentials has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, error handling 2, ternaries 1 (2 pts) (nesting depth added 3). Of this number, 26 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.
_isAccountAvailable (cognitive 28) src/services/scheduler/unifiedOpenAIScheduler.js:522— _isAccountAvailable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, 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.
ClaudeAccountService.fetchAndUpdateAccountProfile (cognitive 27) src/services/account/claudeAccountService.js:2329— ClaudeAccountService.fetchAndUpdateAccountProfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 6, ternaries 2 (5 pts), error handling 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.
LogSessionAnalyzer.analyzeLogFile (cognitive 27) REDACTED:40— LogSessionAnalyzer.analyzeLogFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (26 pts), 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.
geminiHandlers.handleCountTokens (cognitive 27) REDACTED:1439— geminiHandlers.handleCountTokens has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (8 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GeminiToOpenAIConverter.convertStreamChunk (cognitive 27) src/services/geminiToOpenAI.js:25— GeminiToOpenAIConverter.convertStreamChunk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), error handling 1 (3 pts), boolean chains 2, ternaries 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.
ccrAccounts.router.put("/:accountId") (cognitive 27) REDACTED:182— ccrAccounts.router.put("/:accountId") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, loops 1 (3 pts), error handling 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.
openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") (cognitive 27) REDACTED:459— openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 pts), boolean chains 4, error handling 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.
droidAccounts.router.post("/droid-accounts/exchange-code") (cognitive 27) src/routes/admin/droidAccounts.js:68— droidAccounts.router.post("/droid-accounts/exchange-code") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (8 pts), boolean chains 6, error handling 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.
droidAccounts.router.put("/droid-accounts/:id") (cognitive 27) src/routes/admin/droidAccounts.js:351— droidAccounts.router.put("/droid-accounts/:id") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, error handling 3 (4 pts), ternaries 1 (nesting depth added 4). Of this number, 26 points are the body's own statements and 1 belongs 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, 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.
usageStats.getUsageDataByIndex (cognitive 27) REDACTED:23— usageStats.getUsageDataByIndex has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 9 (nesting depth added 5). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 63, 26, 43, …). 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.
BalanceScriptService.execute (cognitive 27) src/services/balanceScriptService.js:62— BalanceScriptService.execute has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 8, error handling 3, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.router.beforeEach() (cognitive 27) web/admin-spa/src/router/index.js:188— index.router.beforeEach() has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_sumModelCostsByKeysPattern (cognitive 27) src/services/account/accountBalanceService.js:575— _sumModelCostsByKeysPattern has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (10 pts), loops 3 (4 pts), error handling 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.
modelHelper.isOpus45OrNewer (cognitive 26) src/utils/modelHelper.js:98— modelHelper.isOpus45OrNewer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, ternaries 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.
geminiAccountService.refreshAccountToken (cognitive 26) REDACTED:996— geminiAccountService.refreshAccountToken has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (8 pts), error handling 3 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockAccountService.testAccountConnection (cognitive 26) src/services/account/bedrockAccountService.js:528— BedrockAccountService.testAccountConnection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, error handling 2 (3 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.
PricingService.getModelPricing (cognitive 26) src/services/pricingService.js:355— PricingService.getModelPricing has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestDetailService._findRequestTimestampInRange (cognitive 26) src/services/requestDetailService.js:998— RequestDetailService._findRequestTimestampInRange has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claudeAccounts.router.put("/claude-accounts/:accountId") (cognitive 26) src/routes/admin/claudeAccounts.js:717— claudeAccounts.router.put("/claude-accounts/:accountId") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, error handling 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.
geminiApiAccounts.router.put("/gemini-api-accounts/:id") (cognitive 26) REDACTED:219— geminiApiAccounts.router.put("/gemini-api-accounts/:id") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, error handling 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.
DroidRelayService._parseAnthropicUsageFromSSE (cognitive 26) src/services/relay/droidRelayService.js:706— DroidRelayService._parseAnthropicUsageFromSSE has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 9, error handling 2 (4 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.
azureOpenaiRoutes.router.post("/embeddings") (cognitive 26) src/routes/azureOpenaiRoutes.js:423— azureOpenaiRoutes.router.post("/embeddings") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, ternaries 2 (3 pts), error handling 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.
_handleBedrockError (cognitive 26) src/services/relay/bedrockRelayService.js:762— _handleBedrockError has cognitive complexity 26 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 9 (10 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updateAccount (cognitive 26) REDACTED:573— updateAccount has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 3 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProxyHelper.createProxyAgent (cognitive 25) src/utils/proxyHelper.js:21— ProxyHelper.createProxyAgent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, ternaries 2, 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, 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.
ClaudeConsoleAccountService.getAllAccounts (cognitive 25) src/services/account/claudeConsoleAccountService.js:169— ClaudeConsoleAccountService.getAllAccounts has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, ternaries 2 (6 pts), if/else 2 (5 pts), error handling 1, loops 1 (nesting depth added 7). 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.
antigravityClient.normalizeAntigravityThinking (cognitive 25) src/services/antigravityClient.js:123— antigravityClient.normalizeAntigravityThinking has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RedisClient.migrateAlltimeModelStats (cognitive 25) REDACTED:379— RedisClient.migrateAlltimeModelStats has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 6, loops 3 (4 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.
data-transfer-enhanced.sanitizeData (cognitive 25) scripts/data-transfer-enhanced.js:421— data-transfer-enhanced.sanitizeData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OpenAIToClaudeConverter._convertStreamEvent (cognitive 25) src/services/openaiToClaude.js:410— OpenAIToClaudeConverter._convertStreamEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 9 (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.
GrokRelayService._handleStreamResponse (cognitive 25) REDACTED:248— GrokRelayService._handleStreamResponse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 275, 267, 307, …). 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.
geminiAccounts.router.put("/:accountId") (cognitive 25) src/routes/admin/geminiAccounts.js:301— geminiAccounts.router.put("/:accountId") has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 1 (3 pts), error handling 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.
openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") (cognitive 25) REDACTED:192— openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (3 pts), boolean chains 2, 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.
DroidRelayService._handleUpstreamClientError (cognitive 25) src/services/relay/droidRelayService.js:1361— DroidRelayService._handleUpstreamClientError has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (6 pts), boolean chains 4, ternaries 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.
cleanupClaudeAccounts (cognitive 25) src/services/rateLimitCleanupService.js:211— cleanupClaudeAccounts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 7, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cleanupClaudeConsoleAccounts (cognitive 25) src/services/rateLimitCleanupService.js:306— cleanupClaudeConsoleAccounts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getTagsWithCount (cognitive 25) src/services/apiKeyService.js:729— getTagsWithCount has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recordUsage (cognitive 25) src/services/apiKeyService.js:1669— recordUsage has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), error handling 3 (4 pts), other 1 (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.
authenticateUserOrAdmin (cognitive 25) REDACTED:1560— authenticateUserOrAdmin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, error handling 3 (5 pts), ternaries 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.
azureOpenaiAccountService.selectAvailableAccount (cognitive 24) src/services/account/azureOpenaiAccountService.js:386— azureOpenaiAccountService.selectAvailableAccount has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 1 (nesting depth added 9). Of this number, 22 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.
RedisClient._parseApiKeyData (cognitive 24) REDACTED:768— RedisClient._parseApiKeyData has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (6 pts), loops 4, 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.
auth.requestLogger (cognitive 24) REDACTED:1765— auth.requestLogger has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10, ternaries 5 (8 pts), boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1795). 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.
IncrementalSSEParser.feed (cognitive 24) src/utils/sseParser.js:64— IncrementalSSEParser.feed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
accountGroups.router.get("/:groupId/members") (cognitive 24) src/routes/admin/accountGroups.js:90— accountGroups.router.get("/:groupId/members") has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oauthHelper.authorizeWithCookie (cognitive 24) src/utils/oauthHelper.js:707— oauthHelper.authorizeWithCookie has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 1, error handling 1, ternaries 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.
grokAccounts.router.put("/grok-accounts/:id") (cognitive 24) REDACTED:273— grokAccounts.router.put("/grok-accounts/:id") has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), boolean chains 2, 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.
RuntimeAddonBus._ensureInitialized (cognitive 24) src/utils/runtimeAddon.js:56— RuntimeAddonBus._ensureInitialized has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LdapService.createClient (cognitive 24) src/services/ldapService.js:133— LdapService.createClient has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, error handling 1 (nesting depth added 11). Of this number, 19 points are the body's own statements and 5 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.
queryWithIndex (cognitive 24) src/services/apiKeyIndexService.js:432— queryWithIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). Of this number, 21 points are the body's own statements and 3 belong to 4 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, 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.
handleAnthropicCountTokensToGemini (cognitive 24) src/services/anthropicGeminiBridgeService.js:3008— handleAnthropicCountTokensToGemini has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), error handling 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_extractTagsFromKeyIds (cognitive 24) REDACTED:640— _extractTagsFromKeyIds has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), boolean chains 4, error handling 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.
updateAccount (cognitive 24) src/services/account/grokAccountService.js:289— updateAccount has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 4, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
getApiKeysSortedByCostCustom (cognitive 24) REDACTED:517— getApiKeysSortedByCostCustom has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 3 (6 pts), loops 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 5 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.
azureOpenaiAccountService.getAllAccounts (cognitive 23) src/services/account/azureOpenaiAccountService.js:298— azureOpenaiAccountService.getAllAccounts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (8 pts), boolean chains 5, 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.
BedrockAccountService.updateAccount (cognitive 23) src/services/account/bedrockAccountService.js:280— BedrockAccountService.updateAccount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 1, 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, 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.
grokHelper.isBlockedHost (cognitive 23) src/utils/grokHelper.js:211— grokHelper.isBlockedHost has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7 (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.
ClaudeRelayService._transformToolNamesInRequestBody (cognitive 23) src/services/relay/claudeRelayService.js:309— ClaudeRelayService._transformToolNamesInRequestBody has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, ternaries 2 (nesting depth added 5). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 318, 336, 353, …). 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.
ClaudeRelayService._patchOrphanedToolUse (cognitive 23) src/services/relay/claudeRelayService.js:1115— ClaudeRelayService._patchOrphanedToolUse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 2 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.
ClaudeRelayService._createTestStreamTransformer (cognitive 23) src/services/relay/claudeRelayService.js:3380— ClaudeRelayService._createTestStreamTransformer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 3383). 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.
ClaudeConsoleRelayService._createTestStreamTransformer (cognitive 23) src/services/relay/claudeConsoleRelayService.js:1399— ClaudeConsoleRelayService._createTestStreamTransformer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1402). 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.
oauthHelper.getOrganizationInfo (cognitive 23) src/utils/oauthHelper.js:614— oauthHelper.getOrganizationInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, error handling 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.
claudeAccounts.router.post("/claude-accounts") (cognitive 23) src/routes/admin/claudeAccounts.js:606— claudeAccounts.router.post("/claude-accounts") has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (9 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
startCleanupTasks (cognitive 23) src/app.js:674— startCleanupTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 714, 676, 801, …). 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.
safeStringify::replacer (cognitive 23) REDACTED:13— safeStringify::replacer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (4 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
needsInitialization (cognitive 23) src/services/costInitService.js:286— needsInitialization has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (6 pts), error handling 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.
testAccountConnectionSync::write (cognitive 23) src/services/relay/claudeRelayService.js:3537— testAccountConnectionSync::write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 6, error handling 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.
updateAccount (cognitive 23) src/services/account/ccrAccountService.js:242— updateAccount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (20 pts), ternaries 1 (2 pts), 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, 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.
(anonymous) (cognitive 23) src/routes/admin/claudeAccounts.js:606— (anonymous) has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (9 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
getApiKeysSortedByCostPrecomputed (cognitive 23) REDACTED:409— getApiKeysSortedByCostPrecomputed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 2 (5 pts), loops 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 4 belong to 10 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.
ClaudeAccountService.getAllAccounts (cognitive 22) src/services/account/claudeAccountService.js:546— ClaudeAccountService.getAllAccounts has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, ternaries 6, error handling 1. 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 552). 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.
CostCalculator.buildLegacyCostResult (cognitive 22) src/utils/costCalculator.js:199— CostCalculator.buildLegacyCostResult has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, if/else 3 (4 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BillingEventPublisher.publishBillingEvent (cognitive 22) src/services/billingEventPublisher.js:24— BillingEventPublisher.publishBillingEvent has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 20, error handling 1, if/else 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.
index.renewApiKeys (cognitive 22) REDACTED:462— index.renewApiKeys has cognitive complexity 22 (threshold 15). Drivers by points: error handling 3 (8 pts), if/else 5 (7 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). Of this number, 20 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.
LogSessionAnalyzer.updateRedisSessionWindows (cognitive 22) REDACTED:393— LogSessionAnalyzer.updateRedisSessionWindows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedClaudeScheduler._getAvailableCcrAccounts (cognitive 22) src/services/scheduler/unifiedClaudeScheduler.js:1791— UnifiedClaudeScheduler._getAvailableCcrAccounts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, error handling 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.
UnifiedOpenAIScheduler._ensureAccountReadyForScheduling (cognitive 22) src/services/scheduler/unifiedOpenAIScheduler.js:55— UnifiedOpenAIScheduler._ensureAccountReadyForScheduling has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
system.router.get("/check-updates") (cognitive 22) src/routes/admin/system.js:93— system.router.get("/check-updates") has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, ternaries 2 (4 pts), error handling 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.
browserFallback.browserFallbackMiddleware (cognitive 22) src/middleware/browserFallback.js:7— browserFallback.browserFallbackMiddleware has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 17 points are the body's own statements and 5 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.
auth.useAuthStore (cognitive 22) web/admin-spa/src/stores/auth.js:7— auth.useAuthStore has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 pts), error handling 3 (nesting depth added 2). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
headerValue (cognitive 22) src/utils/grokQuota.js:55— headerValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (4 pts), other 1 (nesting depth added 7). Of this number, 20 points are the body's own statements and 2 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.
_captureRequestDetail (cognitive 22) src/services/apiKeyService.js:2145— _captureRequestDetail has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 19, other 2, if/else 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.
handleStandardStreamGenerateContent::handleEventBlock (cognitive 22) REDACTED:2801— handleStandardStreamGenerateContent::handleEventBlock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
setAccountRateLimited (cognitive 22) REDACTED:942— setAccountRateLimited has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, error handling 2 (5 pts), ternaries 4 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
updateAccount (cognitive 22) src/services/account/azureOpenaiAccountService.js:205— updateAccount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
upstreamErrorHelper.parseRetryAfter (cognitive 21) src/utils/upstreamErrorHelper.js:176— upstreamErrorHelper.parseRetryAfter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 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.
ClaudeAccountService.updateSessionWindow (cognitive 21) src/services/account/claudeAccountService.js:1874— ClaudeAccountService.updateSessionWindow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeAccountService.updateClaudeUsageSnapshot (cognitive 21) src/services/account/claudeAccountService.js:2259— ClaudeAccountService.updateClaudeUsageSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CcrAccountService.getAllAccounts (cognitive 21) src/services/account/ccrAccountService.js:134— CcrAccountService.getAllAccounts has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 2 (6 pts), if/else 1 (2 pts), error handling 1, loops 1 (nesting depth added 5). 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.
BedrockAccountService.getAccount (cognitive 21) src/services/account/bedrockAccountService.js:109— BedrockAccountService.getAccount has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedisClient._sumModelCostsForAccountDays (cognitive 21) REDACTED:2184— RedisClient._sumModelCostsForAccountDays has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (6 pts), loops 1 (nesting depth added 2). 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, 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.
ClaudeRelayService._makeClaudeRequest (cognitive 21) src/services/relay/claudeRelayService.js:1727— ClaudeRelayService._makeClaudeRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 5, error handling 3 (5 pts) (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1788, 1761, 1839). 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.
CcrRelayService._parseSSELineForUsage (cognitive 21) src/services/relay/ccrRelayService.js:887— CcrRelayService._parseSSELineForUsage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (7 pts), error handling 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
geminiRelayService.countTokens (cognitive 21) src/services/relay/geminiRelayService.js:443— geminiRelayService.countTokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, 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.
geminiHandlers.normalizeAxiosStreamError (cognitive 21) REDACTED:322— geminiHandlers.normalizeAxiosStreamError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
apiKeys.router.patch("/api-keys/:keyId/expiration") (cognitive 21) REDACTED:2460— apiKeys.router.patch("/api-keys/:keyId/expiration") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claudeConsoleAccounts.router.get("/claude-console-accounts") (cognitive 21) src/routes/admin/claudeConsoleAccounts.js:20— claudeConsoleAccounts.router.get("/claude-console-accounts") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 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.
ccrAccounts.router.get("/") (cognitive 21) REDACTED:17— ccrAccounts.router.get("/") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 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.
Application.setupGracefulShutdown (cognitive 21) src/app.js:834— Application.setupGracefulShutdown has cognitive complexity 21 (threshold 15). Drivers by points: error handling 8 (16 pts), if/else 4 (5 pts) (nesting depth added 9). Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 839, 835). 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.
getAllTempUnavailable (cognitive 21) src/utils/upstreamErrorHelper.js:429— getAllTempUnavailable has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 pts), error handling 3 (4 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_buildListQueryData (cognitive 21) src/services/requestDetailService.js:1230— _buildListQueryData has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), other 2, boolean chains 1, ternaries 1 (nesting depth added 9). Of this number, 15 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renameTag (cognitive 21) src/services/apiKeyService.js:808— renameTag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (7 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 4 belong to 4 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.
ProxyHelper._getIPFamilyPreference (cognitive 20) src/utils/proxyHelper.js:136— ProxyHelper._getIPFamilyPreference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockRelayService._getBedrockClient (cognitive 20) src/services/relay/bedrockRelayService.js:31— BedrockRelayService._getBedrockClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). Of this number, 15 points are the body's own statements and 5 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.
DroidAccountService._refreshTokensWithWorkOS (cognitive 20) REDACTED:337— DroidAccountService._refreshTokensWithWorkOS has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (7 pts), ternaries 2 (3 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RedisClient.getAccountDailyCostFallback (cognitive 20) REDACTED:2114— RedisClient.getAccountDailyCostFallback has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (8 pts), loops 2 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
redis.redisClient.batchGetApiKeyStats (cognitive 20) REDACTED:4988— redis.redisClient.batchGetApiKeyStats has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, loops 2, ternaries 1 (2 pts), if/else 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
redis.redisClient.migrateGlobalStats (cognitive 20) REDACTED:5302— redis.redisClient.migrateGlobalStats has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (5 pts), loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 5325). 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.
ClaudeRelayService._extractErrorMessage (cognitive 20) src/services/relay/claudeRelayService.js:100— ClaudeRelayService._extractErrorMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexCliValidator.validate (cognitive 20) src/validators/clients/codexCliValidator.js:35— CodexCliValidator.validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bedrockAccounts.router.get("/") (cognitive 20) src/routes/admin/bedrockAccounts.js:20— bedrockAccounts.router.get("/") has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 3 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.
GeminiBalanceProvider.queryBalance (cognitive 20) src/services/balanceProviders/geminiBalanceProvider.js:191— GeminiBalanceProvider.queryBalance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleGeminiUpstreamError (cognitive 20) REDACTED:27— handleGeminiUpstreamError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, error handling 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildModelMappingFromSupportedModels (cognitive 20) src/routes/admin/sync.js:52— buildModelMappingFromSupportedModels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 20) src/routes/admin/bedrockAccounts.js:20— (anonymous) has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 17 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.
UserService.getUserStats (cognitive 19) REDACTED:461— UserService.getUserStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, error handling 2 (4 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.
UserService.transferMatchingApiKeys (cognitive 19) REDACTED:529— UserService.transferMatchingApiKeys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.router.get("/v1/models") (cognitive 19) REDACTED:1477— api.router.get("/v1/models") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 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.
geminiHandlers.handleOnboardUser (cognitive 19) REDACTED:1225— geminiHandlers.handleOnboardUser has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 5, 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, 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.
unified.buildContentParts (cognitive 19) src/routes/unified.js:802— unified.buildContentParts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
claudeAccounts.router.post("/claude-accounts/exchange-setup-token-code") (cognitive 19) src/routes/admin/claudeAccounts.js:209— claudeAccounts.router.post("/claude-accounts/exchange-setup-token-code") has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4, boolean chains 3, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ccrAccounts.router.post("/") (cognitive 19) REDACTED:112— ccrAccounts.router.post("/") has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, error handling 1, ternaries 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.
geminiAccounts.router.get("/") (cognitive 19) src/routes/admin/geminiAccounts.js:155— geminiAccounts.router.get("/") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 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.
openaiAccounts.router.get("/") (cognitive 19) src/routes/admin/openaiAccounts.js:230— openaiAccounts.router.get("/") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (3 pts), error handling 2 (nesting depth added 6). Of this number, 16 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.
azureOpenaiAccounts.router.get("/azure-openai-accounts") (cognitive 19) REDACTED:15— azureOpenaiAccounts.router.get("/azure-openai-accounts") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 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.
azureOpenaiAccounts.router.post("/azure-openai-accounts") (cognitive 19) REDACTED:106— azureOpenaiAccounts.router.post("/azure-openai-accounts") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BalanceScriptService.mapExtractorResult (cognitive 19) src/services/balanceScriptService.js:177— BalanceScriptService.mapExtractorResult has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 7 (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.
LdapService.validateConfiguration (cognitive 19) src/services/ldapService.js:18— LdapService.validateConfiguration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5 (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.
_resolveAccountInfo (cognitive 19) src/services/requestDetailService.js:928— _resolveAccountInfo has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiKeyIndexService.rebuildHashMap (cognitive 18) src/services/apiKeyIndexService.js:73— ApiKeyIndexService.rebuildHashMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), boolean chains 1, error handling 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.
antigravityUpstreamDump.dumpAntigravityUpstreamRequest (cognitive 18) src/utils/antigravityUpstreamDump.js:67— antigravityUpstreamDump.dumpAntigravityUpstreamRequest has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 2 (3 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. 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.
migrate-apikey-expiry.migrateApiKeys (cognitive 18) scripts/migrate-apikey-expiry.js:44— migrate-apikey-expiry.migrateApiKeys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (3 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reset-request-detail-retention-hours.resetRequestDetailRetentionHours (cognitive 18) scripts/reset-request-detail-retention-hours.js:58— reset-request-detail-retention-hours.resetRequestDetailRetentionHours has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, loops 1 (3 pts), ternaries 3, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
requestIdentityService.resolveAccountId (cognitive 18) src/services/requestIdentityService.js:205— requestIdentityService.resolveAccountId has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (5 pts), loops 1, ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OpenAIToClaudeConverter.convertStreamChunk (cognitive 18) src/services/openaiToClaude.js:122— OpenAIToClaudeConverter.convertStreamChunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
geminiHandlers.handleLoadCodeAssist (cognitive 18) REDACTED:1123— geminiHandlers.handleLoadCodeAssist has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 4, 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.
claudeAccounts.router.post("/claude-accounts/exchange-code") (cognitive 18) src/routes/admin/claudeAccounts.js:92— claudeAccounts.router.post("/claude-accounts/exchange-code") has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 3, if/else 3, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openaiAccounts.router.post("/exchange-code") (cognitive 18) src/routes/admin/openaiAccounts.js:110— openaiAccounts.router.post("/exchange-code") has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, error handling 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.
workosOAuthHelper.pollDeviceAuthorization (cognitive 18) src/utils/workosOAuthHelper.js:104— workosOAuthHelper.pollDeviceAuthorization has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DroidRelayService._detectStreamCompletion (cognitive 18) src/services/relay/droidRelayService.js:842— DroidRelayService._detectStreamCompletion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
geminiBalanceProvider.normalizeQuotaCategory (cognitive 18) src/services/balanceProviders/geminiBalanceProvider.js:27— geminiBalanceProvider.normalizeQuotaCategory has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RateLimitCleanupService.proactiveRefreshClaudeTokens (cognitive 18) src/services/rateLimitCleanupService.js:430— RateLimitCleanupService.proactiveRefreshClaudeTokens has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 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.
_normalizeUsageSnapshot (cognitive 18) src/services/relay/droidRelayService.js:896— _normalizeUsageSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: other 7, boolean chains 6, if/else 5. Of this number, 14 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
markAccountTempError (cognitive 18) src/services/account/claudeAccountService.js:2932— markAccountTempError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 4 (5 pts), boolean chains 3 (nesting depth added 4). Of this number, 9 points are the body's own statements and 9 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.
createAccount (cognitive 18) src/services/account/azureOpenaiAccountService.js:113— createAccount has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 4 (5 pts), if/else 2 (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.
ClaudeAccountService.buildClaudeUsageSnapshot (cognitive 17) src/services/account/claudeAccountService.js:2177— ClaudeAccountService.buildClaudeUsageSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (4 pts), ternaries 4, error handling 1 (2 pts) (nesting depth added 2). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
grokHelper.describeTokenError (cognitive 17) src/utils/grokHelper.js:703— grokHelper.describeTokenError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedisClient.getAccountDailyCost (cognitive 17) REDACTED:1959— RedisClient.getAccountDailyCost has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), loops 2 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UserService.getAllUsers (cognitive 17) REDACTED:193— UserService.getAllUsers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 4, error handling 2 (4 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.
ClaudeCodeValidator.validate (cognitive 17) src/validators/clients/claudeCodeValidator.js:128— ClaudeCodeValidator.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 pts), 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.
auth.errorHandler (cognitive 17) REDACTED:1925— auth.errorHandler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, ternaries 3, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedGeminiScheduler._isAccountAvailable (cognitive 17) src/services/scheduler/unifiedGeminiScheduler.js:478— UnifiedGeminiScheduler._isAccountAvailable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 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.
apiKeys.router.post("/api-keys/batch-stats") (cognitive 17) REDACTED:959— apiKeys.router.post("/api-keys/batch-stats") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 4). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claudeAccounts.router.get("/claude-accounts/usage") (cognitive 17) src/routes/admin/claudeAccounts.js:536— claudeAccounts.router.get("/claude-accounts/usage") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 543, 592). 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.
QuotaCardService.createCard (cognitive 17) src/services/quotaCardService.js:88— QuotaCardService.createCard has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, if/else 3, error handling 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.
web.router.post("/auth/change-password") (cognitive 17) src/routes/web.js:137— web.router.post("/auth/change-password") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 2, 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.
userRoutes.router.post("/login") (cognitive 17) REDACTED:52— userRoutes.router.post("/login") has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 6, boolean chains 5 (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.
handleChatCompletion::usageCallback (cognitive 17) REDACTED:280— handleChatCompletion::usageCallback has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (5 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
authenticateAdmin (cognitive 17) REDACTED:1360— authenticateAdmin has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5, error handling 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleModels (cognitive 17) REDACTED:825— handleModels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 3 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). 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: 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.
ApiKeyIndexService.addToIndex (cognitive 16) src/services/apiKeyIndexService.js:255— ApiKeyIndexService.addToIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 3, error handling 1, 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.
WebhookConfigService.validateConfig (cognitive 16) src/services/webhookConfigService.js:69— WebhookConfigService.validateConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeAccountService.isAccountRateLimited (cognitive 16) src/services/account/claudeAccountService.js:1775— ClaudeAccountService.isAccountRateLimited has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockRelayService._convertToBedrockFormat (cognitive 16) src/services/relay/bedrockRelayService.js:657— BedrockRelayService._convertToBedrockFormat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
grokQuota.formatWindow (cognitive 16) src/utils/grokQuota.js:351— grokQuota.formatWindow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 7, if/else 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.
GrokAccountService.refreshAccountToken (cognitive 16) src/services/account/grokAccountService.js:373— GrokAccountService.refreshAccountToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CostCalculator.buildDetailedPricingResult (cognitive 16) src/utils/costCalculator.js:144— CostCalculator.buildDetailedPricingResult has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. 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.
RedisClient.batchGetAccountRollingUsage (cognitive 16) REDACTED:2250— RedisClient.batchGetAccountRollingUsage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), loops 2 (nesting depth added 1). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. 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.
RequestDetailService._loadRequestPointersInRange (cognitive 16) src/services/requestDetailService.js:785— RequestDetailService._loadRequestPointersInRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (5 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
anthropicGeminiBridgeService.buildToolUseIdToNameMap (cognitive 16) src/services/anthropicGeminiBridgeService.js:181— anthropicGeminiBridgeService.buildToolUseIdToNameMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
anthropicGeminiBridgeService.sanitizeToolResultBlocksForAntigravity (cognitive 16) src/services/anthropicGeminiBridgeService.js:466— anthropicGeminiBridgeService.sanitizeToolResultBlocksForAntigravity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.isOldSession (cognitive 16) REDACTED:84— api.isOldSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). Of this number, 13 points are the body's own statements and 3 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.
OpenAIToClaudeConverter._convertClaudeMessage (cognitive 16) src/services/openaiToClaude.js:345— OpenAIToClaudeConverter._convertClaudeMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
geminiHandlers.handleRetrieveUserQuota (cognitive 16) REDACTED:1340— geminiHandlers.handleRetrieveUserQuota has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 5, if/else 4, 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.
apiKeys.router.post("/api-keys/batch-last-usage") (cognitive 16) REDACTED:1383— apiKeys.router.post("/api-keys/batch-last-usage") has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, error handling 2. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1411). 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.
droidAccounts.router.get("/droid-accounts/:id") (cognitive 16) src/routes/admin/droidAccounts.js:479— droidAccounts.router.get("/droid-accounts/:id") has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), error handling 4 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 517, 552). 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.
DroidRelayService._normalizeRequestBody (cognitive 16) src/services/relay/droidRelayService.js:57— DroidRelayService._normalizeRequestBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
apiKeys.useApiKeysStore (cognitive 16) web/admin-spa/src/stores/apiKeys.js:6— apiKeys.useApiKeysStore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, ternaries 2. Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 14, 22, 31, …). 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.
extractAnthropicReasoningInfo (cognitive 16) REDACTED:147— extractAnthropicReasoningInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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.
_normalizeRecord (cognitive 16) src/services/requestDetailService.js:697— _normalizeRecord has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, if/else 1, other 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.
validateAndNormalizeRules (cognitive 16) src/services/requestBodyRuleService.js:74— validateAndNormalizeRules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
incrementTokenUsage (cognitive 16) REDACTED:1068— incrementTokenUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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.
getEnabledTestAccounts (cognitive 16) REDACTED:4853— getEnabledTestAccounts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), boolean chains 4, loops 3 (4 pts), error handling 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.
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.
Duplication concentrated across 7 sibling directories (46 clone groups) REDACTED:154— 46 duplicated blocks under src/ have copies in at least two of the sibling directories handlers, middleware, models, routes, services, utils (+1 more sibling(s) not listed) — 38 of them are reported below, and 8 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 46 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 46 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 46 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.
Duplication concentrated across 4 sibling directories (29 clone groups) web/admin-spa/src/components/apistats/StatsOverview.vue:478— 29 duplicated blocks under web/admin-spa/src/ have copies in at least two of the sibling directories components, stores, utils, views — 23 of them are reported below, and 6 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 29 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 29 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 29 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.
Duplication concentrated across 4 sibling directories (14 clone groups) src/routes/admin/dashboard.js:35— 14 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, scripts, src, web — 8 of them are reported below, and 6 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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.
Duplication concentrated across 5 sibling directories (12 clone groups) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216— 12 duplicated blocks under web/admin-spa/src/components/ have copies in at least two of the sibling directories accounts, admin, apikeys, apistats, user — 9 of them are reported below, and 3 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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.
Duplication concentrated across 4 sibling directories (6 clone groups) src/services/account/claudeAccountService.js:2899— 6 duplicated blocks under src/services/ have copies in at least two of the sibling directories account, balanceProviders, relay, scheduler — 2 of them are reported below, and 4 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 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 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 6 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 (457 matched lines × 2 locations) · ×1
Duplicated block with local edits (457 matched lines × 2 locations) src/services/relay/ccrRelayService.js:59— src/services/relay/ccrRelayService.js:59 · src/services/relay/claudeConsoleRelayService.js:69 — the two spans are one implementation copied and then locally edited — 2434 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 (295 matched lines × 2 locations) · ×1
Duplicated block with local edits (295 matched lines × 2 locations) REDACTED:10— REDACTED:10 · REDACTED:19 — the two spans are one implementation copied and then locally edited — 2065 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 (283 matched lines × 2 locations) · ×1
Duplicated block with local edits (283 matched lines × 2 locations) REDACTED:17— REDACTED:17 · src/routes/admin/claudeConsoleAccounts.js:20 — the two spans are one implementation copied and then locally edited — 1955 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 (207 matched lines × 2 locations) · ×1
Duplicated block with local edits (207 matched lines × 2 locations) REDACTED:566— REDACTED:566 · REDACTED:530 — the two spans are one implementation copied and then locally edited — 1200 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 (202 matched lines × 2 locations) · ×1
Duplicated block with local edits (202 matched lines × 2 locations) REDACTED:211— REDACTED:211 · REDACTED:107 — the two spans are one implementation copied and then locally edited — 1474 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 (192 matched lines × 2 locations) · ×1
Duplicated block with local edits (192 matched lines × 2 locations) src/services/account/azureOpenaiAccountService.js:117— src/services/account/azureOpenaiAccountService.js:117 · REDACTED:457 — the two spans are one implementation copied and then locally edited — 1146 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 (180 matched lines × 2 locations) · ×1
Duplicated block with local edits (180 matched lines × 2 locations) src/routes/admin/droidAccounts.js:341— src/routes/admin/droidAccounts.js:341 · src/routes/admin/geminiAccounts.js:291 — the two spans are one implementation copied and then locally edited — 1132 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 (179 matched lines × 2 locations) · ×1
Duplicated block with local edits (179 matched lines × 2 locations) src/services/account/geminiApiAccountService.js:365— src/services/account/geminiApiAccountService.js:365 · src/services/account/openaiResponsesAccountService.js:326 — the two spans are one implementation copied and then locally edited — 1056 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 (167 matched lines × 2 locations) · ×1
Duplicated block with local edits (167 matched lines × 2 locations) src/services/scheduler/unifiedClaudeScheduler.js:1318— src/services/scheduler/unifiedClaudeScheduler.js:1318 · src/services/scheduler/unifiedOpenAIScheduler.js:636 — the two spans are one implementation copied and then locally edited — 778 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 (159 matched lines × 2 locations) · ×1
Duplicated block with local edits (159 matched lines × 2 locations) src/services/account/ccrAccountService.js:567— src/services/account/ccrAccountService.js:567 · src/services/account/claudeConsoleAccountService.js:1244 — the two spans are one implementation copied and then locally edited — 840 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 (145 matched lines × 2 locations) · ×1
Duplicated block with local edits (145 matched lines × 2 locations) REDACTED:21— REDACTED:21 · REDACTED:47 — the two spans are one implementation copied and then locally edited — 864 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 (144 matched lines × 2 locations) · ×1
Duplicated block with local edits (144 matched lines × 2 locations) src/services/relay/claudeConsoleRelayService.js:106— src/services/relay/claudeConsoleRelayService.js:106 · src/services/relay/claudeConsoleRelayService.js:576 — the two spans are one implementation copied and then locally edited — 805 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 (133 matched lines × 2 locations) · ×1
Duplicated block with local edits (133 matched lines × 2 locations) src/services/account/geminiApiAccountService.js:54— src/services/account/geminiApiAccountService.js:54 · src/services/account/openaiResponsesAccountService.js:68 — the two spans are one implementation copied and then locally edited — 806 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 (130 matched lines × 2 locations) · ×1
Duplicated block with local edits (130 matched lines × 2 locations) web/admin-spa/src/views/AccountUsageRecordsView.vue:309— web/admin-spa/src/views/AccountUsageRecordsView.vue:309 · web/admin-spa/src/views/ApiKeyUsageRecordsView.vue:302 — the two spans are one implementation copied and then locally edited — 859 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (121 lines × 2 locations) src/utils/oauthHelper.js:167— src/utils/oauthHelper.js:167 · src/utils/oauthHelper.js:387 — 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 (120 matched lines × 2 locations) · ×1
Duplicated block with local edits (120 matched lines × 2 locations) src/services/account/claudeConsoleAccountService.js:543— src/services/account/claudeConsoleAccountService.js:543 · src/services/account/claudeConsoleAccountService.js:845 — the two spans are one implementation copied and then locally edited — 574 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 (99 matched lines × 2 locations) · ×1
Duplicated block with local edits (99 matched lines × 2 locations) REDACTED:289— REDACTED:289 · REDACTED:1001 — the two spans are one implementation copied and then locally edited — 428 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.
Duplicated block (91 lines × 2 locations) REDACTED:2213— REDACTED:2213 · REDACTED:2508 — 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 (87 matched lines × 2 locations) · ×1
Duplicated block with local edits (87 matched lines × 2 locations) src/services/scheduler/droidScheduler.js:41— src/services/scheduler/droidScheduler.js:41 · src/services/scheduler/grokScheduler.js:21 — the two spans are one implementation copied and then locally edited — 472 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (83 lines × 2 locations) REDACTED:1549— REDACTED:1549 · REDACTED:1792 — 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 (77 matched lines × 2 locations) · ×1
Duplicated block with local edits (77 matched lines × 2 locations) src/services/account/claudeAccountService.js:1235— src/services/account/claudeAccountService.js:1235 · src/services/account/claudeConsoleAccountService.js:1104 — the two spans are one implementation copied and then locally edited — 431 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 (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195— web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195 · web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:149 — the two spans are one implementation copied and then locally edited — 321 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (65 lines × 2 locations) scripts/data-transfer-enhanced.js:832— scripts/data-transfer-enhanced.js:832 · scripts/data-transfer.js:446 — 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 (64 lines × 2 locations) web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011— web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011 · web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1059 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (63 matched lines × 2 locations) · ×1
Duplicated block with local edits (63 matched lines × 2 locations) REDACTED:1555— REDACTED:1555 · src/routes/admin/claudeRelayConfig.js:59 — the two spans are one implementation copied and then locally edited — 339 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (58 lines × 2 locations) src/services/account/bedrockAccountService.js:789— src/services/account/bedrockAccountService.js:789 · REDACTED:1502 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (55 lines × 2 locations) src/routes/admin/claudeAccounts.js:104— src/routes/admin/claudeAccounts.js:104 · src/routes/admin/claudeAccounts.js:226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Boundary violation [package:third-party-deep-import] web/admin-spa/src/main.js:4— web/admin-spa/src/main.js:4 imports element-plus/dist/locale/zh-cn.mjs, 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.
Complex function createAccount (cyclomatic 172, cognitive 230) web/admin-spa/src/components/accounts/AccountForm.vue:5492— createAccount has cyclomatic complexity 172 and cognitive complexity 230; 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.
Complex function handleMessagesRequest (cyclomatic 157, cognitive 282) REDACTED:137— handleMessagesRequest has cyclomatic complexity 157 and cognitive complexity 282; 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.
Complex function updateAccount (cyclomatic 155, cognitive 207) web/admin-spa/src/components/accounts/AccountForm.vue:5940— updateAccount has cyclomatic complexity 155 and cognitive complexity 207; 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.
Complex function createAccount (cyclomatic 130, cognitive 158) REDACTED:458— createAccount has cyclomatic complexity 130 and cognitive complexity 158; 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.
Complex function updateAccount (cyclomatic 122, cognitive 170) REDACTED:836— updateAccount has cyclomatic complexity 122 and cognitive complexity 170; 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.
Complex function handleResponses (cyclomatic 119, cognitive 167) REDACTED:293— handleResponses has cyclomatic complexity 119 and cognitive complexity 167; 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.
Complex function (anonymous) (cyclomatic 119, cognitive 148) REDACTED:101— (anonymous) has cyclomatic complexity 119 and cognitive complexity 148; 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.
Complex function handleOAuthSuccess (cyclomatic 115, cognitive 143) web/admin-spa/src/components/accounts/AccountForm.vue:5236— handleOAuthSuccess has cyclomatic complexity 115 and cognitive complexity 143; 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.
Complex function relayRequest (cyclomatic 111, cognitive 210) src/services/relay/claudeRelayService.js:480— relayRequest has cyclomatic complexity 111 and cognitive complexity 210; 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.
Complex function authenticateApiKey (cyclomatic 109, cognitive 183) REDACTED:440— authenticateApiKey has cyclomatic complexity 109 and cognitive complexity 183; 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.
Complex function (anonymous) (cyclomatic 106, cognitive 139) REDACTED:2108— (anonymous) has cyclomatic complexity 106 and cognitive complexity 139; 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.
Complex function _getAllAvailableAccounts (cyclomatic 102, cognitive 194) src/services/scheduler/unifiedClaudeScheduler.js:515— _getAllAvailableAccounts has cyclomatic complexity 102 and cognitive complexity 194; 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.
Complex function (anonymous) (cyclomatic 101, cognitive 211) REDACTED:1247— (anonymous) has cyclomatic complexity 101 and cognitive complexity 211; 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.
Complex function importData (cyclomatic 96, cognitive 253) scripts/data-transfer-enhanced.js:835— importData has cyclomatic complexity 96 and cognitive complexity 253; 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.
Complex function (anonymous) (cyclomatic 96, cognitive 194) REDACTED:1825— (anonymous) has cyclomatic complexity 96 and cognitive complexity 194; 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.
Complex function relayRequest (cyclomatic 94, cognitive 149) src/services/relay/claudeConsoleRelayService.js:23— relayRequest has cyclomatic complexity 94 and cognitive complexity 149; 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.
Complex function handleRequest (cyclomatic 91, cognitive 186) REDACTED:68— handleRequest has cyclomatic complexity 91 and cognitive complexity 186; 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.
Complex function recordUsageWithDetails (cyclomatic 85, cognitive 87) src/services/apiKeyService.js:1862— recordUsageWithDetails has cyclomatic complexity 85 and cognitive complexity 87; 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.
Complex function (anonymous) (cyclomatic 83, cognitive 98) REDACTED:2708— (anonymous) has cyclomatic complexity 83 and cognitive complexity 98; 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.
Complex function handleAnthropicMessagesToGemini (cyclomatic 81, cognitive 112) src/services/anthropicGeminiBridgeService.js:1859— handleAnthropicMessagesToGemini has cyclomatic complexity 81 and cognitive complexity 112; 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.
No typecheck script — test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
Dead file (~7079 LoC) web/admin-spa/src/components/accounts/AccountForm.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~5758 LoC) web/admin-spa/src/views/AccountsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~4917 LoC) web/admin-spa/src/views/ApiKeysView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~3208 LoC) web/admin-spa/src/views/SettingsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~1816 LoC) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~1812 LoC) web/admin-spa/src/views/DashboardView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~1668 LoC) web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~1290 LoC) web/admin-spa/src/components/accounts/OAuthFlow.vue— no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~1070 LoC) web/admin-spa/src/views/QuotaCardsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~1053 LoC) web/admin-spa/src/views/RequestDetailsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~972 LoC) web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~880 LoC) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue— no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~832 LoC) web/admin-spa/src/views/ApiStatsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~748 LoC) web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~691 LoC) web/admin-spa/src/components/common/AccountSelector.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~651 LoC) web/admin-spa/src/views/UserManagementView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~625 LoC) web/admin-spa/src/stores/apistats.js— no import path from any entry point (23 application, 25 tooling, 33 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 (~604 LoC) web/admin-spa/src/components/common/UnifiedTestModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~567 LoC) web/admin-spa/src/views/AccountUsageRecordsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~549 LoC) scripts/test-group-scheduling.js— no import path from any entry point (23 application, 25 tooling, 33 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 (~541 LoC) web/admin-spa/src/views/ApiKeyUsageRecordsView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~538 LoC) web/admin-spa/src/components/apistats/StatsOverview.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~523 LoC) web/admin-spa/src/components/layout/AppHeader.vue— no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/layout/MainLayout.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~515 LoC) web/admin-spa/src/components/accounts/GroupManagementModal.vue— no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~494 LoC) web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~477 LoC) web/admin-spa/src/components/apikeys/ExpiryEditModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~473 LoC) web/admin-spa/src/components/admin/RequestDetailModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~438 LoC) web/admin-spa/src/components/apikeys/UsageDetailModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~418 LoC) web/admin-spa/src/components/accounts/CcrAccountForm.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~416 LoC) web/admin-spa/src/components/apistats/LimitConfig.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~414 LoC) web/admin-spa/src/components/accounts/ProxyConfig.vue— no import path from any entry point (23 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~411 LoC) web/admin-spa/src/views/UserDashboardView.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~401 LoC) web/admin-spa/src/components/admin/UserUsageStatsModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~399 LoC) web/admin-spa/src/stores/theme.js— no import path from any entry point (23 application, 25 tooling, 33 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 (~397 LoC) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~391 LoC) web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~383 LoC) web/admin-spa/src/components/user/UserUsageStats.vue— no import path from any entry point (23 application, 25 tooling, 33 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 (~370 LoC) web/admin-spa/src/utils/http_apis.js— no import path from any entry point (23 application, 25 tooling, 33 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 (~366 LoC) web/admin-spa/src/stores/accounts.js— no import path from any entry point (23 application, 25 tooling, 33 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
Unused dependency 'morgan' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'unplugin-element-plus' — Declared in web/admin-spa/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'xlsx' — Declared in web/admin-spa/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Duplicated predicate src/services/requestBodyRuleService.js:165— `!body || typeof body !== 'object' || Array.isArray(body)` appears character-identically in 2 files — src/services/requestBodyRuleService.js, src/utils/grokHelper.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:1163— `(await client.get(requestCountKey)) || '0'` appears character-identically in 3 files — REDACTED, REDACTED, src/services/apiKeyService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:1164— `(await client.get(tokenCountKey)) || '0'` appears character-identically in 3 files — REDACTED, REDACTED, src/services/apiKeyService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/services/balanceProviders/geminiBalanceProvider.js:194— `account && Object.prototype.hasOwnProperty.call(account, 'dailyQuota')` appears character-identically in 2 files — src/services/balanceProviders/geminiBalanceProvider.js, src/services/balanceProviders/genericBalanceProvider.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:904— `account && account.isActive === 'true' && !isRateLimited(account) && !isSubscriptionExpired(account)` appears character-identically in 2 files — REDACTED, 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 REDACTED:857— `account && account.isActive === 'true' && !isTokenExpired(account)` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/services/relay/ccrRelayService.js:198— `account.apiKey && account.apiKey.startsWith('sk-ant-')` appears character-identically in 2 files — src/services/relay/ccrRelayService.js, src/services/relay/claudeConsoleRelayService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/services/relay/ccrRelayService.js:108— `account.supportedModels && typeof account.supportedModels === 'object' && !Array.isArray(account.supportedModels)` appears character-identically in 2 files — src/services/relay/ccrRelayService.js, src/services/relay/claudeConsoleRelayService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:140— `accountType && !['shared', 'dedicated', 'group'].includes(accountType)` appears character-identically in 4 files — REDACTED, src/routes/admin/claudeAccounts.js, src/routes/admin/claudeConsoleAccounts.js, 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 scripts/data-transfer-enhanced.js:34— `answer.toLowerCase() === 'yes' || answer.toLowerCase() === 'y'` appears character-identically in 3 files — scripts/data-transfer-enhanced.js, scripts/data-transfer.js, scripts/migrate-apikey-expiry.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:155— `candidate.finishReason?.toLowerCase() || 'stop'` appears character-identically in 2 files — REDACTED, src/services/relay/geminiRelayService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:476— `item.type === 'message' && Array.isArray(item.content)` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app.js:732— `key.startsWith('concurrency:queue:stats:') || key.startsWith('concurrency:queue:wait_times:') || (key.startsWith('concurrency:queue:') && !k…` appears character-identically in 2 files — src/app.js, 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 REDACTED:200— `mappedUpdates.accountType && !['shared', 'dedicated', 'group'].includes(mappedUpdates.accountType)` appears character-identically in 4 files — REDACTED, src/routes/admin/claudeAccounts.js, src/routes/admin/claudeConsoleAccounts.js, src/routes/admin/openaiAccounts.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:1055— `model.includes('.anthropic.') || model.includes('.claude')` appears character-identically in 4 files — REDACTED, src/routes/admin/dashboard.js, REDACTED, src/utils/commonHelper.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/utils/anthropicRequestDump.js:15— `raw === '1' || raw.toLowerCase() === 'true'` appears character-identically in 2 files — src/utils/anthropicRequestDump.js, src/utils/anthropicResponseDump.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/routes/admin/claudeAccounts.js:546— `scopes.includes('user:profile') && scopes.includes('user:inference')` appears character-identically in 3 files — src/routes/admin/claudeAccounts.js, src/routes/admin/sync.js, src/services/account/claudeAccountService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:1587— `totalCostLimit !== undefined && totalCostLimit !== null && totalCostLimit !== '' && (Number.isNaN(Number(totalCostLimit)) || Number(totalCos…` appears character-identically in 2 files — REDACTED, 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 REDACTED:1350— `typeof account.authenticationMethod === 'string' && account.authenticationMethod.toLowerCase().trim() === 'api_key'` appears character-identically in 2 files — REDACTED, src/services/relay/droidRelayService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/update-model-pricing.js:115— `typeof jsonData !== 'object' || Object.keys(jsonData).length === 0` appears character-identically in 2 files — scripts/update-model-pricing.js, src/services/pricingService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/services/account/ccrAccountService.js:578— `typeof supportedModels === 'object' && !Array.isArray(supportedModels)` appears character-identically in 2 files — src/services/account/ccrAccountService.js, src/services/account/claudeConsoleAccountService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:870— `typeof value === 'string' && value.trim()` appears character-identically in 2 files — REDACTED, src/services/pricingService.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/data-transfer-enhanced.js:535— `types.includes('all') || types.includes('accounts')` appears character-identically in 2 files — scripts/data-transfer-enhanced.js, scripts/data-transfer.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/data-transfer-enhanced.js:613— `types.includes('all') || types.includes('admins')` appears character-identically in 2 files — scripts/data-transfer-enhanced.js, scripts/data-transfer.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/data-transfer-enhanced.js:506— `types.includes('all') || types.includes('apikeys')` appears character-identically in 2 files — scripts/data-transfer-enhanced.js, scripts/data-transfer.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Hand-rolled JSON/XML parsing via regex REDACTED:299— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:304— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:310— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:319— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:320— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:342— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:343— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Silent fallback default in catch src/services/apiKeyIndexService.js:602— `_getAvailableTags` 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 src/services/account/claudeConsoleAccountService.js:1216— `_maskApiUrl` 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 src/utils/safeRotatingAppend.js:42— `getFileSize` swallows every exception into `return 0` — 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 src/services/apiKeyService.js:158— `parseOpenAIResponsesPayloadRules` 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 src/services/anthropicGeminiBridgeService.js:226— `normalizeToolUseInput` 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.
Documentation: no architecture or design documentation README.md— The README contains no architecture or design documentation despite a strong project-level overview. Add an Architecture section describing how the relay, CRS, and Gemini account integration fit together.
Documentation: no licence statement README.md— The README contains no licence statement in the document. Add a License section noting that this is an MIT licensed self-hosted service.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 4 significant file(s) lose their only recent owner: src/services/requestDetailService.js, web/admin-spa/src/views/RequestDetailsView.vue, web/admin-spa/src/components/admin/RequestDetailModal.vue, src/routes/admin/requestDetails.js. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 11 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (19 single-owned of 234 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 234 of the 267 production source files in this repository met that bar). They are anonymized user #2 (3 file(s)), anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) (+5 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (96839 LoC, 204 public types across 17 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 26 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/services/geminiToOpenAI.js, web/admin-spa/src/views/ApiKeyUsageRecordsView.vue, src/utils/geminiSchemaCleaner.js, web/admin-spa/src/components/settings/ModelPricingSection.vue, src/routes/admin/quotaCards.js, src/services/billingEventPublisher.js, src/services/balanceProviders/geminiBalanceProvider.js, web/admin-spa/src/views/BalanceScriptsView.vue (and 18 more) (30 orphaned of 234 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 234 of the 267 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 31168 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
Outdated (npm): @aws-sdk/client-bedrock-runtime — @aws-sdk/client-bedrock-runtime is pinned at 3.943.0; registry.npmjs.org publishes 3.1145.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @aws-sdk/credential-providers — @aws-sdk/credential-providers is pinned at 3.943.0; registry.npmjs.org publishes 3.1145.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @fortawesome/fontawesome-free — @fortawesome/fontawesome-free is pinned at 6.7.2; registry.npmjs.org publishes 7.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): axios — axios is pinned at 1.13.2; registry.npmjs.org publishes 1.20.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): bcryptjs — bcryptjs is pinned at 2.4.3; registry.npmjs.org publishes 3.0.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): chalk — chalk is pinned at 4.1.2; registry.npmjs.org publishes 6.0.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): chart.js — chart.js is pinned at 4.5.0; registry.npmjs.org publishes 4.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): commander — commander is pinned at 11.1.0; registry.npmjs.org publishes 15.0.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): compression — compression is pinned at 1.8.1; registry.npmjs.org publishes 1.8.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): cors — cors is pinned at 2.8.5; registry.npmjs.org publishes 2.8.6 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): dayjs — dayjs is pinned at 1.11.13; registry.npmjs.org publishes 1.11.23 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): dotenv — dotenv is pinned at 16.6.1; registry.npmjs.org publishes 18.0.5 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): element-plus — element-plus is pinned at 2.10.4; registry.npmjs.org publishes 2.14.7 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): express — express is pinned at 4.22.1; registry.npmjs.org publishes 5.2.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): google-auth-library — google-auth-library is pinned at 10.5.0; registry.npmjs.org publishes 11.1.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): helmet — helmet is pinned at 7.2.0; registry.npmjs.org publishes 8.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): https-proxy-agent — https-proxy-agent is pinned at 7.0.6; registry.npmjs.org publishes 9.1.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): inquirer — inquirer is pinned at 8.2.7; registry.npmjs.org publishes 14.2.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): ioredis — ioredis is pinned at 5.8.2; registry.npmjs.org publishes 6.0.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): morgan — morgan is pinned at 1.10.1; registry.npmjs.org publishes 1.12.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): node-cron — node-cron is pinned at 4.2.1; registry.npmjs.org publishes 4.6.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): nodemailer — nodemailer is pinned at 7.0.11; registry.npmjs.org publishes 10.0.13 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): ora — ora is pinned at 5.4.1; registry.npmjs.org publishes 9.4.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): pinia — pinia is pinned at 2.3.1; registry.npmjs.org publishes 4.0.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): rate-limiter-flexible — rate-limiter-flexible is pinned at 5.0.5; registry.npmjs.org publishes 11.2.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
+ 6 more in this group — see findings.md.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
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.
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.
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.
Run 01a0f9e2-10a7-74ea-b5b4-309f762d94ae · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 178 · Warnings: 1311 · Recommendations: 60 · Info: 31 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 01-10-2026 @ 23:52 UTC.
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.