Public report of Wei-Shaw/claude-relay-service, published 30 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 30 October 2026, 00:10 UTC · Survey ID cd_03f9f26f77c6410fac8aad13ab2acf99
Wei-Shaw/claude-relay-service
Measured 30 October 2026, 00:08 UTC, at code version cf95ecc
Regression: 2 dimensions fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAt riskDown 1 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 151,099 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Code Health, 15
Findings by how serious they are
229 critical1496 serious259 minor
5 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
30 October 2026, 00:08 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
87of 87 dimensions measured by tools.
1934of 1984 findings point to an exact file and line, so you can open each one in the code. The other 50 concern the repository as a whole, such as missing documentation.
87dimensions across 7 lenses, read from 151,099 lines of product code in 2 projects.
Wei-Shaw/claude-relay-service is rated At risk because critical security findings are open. It scores 28 out of 100, which the At risk rating leaves unchanged.
Code Health, at 15, is the weakest lens and counts most in the score. The best first step is replacing the nine exposed passwords or keys and switching the old ones off, worth about 5 points. Adding type checking would lift Code Health itself, worth about 3 points. Raising Code Health to 70 would lift the score to about 39.
Sixty-one known security holes in the packages the code depends on can be used by attackers. Thirty-eight weaknesses in the code could be used by an attacker, and fifteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Updating the vulnerable packages, fixing the weaknesses the scanner points to and pinning each tool to an exact version would close these risks. Loading the key from a secret store instead of the code would fix the nine encryption keys written into the code, and the nine passwords or keys in the code and the seven passwords or keys in the code's history need replacing, with the old ones switched off. The 25 controls that only work with a mouse need to work with the keyboard, or to become a real button.
The product code is 151,099 lines, about €140,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 15 to 70, the lowest score rated Strong, the score would rise from 28 to about 39.
Code composition: what the lines of code are
Product code 95%Tests 5%
New since the last survey: 195 findings
These 195 critical or serious findings weren't in the previous survey, on 15 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 1245 findings
These 1245 critical or serious findings were in the previous survey, on 15 October 2026, and are gone from this one. The first 100 are listed here.
€45,000 to €230,000, for 748 to 2,372 hours of work, about 0.9 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 28. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 151,099 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED (2), REDACTED (2).
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Files that change often carry extra risk · Combined risk
2 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (9 files) · Code Coverage (8 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: unified.js and REDACTED
What to do: Add tests to these files and have a second person review every change to them, starting with unified.js and REDACTED.
Where the investment is most exposed · Value at risk
This code would cost about €140,000 to build again, about 0.9 person-years of work. Its weakest lens is Code Health, at 15 (Critical). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 9 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.6 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 10,411 lines over the last 90 days, which is about 42,222 lines a year. At that pace, the extra work comes to an estimated 6.3 to 37.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
94 modules, with 5 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 54 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
src.services.balanceProviders.claudeBalanceProvider uses src.services.balanceProviders.baseBalanceProvider, so a change to src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.claudeBalanceProvider, while a change to src.services.balanceProviders.claudeBalanceProvider can't break src.services.balanceProviders.baseBalanceProvider.
Position
Below the diagonal: src.services.balanceProviders.claudeBalanceProvider uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in src.services.balanceProviders.claudeConsoleBalanceProvider uses a type in src.services.balanceProviders.baseBalanceProvider.
src.services.balanceProviders.claudeConsoleBalanceProvider uses src.services.balanceProviders.baseBalanceProvider, so a change to src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.claudeConsoleBalanceProvider, while a change to src.services.balanceProviders.claudeConsoleBalanceProvider can't break src.services.balanceProviders.baseBalanceProvider.
Position
Below the diagonal: src.services.balanceProviders.claudeConsoleBalanceProvider uses a module listed above it, which is the healthy direction.
src.services.balanceProviders.geminiBalanceProvider uses src.services.balanceProviders.baseBalanceProvider, so a change to src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.geminiBalanceProvider, while a change to src.services.balanceProviders.geminiBalanceProvider can't break src.services.balanceProviders.baseBalanceProvider.
Position
Below the diagonal: src.services.balanceProviders.geminiBalanceProvider uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in src.services.balanceProviders.genericBalanceProvider uses a type in src.services.balanceProviders.baseBalanceProvider.
src.services.balanceProviders.genericBalanceProvider uses src.services.balanceProviders.baseBalanceProvider, so a change to src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.genericBalanceProvider, while a change to src.services.balanceProviders.genericBalanceProvider can't break src.services.balanceProviders.baseBalanceProvider.
Position
Below the diagonal: src.services.balanceProviders.genericBalanceProvider uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in src.services.balanceProviders.openaiResponsesBalanceProvider uses a type in src.services.balanceProviders.baseBalanceProvider.
src.services.balanceProviders.openaiResponsesBalanceProvider uses src.services.balanceProviders.baseBalanceProvider, so a change to src.services.balanceProviders.baseBalanceProvider can break src.services.balanceProviders.openaiResponsesBalanceProvider, while a change to src.services.balanceProviders.openaiResponsesBalanceProvider can't break src.services.balanceProviders.baseBalanceProvider.
Position
Below the diagonal: src.services.balanceProviders.openaiResponsesBalanceProvider uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 15% · Critical · gated by D1, D2, R1, R2, R3, R7, X4 ·
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
A05:2025 — Injection
103
High / Critical
A03:2025 — Software Supply Chain Failures
93
High / Critical
A07:2025 — Authentication Failures
17
High / Critical
A02:2025 — Security Misconfiguration
9
High / Critical
A01:2025 — Broken Access Control
2
Medium
Roadmap
Immediately resolve the nine leaked secrets in data-transfer and geminiAccountService files to secure the codebase. Next, address the twenty-one deprecated dependencies in REDACTED to ensure system stability. Then, refactor the twenty-two high-complexity functions, starting with handleMessagesRequest, to improve maintainability and reduce technical debt. Finally, introduce TypeScript type checking to the frontend build process to establish a foundation for safer code development.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED (2), REDACTED (2).
Bring the 222 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with handleMessagesRequest (cyclomatic 225), api.handleMessagesRequest (cyclomatic 221), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177).
Bring the 306 bodies over 30 down to 30 or less in Cognitive Complexity — start with handleMessagesRequest (cognitive 406), api.handleMessagesRequest (cognitive 388), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320).
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.
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 — 229
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 — 1496
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 — 259
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 5
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. 87 of 87 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 87 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, 1934 of 1984 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.
D8 Code 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. 11 test file(s) failed while being loaded here, so none of their cases ran (typically a native addon or generated module the package's install scripts build, which the analyzer's scripts-off install does not run). The 10 production file(s) those files import that read under half covered are unmeasured in this run, not untested, so their figures are left out of the per-file rows and the 34.2% rather than published as low coverage. You can widen what we reach: optional: commit the lcov report of a run where those test files load, and their modules are read from it.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
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.
AC6 Visual & motion safety — 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. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — time="2026-10-30T00:09:10Z" level=warning msg="The \"JWT_SECRET\" variable is not set. Defaulting to a blank string." time="2026-10-30T00:09:10Z" level=warning msg="The \"ENCRYPTION_KEY\" variable is not set. Defaulting to a blank string." container .-claude-relay-1 is unhealthy; runtime evidence skipped.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
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.
R3 Large Files — 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. 64 further occurrence(s) are not listed individually; the score already reflects all 104.
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.
X23 Unguarded diagnostic materialisation — 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. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
X3 Exception handling — 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. 127 further occurrence(s) are not listed individually; the score already reflects all 167.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1691 further occurrence(s) are not listed individually; the score already reflects all 1731.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Vue components is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
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.
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.
610 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was handleMessagesRequest at 225. A further 5 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.
+ 350 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 222 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with handleMessagesRequest (cyclomatic 225), api.handleMessagesRequest (cyclomatic 221), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 222 together lifts Cyclomatic Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
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.
+ 416 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 306 bodies over 30 down to 30 or less in Cognitive Complexity — start with handleMessagesRequest (cognitive 406), api.handleMessagesRequest (cognitive 388), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 306 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
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 Classes7.5 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 57 FunctionTooLong finding(s) in God Classes — start with REDACTED (8), REDACTED (6), REDACTED (5). — One of this dimension's main actionable groups (57 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 Coverage7.0 / 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 34.2% — 8 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 · ×8REDACTED:1
What to do
Resolve the 8 Low coverage finding(s) in Code Coverage — start with REDACTED, unified.js, REDACTED. — One of this dimension's main actionable groups (8 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 for currency: that grade is about what SHIPS. 5 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. 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.
Resolve the 21 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (21). — One of this dimension's main actionable groups (21 recommendation-level).
Resolve the 6 Deprecated finding(s) in Dependency Hygiene — start with package.json (6). — One of this dimension's main actionable groups (6 warning-level).
Resolve the 6 Outdated (npm) finding(s) in Dependency Hygiene — start with package.json (6). — One of this dimension's main actionable groups (6 recommendation-level).
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 9 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (9 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 9 Hotspot finding(s) in Churn × Complexity Hotspots — start with AccountForm.vue, claudeRelayService.js, unified.js. — One of this dimension's main actionable groups (9 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.2 / 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.
17 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 · ×2
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 5 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.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.
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.
7 finding(s): 0 critical, 7 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
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 3 High secret finding(s) in Secrets (history) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 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).
103 finding(s): 0 critical, 59 high, 44 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/manage.sh` (line 372), `REDACTED`, `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
+ 13 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 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 56 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (38), REDACTED (18). — One of this dimension's main actionable groups (56 issue-level).
Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
64 of 234 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/services/relay/droidRelayService.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.
Resolve the 51 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED, ApiKeyUsageRecordsView.vue, UserUsageStatsModal.vue. — One of this dimension's main actionable groups (51 recommendation-level).
Resolve the 13 Orphaned knowledge finding(s) in Knowledge Freshness — start with droidRelayService.js, QuotaCardsView.vue, ccrRelayService.js. — One of this dimension's main actionable groups (13 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, …
<svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×7) — web/admin-spa/src/components/admin/ChangeRoleModal.vue:0, web/admin-spa/src/components/admin/UserUsageStatsModal.vue:0, web/admin-spa/src/components/user/CreateApiKeyModal.vue:0, …
<div> moves — its inline style sets `animation: shine 2.8s infinite` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — web/admin-spa/src/components/apikeys/LimitProgressBar.vue:66
<i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×4) — web/admin-spa/src/views/AccountsView.vue:2177, web/admin-spa/src/views/AccountsView.vue:0, web/admin-spa/src/views/DashboardView.vue:581, …
`.input-text` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — web/admin-spa/src/views/BalanceScriptsView.vue:300, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:291
`.btn` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/admin-spa/src/views/SettingsView.vue:3256
`.loading-spinner` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×4) — web/admin-spa/src/views/AccountsView.vue:5773, web/admin-spa/src/views/ApiKeysView.vue:5069, web/admin-spa/src/components/apistats/ApiKeyInput.vue:446, …
`.tab-content` moves (`animation: tabFadeIn 0.4s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/views/ApiStatsView.vue:1201
`.fade-in` moves (`animation: fadeIn 0.6s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/views/ApiStatsView.vue:1217
`.animate-spin` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/views/DashboardView.vue:1833
`.user-menu-button::before` moves (`transition: left 0.5s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/layout/AppHeader.vue:549
`.user-menu-dropdown` moves (`animation: slideDown 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/layout/AppHeader.vue:559
`.theme-toggle-button i` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/common/ThemeToggle.vue:269
`.theme-segment i` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/common/ThemeToggle.vue:565
`.color-dot` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/common/ThemeToggle.vue:636
`.toast-progress` moves (`animation: toast-progress linear forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/common/ToastNotification.vue:248
`.toast-list-move` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/common/ToastNotification.vue:427
`.animate-fadeIn` moves (`animation: fadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:493
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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect. — REDACTED:197
What to do
Name the access rules — roles/permissions declared once (a @Roles/@Permissions decorator with its guard, a CASL ability, a casbin model, or Supabase CREATE POLICY) and consulted where access is checked, so the rule set is reviewable and testable on its own.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`setup` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — scripts/setup.js:9
`initializeCacheMonitoring` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:638
`initialize` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/modelService.js:16
The `if` and its `else` contain the same statements, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body. — src/services/openaiToClaude.js:469
`useFallbackPricing` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/services/pricingService.js:315
The guard above `return 'anthropic';` also returns `'anthropic'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/services/relay/droidRelayService.js:50
Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. — src/services/scheduler/unifiedClaudeScheduler.js:1632
`updateUserApiKeyCount` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:315
The guard above `return '/api-stats';` also returns `'/api-stats'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — web/admin-spa/src/router/index.js:31
What to do
Remove the dead code that still moves this score: delete dead if(false) branches and either do the real async work or drop the async keyword from fake-async functions.
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.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add 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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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.
README_EN.md links to `docs/preview.md`, but `docs/preview.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README_EN.md:85
What to do
Reconcile the README with reality: README_EN.md links to `docs/preview.md`, but `docs/preview.md` does not exist.
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.
`src/utils/costCalculator.js` reports through `console.*` at line 368 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/costCalculator.js:368
`src/utils/costCalculator.js` reports through `console.*` at line 376 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/costCalculator.js:376
`REDACTED` reports through `console.*` at line 203 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:203
`REDACTED` reports through `console.*` at line 207 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:207
`REDACTED` reports through `console.*` at line 211 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:211
`REDACTED` reports through `console.*` at line 335 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:335
`src/utils/lruCache.js` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/lruCache.js:89
`src/utils/lruCache.js` reports through `console.*` at line 102 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/lruCache.js:102
`src/utils/lruCache.js` reports through `console.*` at line 128 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/lruCache.js:128
`src/utils/runtimeAddon.js` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/runtimeAddon.js:114
`src/utils/runtimeAddon.js` reports through `console.*` at line 116 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/runtimeAddon.js:116
`REDACTED` reports through `console.*` at line 3014 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:3014
`REDACTED` reports through `console.*` at line 3081 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:3081
`REDACTED` reports through `console.*` at line 3171 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:3171
What to do
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
Add OpenTelemetry tracing/metrics (@opentelemetry/sdk-node) so requests are traceable across the system, not just health-probable.
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. — REDACTED:4
`package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:51
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. (×5) — REDACTED:551, REDACTED:892, REDACTED:1521, …
`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. (×2) — src/services/balanceProviders/geminiBalanceProvider.js:216, src/services/balanceProviders/geminiBalanceProvider.js:229
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, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.existsSync` in `callback to app.use` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:168
`fs.existsSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:265, src/services/pricingService.js:50
`fs.existsSync` in `app.get("/admin-next/*")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:307
`fs.statSync` in `app.get("/admin-next/*")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:307
`fs.existsSync` in `app.get("/health")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:395
`fs.readFileSync` in `app.get("/health")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:396
`fs.existsSync` in `initializeAdmin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:483
`fs.readFileSync` in `initializeAdmin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:489
`fs.readFileSync` in `router.get("/check-updates")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:98
`fs.existsSync` in `router.post("/auth/login")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:39
`fs.readFileSync` in `router.post("/auth/login")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:41
`fs.existsSync` in `router.post("/auth/change-password")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:213
`fs.readFileSync` in `router.post("/auth/change-password")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:221
`fs.writeFileSync` in `router.post("/auth/change-password")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:230
`fs.mkdirSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:51
`fs.existsSync` in `loadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:294
`fs.readFileSync` in `loadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:295
`fs.statSync` in `loadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:298
`fs.existsSync` in `useFallbackPricing` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:317
`fs.readFileSync` in `useFallbackPricing` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:321
`fs.writeFileSync` in `useFallbackPricing` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:327
`fs.existsSync` in `reloadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:836
`fs.readFileSync` in `reloadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/pricingService.js:845
`zlib.gunzipSync` in `res.on("end")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/relay/claudeRelayService.js:1798
`zlib.inflateSync` in `res.on("end")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/services/relay/claudeRelayService.js:1805
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 · REDACTED: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
src/services/relay/grokRelayService.js:21 · src/services/relay/openaiResponsesRelayService.js: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. — src/services/relay/grokRelayService.js: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 · REDACTED: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
REDACTED:832 · REDACTED: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. — REDACTED: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
REDACTED:217 · REDACTED: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. — REDACTED: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. — REDACTED: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. — src/services/relay/openaiResponsesRelayService.js: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.
web/admin-spa/src/components/accounts/AccountForm.vue has 6637 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/accounts/AccountForm.vue:1
web/admin-spa/src/views/AccountsView.vue has 5419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/AccountsView.vue:1
REDACTED has 4835 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
web/admin-spa/src/views/ApiKeysView.vue has 4687 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/ApiKeysView.vue:1
src/services/relay/claudeRelayService.js has 3288 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/relay/claudeRelayService.js:1
src/services/account/claudeAccountService.js has 3131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/account/claudeAccountService.js:1
web/admin-spa/src/views/SettingsView.vue has 3078 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/SettingsView.vue:1
REDACTED has 3013 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/services/anthropicGeminiBridgeService.js has 2812 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/anthropicGeminiBridgeService.js:1
REDACTED has 2721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/services/apiKeyService.js has 2572 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/apiKeyService.js:1
REDACTED has 2495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
REDACTED has 1863 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
REDACTED has 1755 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/services/scheduler/unifiedClaudeScheduler.js has 1751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/scheduler/unifiedClaudeScheduler.js:1
web/admin-spa/src/views/DashboardView.vue has 1713 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/DashboardView.vue:1
web/admin-spa/src/components/apikeys/EditApiKeyModal.vue has 1699 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1
REDACTED has 1656 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue has 1568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1
REDACTED has 1470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/services/requestDetailService.js has 1430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/requestDetailService.js:1
src/services/account/claudeConsoleAccountService.js has 1403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/account/claudeConsoleAccountService.js:1
src/services/relay/claudeConsoleRelayService.js has 1387 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/relay/claudeConsoleRelayService.js:1
src/services/relay/droidRelayService.js has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/relay/droidRelayService.js:1
REDACTED has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
REDACTED has 1271 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
web/admin-spa/src/components/accounts/OAuthFlow.vue has 1221 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/accounts/OAuthFlow.vue:1
web/admin-spa/src/views/RequestDetailsView.vue has 1174 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/RequestDetailsView.vue:1
web/admin-spa/src/views/ApiStatsView.vue has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/ApiStatsView.vue:1
REDACTED has 1092 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/routes/admin/claudeAccounts.js has 1045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/routes/admin/claudeAccounts.js:1
web/admin-spa/src/views/QuotaCardsView.vue has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/QuotaCardsView.vue:1
src/services/scheduler/unifiedOpenAIScheduler.js has 903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/scheduler/unifiedOpenAIScheduler.js:1
web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:1
src/services/relay/ccrRelayService.js has 875 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/relay/ccrRelayService.js:1
REDACTED has 873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
REDACTED has 830 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/services/relay/openaiResponsesRelayService.js has 829 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/services/relay/openaiResponsesRelayService.js:1
REDACTED has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/utils/grokHelper.js has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/utils/grokHelper.js:1
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:1, web/admin-spa/src/views/AccountsView.vue:1, web/admin-spa/src/views/ApiKeysView.vue:1, …
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:943
Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. (×4) — REDACTED:48, REDACTED:73, REDACTED:122, …
`azureOpenaiSalt` is the key-derivation salt, and its shipped DEFAULT is a compile-time constant — an installation that never overrides it encrypts with a value published in this repository, and the code cannot distinguish that state from a configured one. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. — src/services/account/azureOpenaiAccountService.js:13
`ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. (×4) — src/services/account/claudeAccountService.js:61, src/services/account/claudeConsoleAccountService.js:14, src/services/account/geminiApiAccountService.js:13, …
This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price. (×10) — REDACTED:48, REDACTED:73, REDACTED:122, …
What to do
Load cryptographic key and salt material from configuration, an environment variable or a secrets manager rather than fixing it in the source, and fail fast at startup when it is absent — a default that silently works is the one that reaches production. Rotate anything already committed: it must be treated as disclosed. Salts should be generated per password and stored with the hash, never shared across installations. This repository constructs key or salt material fixed at compile time at 9 sites, not one: `REDACTED:48` (key-derivation salt), `REDACTED:73` (key-derivation salt), `REDACTED:122` (key-derivation salt), `REDACTED:137` (key-derivation salt), `src/services/account/azureOpenaiAccountService.js:13` (key-derivation salt, default `azureOpenaiSalt`), `src/services/account/claudeAccountService.js:61` (key-derivation salt, `ENCRYPTION_SALT`), `src/services/account/claudeConsoleAccountService.js:14` (key-derivation salt, `ENCRYPTION_SALT`), `src/services/account/geminiApiAccountService.js:13` (key-derivation salt, `ENCRYPTION_SALT`), and 1 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Raise the cost parameter to current guidance — PBKDF2 at 1,300,000 (HMAC-SHA1), 600,000 (SHA-256) or 210,000 (SHA-512) iterations; scrypt at N=2^17, r=8, p=1; bcrypt at a work factor of 10 or more — or move to a memory-hard KDF (Argon2id, scrypt) where the platform offers one. Read the parameter from configuration and tune it to roughly 100 ms per derivation on the slowest hardware that must run it, so the price can be raised again without shipping new code. This repository constructs a key derivation priced below the floor at 10 sites, not one: `REDACTED:48` (scrypt, N=16,384 (r=8, p=1), Node's default), `REDACTED:73` (scrypt, N=16,384 (r=8, p=1), Node's default), `REDACTED:122` (scrypt, N=16,384 (r=8, p=1), Node's default), `REDACTED:137` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/azureOpenaiAccountService.js:28` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/claudeAccountService.js:1348` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/claudeConsoleAccountService.js:1197` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/geminiApiAccountService.js:610` (scrypt, N=16,384 (r=8, p=1), Node's default), and 2 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 10/47 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`login` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — web/admin-spa/src/stores/user.js:25
`logout` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — web/admin-spa/src/stores/user.js:55
`getUserProfile` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`. — web/admin-spa/src/stores/user.js:102
`getUserApiKeys` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`. — web/admin-spa/src/stores/user.js:127
`createApiKey` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — web/admin-spa/src/stores/user.js:142
`deleteApiKey` awaits `axios.delete(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.delete(url, { signal })`. — web/admin-spa/src/stores/user.js:153
`getUserUsageStats` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`. — web/admin-spa/src/stores/user.js:164
`exchangeAuthorizationCode` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/grokHelper.js:741
`refreshAccessToken` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/grokHelper.js:777
`exchangeCodeForTokens` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/oauthHelper.js:156
`exchangeSetupTokenCode` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/oauthHelper.js:375
`getOrganizationInfo` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`. — src/utils/oauthHelper.js:614
`authorizeWithCookie` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/oauthHelper.js:707
`startDeviceAuthorization` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/workosOAuthHelper.js:30
`pollDeviceAuthorization` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/utils/workosOAuthHelper.js:104
`fetchAvailableModels` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/antigravityClient.js:483
`countTokens` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. (×3) — src/services/antigravityClient.js:529, src/services/relay/geminiRelayService.js:443, REDACTED:1530
`execute` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/balanceScriptService.js:62
`handleAzureOpenAIRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/relay/azureOpenaiRelayService.js:16
`_makeCcrStreamRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/relay/ccrRelayService.js:561
`_makeClaudeConsoleStreamRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/relay/claudeConsoleRelayService.js:744
`relayRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/relay/droidRelayService.js:184
`getAvailableModels` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/relay/geminiRelayService.js:382
`makeRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — src/services/balanceProviders/baseBalanceProvider.js:38
`queryBalance` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/services/balanceProviders/geminiBalanceProvider.js:191
`refreshAccountToken` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`. — src/services/account/claudeAccountService.js:263
`fetchOAuthUsage` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`. — src/services/account/claudeAccountService.js:2078
`fetchAndUpdateAccountProfile` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`. — src/services/account/claudeAccountService.js:2329
`_refreshTokensWithWorkOS` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:337
`_fetchFactoryOrgIds` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:411
`forwardToCodeAssist` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:1222
`loadCodeAssist` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:1260
`onboardUser` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:1396
`generateContent` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:1578
`refreshAccessToken` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`. — REDACTED:117
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`debug` at line 313 is called with an argument built by `Object.keys(entries[0])` (line 316), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — REDACTED:313
`debug` at line 560 is called with an argument built by `Object.keys(ldapEntry || { })` (line 563), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — REDACTED:560
`debug` at line 107 is called with an argument built by `JSON.stringify(processedBody)` (line 116), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/azureOpenaiRelayService.js:107
`debug` at line 119 is called with an argument built by `Object.keys(requestHeaders)` (line 122), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/azureOpenaiRelayService.js:119
`debug` at line 127 is called with an argument built by `Object.keys(processedBody)` (line 130), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/azureOpenaiRelayService.js:127
`debug` at line 142 is called with an argument built by `Object.keys(response.headers || { })` (line 146), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/azureOpenaiRelayService.js:142
`debug` at line 621 is called with an argument built by `Object.keys(responseData || { })` (line 622), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/azureOpenaiRelayService.js:621
`debug` at line 98 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 98), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:98
`debug` at line 161 is called with an argument built by `JSON.stringify(options)` (line 161), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:161
`debug` at line 162 is called with an argument built by `JSON.stringify(clientHeaders)` (line 162), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:162
`debug` at line 166 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 166), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:166
`debug` at line 208 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 209), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:208
`debug` at line 221 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 223), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:221
`debug` at line 253 is called with an argument built by `JSON.stringify(response.headers)` (line 253), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:253
`debug` at line 255 is called with an argument built by `JSON.stringify(response.data)` (line 256), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:255
`debug` at line 258 is called with an argument built by `JSON.stringify(response.data)` (line 259), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:258
`debug` at line 584 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 584), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:584
`debug` at line 817 is called with an argument built by `JSON.stringify(collectedUsage)` (line 817), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/ccrRelayService.js:817
`debug` at line 139 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 139), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:139
`debug` at line 204 is called with an argument built by `JSON.stringify(options)` (line 204), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:204
`debug` at line 205 is called with an argument built by `JSON.stringify(clientHeaders)` (line 205), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:205
`debug` at line 209 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 209), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:209
`debug` at line 251 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 252), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:251
`debug` at line 264 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 266), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:264
`debug` at line 296 is called with an argument built by `JSON.stringify(response.headers)` (line 296), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:296
`debug` at line 298 is called with an argument built by `JSON.stringify(response.data)` (line 299), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:298
`debug` at line 324 is called with an argument built by `JSON.stringify(response.data)` (line 325), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:324
`debug` at line 767 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 767), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeConsoleRelayService.js:767
`debug` at line 2783 is called with an argument built by `JSON.stringify(currentUsageData.cache_creation)` (line 2785), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeRelayService.js:2783
`debug` at line 2789 is called with an argument built by `JSON.stringify(currentUsageData)` (line 2791), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeRelayService.js:2789
`debug` at line 2803 is called with an argument built by `JSON.stringify(currentUsageData)` (line 2805), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/claudeRelayService.js:2803
`debug` at line 520 is called with an argument built by `JSON.stringify(requestBody, null, 2)` (line 520), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/relay/geminiRelayService.js:520
`debug` at line 99 is called with an argument built by `JSON.stringify(accountData, null, 2)` (line 99), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:99
`debug` at line 205 is called with an argument built by `Object.keys(accountData)` (line 205), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:205
`debug` at line 218 is called with an argument built by `JSON.stringify(parsedModels)` (line 218), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:218
`debug` at line 234 is called with an argument built by `JSON.stringify(accountData.supportedModels)` (line 235), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:234
`debug` at line 253 is called with an argument built by `Object.keys(updates)` (line 254), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:253
`debug` at line 256 is called with an argument built by `JSON.stringify(updates, null, 2)` (line 256), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:256
`debug` at line 274 is called with an argument built by `JSON.stringify(updates.supportedModels)` (line 274), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/ccrAccountService.js:274
`debug` at line 2321 is called with an argument built by `Object.keys(updates)` (line 2323), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/services/account/claudeAccountService.js:2321
What to do
Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped4.1 / 10Weak✓ Tool-verified
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.
`iconMap[type]` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/admin-spa/src/utils/tools.js:49
`title` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/admin-spa/src/utils/tools.js:52
`message.replace(/\n/g,'<br>')` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/admin-spa/src/utils/tools.js:53
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×27) — web/admin-spa/src/views/AccountsView.vue:3831, web/admin-spa/src/views/AccountsView.vue:4749, web/admin-spa/src/views/ApiKeysView.vue:2627, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×12) — src/utils/safeRotatingAppend.js:66, src/utils/upstreamErrorHelper.js:322, src/utils/upstreamErrorHelper.js:373, …
`catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/services/openaiToClaude.js:152
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:62
`info` at line 125 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:125
`info` at line 256 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:256
`info` at line 274 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:274
`info` at line 507 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:507
`info` at line 610 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:610
`info` at line 613 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:613
`info` at line 616 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:616
`info` at line 617 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:617
`info` at line 618 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:618
`info` at line 624 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:624
`info` at line 657 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:657
`info` at line 664 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:664
`info` at line 699 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:699
`info` at line 708 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:708
`error` at line 781 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:781
`info` at line 786 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:786
`warn` at line 789 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:789
`info` at line 836 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:836
`info` at line 901 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:901
`warn` at line 38 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:38
`warn` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:62
`error` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:69
`warn` at line 97 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:97
`debug` at line 103 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:103
`debug` at line 107 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. (×2) — src/validators/clientValidator.js:107, src/validators/clients/claudeCodeValidator.js:107
`error` at line 124 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:124
`error` at line 90 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:90
`warn` at line 94 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:94
`debug` at line 143 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:143
`debug` at line 173 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:173
`debug` at line 185 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:185
`debug` at line 192 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:192
`debug` at line 50 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:50
`debug` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:62
`debug` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:69
`debug` at line 77 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:77
`debug` at line 87 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:87
`debug` at line 94 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:94
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 included — 42 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 applicable — JavaScript has no interface declaration, so there is no declared member list whose width this check could measure
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 1 — a container did not start, exited, or never became healthy) — time="2026-10-30T00:09:10Z" level=warning msg="The \"JWT_SECRET\" variable is not set. Defaulting to a blank string." time="2026-10-30T00:09:10Z" level=warning msg="The \"ENCRYPTION_KEY\" variable is not set. Defaulting to a blank string." container .-claude-relay-1 is unhealthy; 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.
C3 Audit Trail — 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 sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, 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 personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
C5 Data-Subject Rights — 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 personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
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.
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No hand-written C# or Visual Basic source; comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.js), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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 — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — 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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
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 applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
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).
Orphaned knowledge src/services/relay/droidRelayService.js:1— 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/views/QuotaCardsView.vue:1— 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/relay/ccrRelayService.js:1— 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/accounts/ApiKeyManagementModal.vue:1— 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/ccrAccountService.js:1— 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 REDACTED:1— 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:1— 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/views/UserManagementView.vue:1— 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/quotaCardService.js:1— 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:1— 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:1— 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/apiKeyIndexService.js:1— 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/views/AccountUsageRecordsView.vue:1— 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· <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.
S1 · Web-Security Posture· Cryptographic key material is a compile-time constant · ×9
Cryptographic key material is a compile-time constant REDACTED:48— The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant REDACTED:73— The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant REDACTED:122— The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant REDACTED:137— The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant src/services/account/azureOpenaiAccountService.js:13— `azureOpenaiSalt` is the key-derivation salt, and its shipped DEFAULT is a compile-time constant — an installation that never overrides it encrypts with a value published in this repository, and the code cannot distinguish that state from a configured one. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant src/services/account/claudeAccountService.js:61— `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant src/services/account/claudeConsoleAccountService.js:14— `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant src/services/account/geminiApiAccountService.js:13— `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant REDACTED:13— `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
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 REDACTED: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.
+ 32 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:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/views/AccountsView.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/views/ApiKeysView.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/views/SettingsView.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/services/anthropicGeminiBridgeService.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/views/DashboardView.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/services/relay/droidRelayService.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/components/accounts/OAuthFlow.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/routes/admin/claudeAccounts.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/views/QuotaCardsView.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/views/RequestDetailsView.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/services/relay/ccrRelayService.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/utils/oauthHelper.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Swallowed exception (empty catch) web/admin-spa/src/views/AccountsView.vue:3831— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/admin-spa/src/views/AccountsView.vue:4749— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/admin-spa/src/views/ApiKeysView.vue:2627— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/admin-spa/src/stores/dashboard.js:103— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/admin-spa/src/components/accounts/AccountForm.vue:4910— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/admin-spa/src/components/accounts/AccountForm.vue:6918— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/admin-spa/src/components/accounts/OAuthFlow.vue:970— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:398— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/antigravityUpstreamResponseDump.js:125— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/commonHelper.js:336— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/commonHelper.js:341— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/grokHelper.js:673— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:65— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:272— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/safeRotatingAppend.js:66— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/utils/upstreamErrorHelper.js:322— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/utils/upstreamErrorHelper.js:373— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/utils/upstreamErrorHelper.js:488— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/upstreamErrorHelper.js:493— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/services/accountGroupService.js:590— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/services/accountGroupService.js:592— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/services/accountNameCacheService.js:68— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/services/accountNameCacheService.js:73— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/services/anthropicGeminiBridgeService.js:2525— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/services/anthropicGeminiBridgeService.js:2547— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
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: REDACTED REDACTED— 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.
+ 13 more in this group — see findings.md.
X2 · Cancellation propagation· Async function without AbortSignal · ×37
Async function without AbortSignal: login web/admin-spa/src/stores/user.js:25— `login` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: logout web/admin-spa/src/stores/user.js:55— `logout` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: getUserProfile web/admin-spa/src/stores/user.js:102— `getUserProfile` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`.
Async function without AbortSignal: getUserApiKeys web/admin-spa/src/stores/user.js:127— `getUserApiKeys` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`.
Async function without AbortSignal: createApiKey web/admin-spa/src/stores/user.js:142— `createApiKey` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: deleteApiKey web/admin-spa/src/stores/user.js:153— `deleteApiKey` awaits `axios.delete(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.delete(url, { signal })`.
Async function without AbortSignal: getUserUsageStats web/admin-spa/src/stores/user.js:164— `getUserUsageStats` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`.
Async function without AbortSignal: exchangeAuthorizationCode src/utils/grokHelper.js:741— `exchangeAuthorizationCode` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: refreshAccessToken src/utils/grokHelper.js:777— `refreshAccessToken` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: exchangeCodeForTokens src/utils/oauthHelper.js:156— `exchangeCodeForTokens` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: exchangeSetupTokenCode src/utils/oauthHelper.js:375— `exchangeSetupTokenCode` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: getOrganizationInfo src/utils/oauthHelper.js:614— `getOrganizationInfo` awaits `axios.get(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.get(url, { signal })`.
Async function without AbortSignal: authorizeWithCookie src/utils/oauthHelper.js:707— `authorizeWithCookie` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: startDeviceAuthorization src/utils/workosOAuthHelper.js:30— `startDeviceAuthorization` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: pollDeviceAuthorization src/utils/workosOAuthHelper.js:104— `pollDeviceAuthorization` awaits `axios.post(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios.post(url, { signal })`.
Async function without AbortSignal: fetchAvailableModels src/services/antigravityClient.js:483— `fetchAvailableModels` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: countTokens src/services/antigravityClient.js:529— `countTokens` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: execute src/services/balanceScriptService.js:62— `execute` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: handleAzureOpenAIRequest src/services/relay/azureOpenaiRelayService.js:16— `handleAzureOpenAIRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: _makeCcrStreamRequest src/services/relay/ccrRelayService.js:561— `_makeCcrStreamRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: _makeClaudeConsoleStreamRequest src/services/relay/claudeConsoleRelayService.js:744— `_makeClaudeConsoleStreamRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: relayRequest src/services/relay/droidRelayService.js:184— `relayRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: getAvailableModels src/services/relay/geminiRelayService.js:382— `getAvailableModels` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: countTokens src/services/relay/geminiRelayService.js:443— `countTokens` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
Async function without AbortSignal: makeRequest src/services/balanceProviders/baseBalanceProvider.js:38— `makeRequest` awaits `axios(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `axios(url, { signal })`.
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 REDACTED: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 src/services/relay/openaiResponsesRelayService.js: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 src/services/relay/openaiResponsesRelayService.js: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 src/services/relay/grokRelayService.js: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.
+ 9 more in this group — see findings.md.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×27
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/admin/ChangeRoleModal.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/admin/UserUsageStatsModal.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/apikeys/LimitProgressBar.vue:66— <div> moves — its inline style sets `animation: shine 2.8s infinite` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/user/CreateApiKeyModal.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/user/UserApiKeysManager.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/user/UserUsageStats.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/AccountsView.vue:2177— <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/AccountsView.vue— <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/DashboardView.vue:581— <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/DashboardView.vue— <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/UserLoginView.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/UserManagementView.vue— <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/AccountsView.vue:5773— `.loading-spinner` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/ApiKeysView.vue:5069— `.loading-spinner` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/ApiStatsView.vue:1201— `.tab-content` moves (`animation: tabFadeIn 0.4s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/ApiStatsView.vue:1217— `.fade-in` moves (`animation: fadeIn 0.6s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/views/DashboardView.vue:1833— `.animate-spin` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/layout/AppHeader.vue:549— `.user-menu-button::before` moves (`transition: left 0.5s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/layout/AppHeader.vue:559— `.user-menu-dropdown` moves (`animation: slideDown 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/common/ThemeToggle.vue:269— `.theme-toggle-button i` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/common/ThemeToggle.vue:565— `.theme-segment i` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/common/ThemeToggle.vue:636— `.color-dot` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/common/ToastNotification.vue:248— `.toast-progress` moves (`animation: toast-progress linear forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/common/ToastNotification.vue:427— `.toast-list-move` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard web/admin-spa/src/components/apistats/ApiKeyInput.vue:446— `.loading-spinner` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Sync-over-async blocking REDACTED:168— `fs.existsSync` in `callback to app.use` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:265— `fs.existsSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:307— `fs.existsSync` in `app.get("/admin-next/*")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:307— `fs.statSync` in `app.get("/admin-next/*")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:395— `fs.existsSync` in `app.get("/health")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:396— `fs.readFileSync` in `app.get("/health")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:483— `fs.existsSync` in `initializeAdmin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:489— `fs.readFileSync` in `initializeAdmin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:98— `fs.readFileSync` in `router.get("/check-updates")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:39— `fs.existsSync` in `router.post("/auth/login")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:41— `fs.readFileSync` in `router.post("/auth/login")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:213— `fs.existsSync` in `router.post("/auth/change-password")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:221— `fs.readFileSync` in `router.post("/auth/change-password")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:230— `fs.writeFileSync` in `router.post("/auth/change-password")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:50— `fs.existsSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:51— `fs.mkdirSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:294— `fs.existsSync` in `loadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:295— `fs.readFileSync` in `loadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:298— `fs.statSync` in `loadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:317— `fs.existsSync` in `useFallbackPricing` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:321— `fs.readFileSync` in `useFallbackPricing` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:327— `fs.writeFileSync` in `useFallbackPricing` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:836— `fs.existsSync` in `reloadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/pricingService.js:845— `fs.readFileSync` in `reloadPricingData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/services/relay/claudeRelayService.js:1798— `zlib.gunzipSync` in `res.on("end")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
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 REDACTED: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 src/services/relay/openaiResponsesRelayService.js: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 REDACTED: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.
S1 · Web-Security Posture· Password key derivation is priced too cheaply · ×10
Password key derivation is priced too cheaply REDACTED:48— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply REDACTED:73— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply REDACTED:122— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply REDACTED:137— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply src/services/account/azureOpenaiAccountService.js:28— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply src/services/account/claudeAccountService.js:1348— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply src/services/account/claudeConsoleAccountService.js:1197— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply src/services/account/geminiApiAccountService.js:610— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply REDACTED:657— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
Password key derivation is priced too cheaply src/utils/commonHelper.js:29— This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
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: 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: src/services/relay/grokRelayService.js src/services/relay/grokRelayService.js:43— src/services/relay/grokRelayService.js 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 -- src/services/relay/grokRelayService.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/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:1— `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:1— `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:1— `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:1— `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:1— `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:1— `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:1— `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:1— `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:1— `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.
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.
Outbound HTTP without resilience REDACTED:892— `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.
Outbound HTTP without resilience REDACTED:1521— `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.
Outbound HTTP without resilience REDACTED:2360— `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.
Outbound HTTP without resilience REDACTED:2682— `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.
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.
Outbound HTTP without resilience src/services/balanceProviders/geminiBalanceProvider.js:229— `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.
(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) 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) 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) 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) 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) REDACTED: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) 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: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) (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) 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) 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.
Deprecated: ldapjs package.json:67— ldapjs 3.0.7, declared in package.json, is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: string-similarity package.json:74— string-similarity 4.0.4, declared in package.json, is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: uuid package.json:76— uuid 9.0.1, declared in package.json, is marked deprecated by its publisher: "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: eslint package.json:82— eslint 8.57.1, declared in package.json, is marked deprecated by its publisher: "This version is no longer supported. Please see https://eslint.org/version-support for other options.". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: supertest package.json:89— supertest 6.3.4, declared in package.json, is marked deprecated by its publisher: "Please upgrade to supertest v7.1.3+, see release notes at https://github.com/forwardemail/supertest/releases/tag/v7.1.3 - maintenance is supported by Forward Email @ https://forwardemail.net". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: eslint web/admin-spa/package.json:30— eslint 8.57.1, declared in web/admin-spa/package.json, is marked deprecated by its publisher: "This version is no longer supported. Please see https://eslint.org/version-support for other options.". Replace it with the package or version that message names, or record why this one must stay.
(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: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)::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)::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) 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) (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) 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: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/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) (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 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) 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) 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 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) REDACTED: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: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.
(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.
Fake-async — async method never awaits scripts/setup.js:9— `setup` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits REDACTED:638— `initializeCacheMonitoring` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/services/modelService.js:16— `initialize` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/services/pricingService.js:315— `useFallbackPricing` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits REDACTED:315— `updateUserApiKeyCount` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
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) REDACTED: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) REDACTED: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) 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 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 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) (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/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 18) REDACTED: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: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) (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) web/admin-spa/src/stores/apistats.js:6— (anonymous) has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 44, 77). 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) 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) REDACTED: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) 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 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 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) 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: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) 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 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) (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) 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.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×3
Focus outline removed in CSS without a :focus replacement web/admin-spa/src/views/BalanceScriptsView.vue:300— `.input-text` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement web/admin-spa/src/views/SettingsView.vue:3256— `.btn` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:291— `.input-text` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
(anonymous) (cognitive 36) REDACTED: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) REDACTED: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.
(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 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) 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 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) 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.
(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 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) 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) 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.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×3
Untrusted text written into markup unescaped web/admin-spa/src/utils/tools.js:49— `iconMap[type]` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped web/admin-spa/src/utils/tools.js:52— `title` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped web/admin-spa/src/utils/tools.js:53— `message.replace(/\n/g,'<br>')` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
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 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.
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 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.
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 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.
(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.
(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.
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 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.
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 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.
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 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.
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.
(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 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.
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::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 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 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 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) REDACTED: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 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.
(anonymous) (cognitive 20) web/admin-spa/src/stores/apistats.js:6— (anonymous) has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 3 (nesting depth added 1). None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 44, 77). 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.
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.
IC1 · Incompleteness & stubs· Both branches are identical · ×2
Both branches are identical — the condition decides nothing src/services/openaiToClaude.js:469— The `if` and its `else` contain the same statements, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body.
Both branches are identical — the condition decides nothing src/services/scheduler/unifiedClaudeScheduler.js:1632— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×2
Guard cannot change the result — returns what the code already falls through to src/services/relay/droidRelayService.js:50— The guard above `return 'anthropic';` also returns `'anthropic'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Guard cannot change the result — returns what the code already falls through to web/admin-spa/src/router/index.js:31— The guard above `return '/api-stats';` also returns `'/api-stats'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
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) REDACTED:217— REDACTED:217 · REDACTED: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.
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 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.
_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 (a function literal at line 1003, a function literal at line 839, a function literal at line 1171, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 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.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 (a function literal at line 1319, a function literal at line 1529, a function literal at line 1013, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
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) REDACTED: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.
(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.
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.
handleRequest (cyclomatic 93) src/services/relay/openaiResponsesRelayService.js: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 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.
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.
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.
anthropicGeminiBridgeService.handleAnthropicMessagesToGemini (cyclomatic 81) src/services/anthropicGeminiBridgeService.js:1859— anthropicGeminiBridgeService.handleAnthropicMessagesToGemini has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs) 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.
data-transfer-enhanced.exportData (cyclomatic 80) REDACTED: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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(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.
_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 (a function literal at line 638, a function literal at line 765, a function literal at line 573, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
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.
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.
geminiHandlers.handleStandardStreamGenerateContent (cyclomatic 49) REDACTED:2506— geminiHandlers.handleStandardStreamGenerateContent has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock) 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.
handleRequest (cyclomatic 49) src/services/relay/grokRelayService.js: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) REDACTED: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 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.
dashboard.useDashboardStore.loadDashboardData (cyclomatic 47) web/admin-spa/src/stores/dashboard.js:235— dashboard.useDashboardStore.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.
initialize (cyclomatic 47) REDACTED: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.
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.
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) REDACTED: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.
anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations (cyclomatic 43) src/services/anthropicGeminiBridgeService.js:779— anthropicGeminiBridgeService.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.
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.
data-transfer.exportData (cyclomatic 42) REDACTED: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.
OpenAIResponsesRelayService._handleStreamResponse (cyclomatic 41) src/services/relay/openaiResponsesRelayService.js: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 items inside it that branch (a function literal at line 584, parseSSEForUsage, a function literal at line 556, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 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.
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.
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.
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.
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.
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.
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.
handleChatCompletion (cyclomatic 36) REDACTED:186— handleChatCompletion 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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
data-transfer-enhanced.exportUsageStats (cyclomatic 33) REDACTED: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) REDACTED: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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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) REDACTED: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) REDACTED: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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.
_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.
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.
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). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (extractTextContent, a function literal at line 59, a function literal at line 98). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
(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.
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.
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 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 28) REDACTED: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 (a function literal at line 460, a function literal at line 559, a function literal at line 533, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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) src/services/relay/openaiResponsesRelayService.js: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 items inside it that branch (a function literal at line 559, a function literal at line 533, safeWrite, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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) REDACTED: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) REDACTED: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.
_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.
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.
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 items inside it that branch (removeCacheControlFromMessages, removeCacheControlFromSystem, countCacheControlBlocks, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
dashboard.router.get("/dashboard") (cyclomatic 24) src/routes/admin/dashboard.js:23— dashboard.router.get("/dashboard") has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (dashboard.router.get("/dashboard")::countAccountStats) 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.
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.
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.
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.handleAnthropicMessagesToGemini::resolveFunctionCallArgs (cyclomatic 23) src/services/anthropicGeminiBridgeService.js:2486— anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (anthropicGeminiBridgeService.handleAnthropicMessagesToGemini) 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.
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.
geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage (cyclomatic 23) REDACTED:79— geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage 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. This shape REPEATS in the file: one other method here (geminiApiAccounts.router.get("/gemini-api-accounts")) 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.
openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage (cyclomatic 23) REDACTED:90— openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage 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. This shape REPEATS in the file: one other method here (openaiResponsesAccounts.router.get("/openai-responses-accounts")) 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.
droidAccounts.router.get("/droid-accounts")::parseUsage (cyclomatic 23) src/routes/admin/droidAccounts.js:200— droidAccounts.router.get("/droid-accounts")::parseUsage 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. This shape REPEATS in the file: one other method here (droidAccounts.router.get("/droid-accounts")) 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.
grokAccounts.router.get("/grok-accounts")::parseUsage (cyclomatic 23) REDACTED:188— grokAccounts.router.get("/grok-accounts")::parseUsage 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.
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.
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.
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.
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.
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.
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.
geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock (cyclomatic 20) REDACTED:2801— geminiHandlers.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. This shape REPEATS in the file: one other method here (geminiHandlers.handleStandardStreamGenerateContent) 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.
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.
startCleanupTasks (cyclomatic 20) REDACTED: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.
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.
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.
(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.
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 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.
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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 items inside it that branch (transformName, a function literal at line 336, a function literal at line 353, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
droidAccounts.router.get("/droid-accounts") (cyclomatic 19) src/routes/admin/droidAccounts.js:144— droidAccounts.router.get("/droid-accounts") 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 shape REPEATS in the file: one other method here (droidAccounts.router.get("/droid-accounts")::parseUsage) 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.
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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_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.
_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.
_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.
RedisClient.getUsageStats::handleLegacyData (cyclomatic 18) REDACTED:1720— RedisClient.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.
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.
dashboard.router.get("/dashboard")::countAccountStats (cyclomatic 18) src/routes/admin/dashboard.js:84— dashboard.router.get("/dashboard")::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. This shape REPEATS in the file: one other method here (dashboard.router.get("/dashboard")) 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.
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) REDACTED: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.
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.
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.
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.
_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.
_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.
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) REDACTED: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) REDACTED: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.
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.
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.
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.
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) src/services/relay/grokRelayService.js: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 items inside it that branch (parseSSEForUsage, recordUsageOnce, a function literal at line 307, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
geminiApiAccounts.router.get("/gemini-api-accounts") (cyclomatic 16) REDACTED:13— geminiApiAccounts.router.get("/gemini-api-accounts") 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. This shape REPEATS in the file: one other method here (geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage) 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.
openaiResponsesAccounts.router.get("/openai-responses-accounts") (cyclomatic 16) REDACTED:24— openaiResponsesAccounts.router.get("/openai-responses-accounts") 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. This shape REPEATS in the file: one other method here (openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage) 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.
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) REDACTED: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) REDACTED: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.
dashboard.useDashboardStore.loadAccountUsageTrend (cyclomatic 16) web/admin-spa/src/stores/dashboard.js:458— dashboard.useDashboardStore.loadAccountUsageTrend 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.
theme.useThemeStore.applyColorScheme (cyclomatic 16) web/admin-spa/src/stores/theme.js:230— theme.useThemeStore.applyColorScheme has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
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.
(anonymous).applyColorScheme (cyclomatic 16) web/admin-spa/src/stores/theme.js:230— (anonymous).applyColorScheme has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
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). None of this is in the body itself: all 302 points belong to 22 function items inside it that branch (a function literal at line 1003, a function literal at line 839, a function literal at line 1282, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
data-transfer-enhanced.importData (cognitive 254) REDACTED: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) REDACTED: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.
(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.
_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.
handleRequest (cognitive 188) src/services/relay/openaiResponsesRelayService.js: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.
(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 (a function literal at line 1319, a function literal at line 1529, a function literal at line 1258, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(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.
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 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.
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.
handleAnthropicMessagesToGemini (cognitive 112) src/services/anthropicGeminiBridgeService.js:1859— handleAnthropicMessagesToGemini has cognitive complexity 112 (threshold 15). Drivers by points: if/else 103 (188 pts), boolean chains 73, ternaries 24 (39 pts), error handling 14 (28 pts), loops 4 (5 pts) (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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 item 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). None of this is in the body itself: all 107 points belong to 19 function items inside it that branch (a function literal at line 638, a function literal at line 765, a function literal at line 573, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(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.
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) REDACTED: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 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 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.
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) src/services/relay/grokRelayService.js: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 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 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.
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.
data-transfer.exportData (cognitive 76) REDACTED: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.
geminiHandlers.handleStandardStreamGenerateContent (cognitive 73) REDACTED:2506— geminiHandlers.handleStandardStreamGenerateContent has cognitive complexity 73 (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). To reduce it, split the body into named stages: move each independent 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 (geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock) 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.
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). None of this is in the body itself: all 72 points belong 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) REDACTED: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.
initialize (cognitive 64) REDACTED: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.
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.
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.
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 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.
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.
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.
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.
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.
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.
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.
(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) REDACTED: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.
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.
(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.
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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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, a function literal at line 59, a function literal at line 98). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_handle429Error (cognitive 44) src/services/relay/openaiResponsesRelayService.js: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.
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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.useDashboardStore.loadDashboardData (cognitive 42) web/admin-spa/src/stores/dashboard.js:235— dashboard.useDashboardStore.loadDashboardData has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 38, 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.
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.
(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.
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.
_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.
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.
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.
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.
logger.safeStringify (cognitive 38) REDACTED:10— logger.safeStringify has cognitive complexity 38 (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). To reduce it, split the body into named stages: move each independent 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 (logger.safeStringify::replacer) 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.
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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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.
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.
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.
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 (a function literal at line 460, a function literal at line 559, a function literal at line 533, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_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.
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 items inside it that branch (a function literal at line 559, a function literal at line 533, safeWrite, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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) REDACTED: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.
(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.
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.
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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 items inside it that branch (removeCacheControlFromMessages, removeCacheControlFromSystem, countCacheControlBlocks, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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 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.
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.
OpenAIResponsesRelayService._handleStreamResponse::parseSSEForUsage (cognitive 34) src/services/relay/openaiResponsesRelayService.js:499— OpenAIResponsesRelayService._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.
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) REDACTED: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) REDACTED: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.
(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.
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.
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.
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.
dashboard.router.get("/dashboard") (cognitive 32) src/routes/admin/dashboard.js:23— dashboard.router.get("/dashboard") has cognitive complexity 32 (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). To reduce it, split the body into named stages: move each independent 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 (dashboard.router.get("/dashboard")::countAccountStats) 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) (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.
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.
(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.
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.
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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs (cognitive 28) src/services/anthropicGeminiBridgeService.js:2486— anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 5, if/else 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.
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.
droidAccounts.router.get("/droid-accounts") (cognitive 28) src/routes/admin/droidAccounts.js:144— droidAccounts.router.get("/droid-accounts") has cognitive complexity 28 (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). 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 (droidAccounts.router.get("/droid-accounts")::parseUsage) 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.
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) REDACTED: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) REDACTED: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.
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.
_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.
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) REDACTED: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.
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.
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.
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.
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.
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) REDACTED: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.
_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.
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.
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.
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.
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.
logger.safeStringify::replacer (cognitive 23) REDACTED:13— logger.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. This shape REPEATS in the file: one other method here (logger.safeStringify) 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.
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 items inside it that branch (transformName, a function literal at line 336, a function literal at line 353, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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). None of this is in the body itself: all 23 points belong 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). None of this is in the body itself: all 23 points belong 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) REDACTED: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.
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.
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.
(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.
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.
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.
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.
geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock (cognitive 22) REDACTED:2801— geminiHandlers.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. This shape REPEATS in the file: one other method here (geminiHandlers.handleStandardStreamGenerateContent) 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.
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.
geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage (cognitive 22) REDACTED:79— geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. 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 (geminiApiAccounts.router.get("/gemini-api-accounts")) 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.
geminiApiAccounts.router.get("/gemini-api-accounts") (cognitive 22) REDACTED:13— geminiApiAccounts.router.get("/gemini-api-accounts") has cognitive complexity 22 (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). 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 (geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage) 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.
openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage (cognitive 22) REDACTED:90— openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. 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 (openaiResponsesAccounts.router.get("/openai-responses-accounts")) 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.
openaiResponsesAccounts.router.get("/openai-responses-accounts") (cognitive 22) REDACTED:24— openaiResponsesAccounts.router.get("/openai-responses-accounts") has cognitive complexity 22 (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). 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 (openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage) 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.
droidAccounts.router.get("/droid-accounts")::parseUsage (cognitive 22) src/routes/admin/droidAccounts.js:200— droidAccounts.router.get("/droid-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. 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 (droidAccounts.router.get("/droid-accounts")) 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.
grokAccounts.router.get("/grok-accounts")::parseUsage (cognitive 22) REDACTED:188— grokAccounts.router.get("/grok-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. 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 (grokAccounts.router.get("/grok-accounts")) 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.
system.router.get("/check-updates") (cognitive 22) REDACTED: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 item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_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.
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.
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.
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.
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.
GrokRelayService._handleStreamResponse::parseSSEForUsage (cognitive 21) src/services/relay/grokRelayService.js:275— GrokRelayService._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.
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) REDACTED: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). None of this is in the body itself: all 21 points belong to 2 function items inside it that branch (a function literal at line 839, shutdown). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
_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.
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.
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.
antigravityClient.request (cognitive 20) src/services/antigravityClient.js:259— antigravityClient.request has cognitive complexity 20 (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). To reduce it, split the body into named stages: move each independent 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.
grokAccounts.router.get("/grok-accounts") (cognitive 20) REDACTED:139— grokAccounts.router.get("/grok-accounts") has cognitive complexity 20 (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). 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 (grokAccounts.router.get("/grok-accounts")::parseUsage) 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.
dashboard.router.get("/dashboard")::countAccountStats (cognitive 20) src/routes/admin/dashboard.js:84— dashboard.router.get("/dashboard")::countAccountStats has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, 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. This shape REPEATS in the file: one other method here (dashboard.router.get("/dashboard")) 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.
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.
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 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.
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) REDACTED: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.
(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.
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.
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.
_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.
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 items 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) REDACTED: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.
dashboard.useDashboardStore.setTrendGranularity (cognitive 17) web/admin-spa/src/stores/dashboard.js:614— dashboard.useDashboardStore.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.
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.
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.
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.
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.
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.
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.
_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.
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.
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 · REDACTED: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) src/services/relay/grokRelayService.js:21— src/services/relay/grokRelayService.js:21 · src/services/relay/openaiResponsesRelayService.js: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 · REDACTED: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) REDACTED:832— REDACTED:832 · REDACTED: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) REDACTED: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) src/services/relay/openaiResponsesRelayService.js: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.
R3 · Large Files· web/admin-spa/src/components/accounts/AccountForm.vue · ×1
web/admin-spa/src/components/accounts/AccountForm.vue: 6637 lines of code web/admin-spa/src/components/accounts/AccountForm.vue:1— web/admin-spa/src/components/accounts/AccountForm.vue has 6637 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/AccountsView.vue · ×1
web/admin-spa/src/views/AccountsView.vue: 5419 lines of code web/admin-spa/src/views/AccountsView.vue:1— web/admin-spa/src/views/AccountsView.vue has 5419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 4835 lines of code REDACTED:1— REDACTED has 4835 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/ApiKeysView.vue · ×1
web/admin-spa/src/views/ApiKeysView.vue: 4687 lines of code web/admin-spa/src/views/ApiKeysView.vue:1— web/admin-spa/src/views/ApiKeysView.vue has 4687 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/relay/claudeRelayService.js · ×1
src/services/relay/claudeRelayService.js: 3288 lines of code src/services/relay/claudeRelayService.js:1— src/services/relay/claudeRelayService.js has 3288 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/account/claudeAccountService.js · ×1
src/services/account/claudeAccountService.js: 3131 lines of code src/services/account/claudeAccountService.js:1— src/services/account/claudeAccountService.js has 3131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/SettingsView.vue · ×1
web/admin-spa/src/views/SettingsView.vue: 3078 lines of code web/admin-spa/src/views/SettingsView.vue:1— web/admin-spa/src/views/SettingsView.vue has 3078 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 3013 lines of code REDACTED:1— REDACTED has 3013 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/anthropicGeminiBridgeService.js · ×1
src/services/anthropicGeminiBridgeService.js: 2812 lines of code src/services/anthropicGeminiBridgeService.js:1— src/services/anthropicGeminiBridgeService.js has 2812 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 2721 lines of code REDACTED:1— REDACTED has 2721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/apiKeyService.js · ×1
src/services/apiKeyService.js: 2572 lines of code src/services/apiKeyService.js:1— src/services/apiKeyService.js has 2572 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 2495 lines of code REDACTED:1— REDACTED has 2495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1863 lines of code REDACTED:1— REDACTED has 1863 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1755 lines of code REDACTED:1— REDACTED has 1755 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/scheduler/unifiedClaudeScheduler.js · ×1
src/services/scheduler/unifiedClaudeScheduler.js: 1751 lines of code src/services/scheduler/unifiedClaudeScheduler.js:1— src/services/scheduler/unifiedClaudeScheduler.js has 1751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/DashboardView.vue · ×1
web/admin-spa/src/views/DashboardView.vue: 1713 lines of code web/admin-spa/src/views/DashboardView.vue:1— web/admin-spa/src/views/DashboardView.vue has 1713 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/components/apikeys/EditApiKeyModal.vue · ×1
web/admin-spa/src/components/apikeys/EditApiKeyModal.vue: 1699 lines of code web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1— web/admin-spa/src/components/apikeys/EditApiKeyModal.vue has 1699 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1656 lines of code REDACTED:1— REDACTED has 1656 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue · ×1
web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue: 1568 lines of code web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1— web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue has 1568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1470 lines of code REDACTED:1— REDACTED has 1470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/requestDetailService.js · ×1
src/services/requestDetailService.js: 1430 lines of code src/services/requestDetailService.js:1— src/services/requestDetailService.js has 1430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/account/claudeConsoleAccountService.js · ×1
src/services/account/claudeConsoleAccountService.js: 1403 lines of code src/services/account/claudeConsoleAccountService.js:1— src/services/account/claudeConsoleAccountService.js has 1403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/relay/claudeConsoleRelayService.js · ×1
src/services/relay/claudeConsoleRelayService.js: 1387 lines of code src/services/relay/claudeConsoleRelayService.js:1— src/services/relay/claudeConsoleRelayService.js has 1387 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/relay/droidRelayService.js · ×1
src/services/relay/droidRelayService.js: 1354 lines of code src/services/relay/droidRelayService.js:1— src/services/relay/droidRelayService.js has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1343 lines of code REDACTED:1— REDACTED has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1271 lines of code REDACTED:1— REDACTED has 1271 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/components/accounts/OAuthFlow.vue · ×1
web/admin-spa/src/components/accounts/OAuthFlow.vue: 1221 lines of code web/admin-spa/src/components/accounts/OAuthFlow.vue:1— web/admin-spa/src/components/accounts/OAuthFlow.vue has 1221 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/RequestDetailsView.vue · ×1
web/admin-spa/src/views/RequestDetailsView.vue: 1174 lines of code web/admin-spa/src/views/RequestDetailsView.vue:1— web/admin-spa/src/views/RequestDetailsView.vue has 1174 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/ApiStatsView.vue · ×1
web/admin-spa/src/views/ApiStatsView.vue: 1131 lines of code web/admin-spa/src/views/ApiStatsView.vue:1— web/admin-spa/src/views/ApiStatsView.vue has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1092 lines of code REDACTED:1— REDACTED has 1092 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/routes/admin/claudeAccounts.js · ×1
src/routes/admin/claudeAccounts.js: 1045 lines of code src/routes/admin/claudeAccounts.js:1— src/routes/admin/claudeAccounts.js has 1045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/views/QuotaCardsView.vue · ×1
web/admin-spa/src/views/QuotaCardsView.vue: 1006 lines of code web/admin-spa/src/views/QuotaCardsView.vue:1— web/admin-spa/src/views/QuotaCardsView.vue has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/scheduler/unifiedOpenAIScheduler.js · ×1
src/services/scheduler/unifiedOpenAIScheduler.js: 903 lines of code src/services/scheduler/unifiedOpenAIScheduler.js:1— src/services/scheduler/unifiedOpenAIScheduler.js has 903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue · ×1
web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue: 901 lines of code web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:1— web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/relay/ccrRelayService.js · ×1
src/services/relay/ccrRelayService.js: 875 lines of code src/services/relay/ccrRelayService.js:1— src/services/relay/ccrRelayService.js has 875 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 873 lines of code REDACTED:1— REDACTED has 873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 830 lines of code REDACTED:1— REDACTED has 830 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/services/relay/openaiResponsesRelayService.js · ×1
src/services/relay/openaiResponsesRelayService.js: 829 lines of code src/services/relay/openaiResponsesRelayService.js:1— src/services/relay/openaiResponsesRelayService.js has 829 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 818 lines of code REDACTED:1— REDACTED has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/utils/grokHelper.js: 818 lines of code src/utils/grokHelper.js:1— src/utils/grokHelper.js has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
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.
Swallowed exception (caught, then discarded) src/services/openaiToClaude.js:152— `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/views/ApiKeyUsageRecordsView.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/admin/UserUsageStatsModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/routes/admin/sync.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/user/UserUsageStats.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/services/accountTestSchedulerService.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/settings/ModelPricingSection.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/user/UserApiKeysManager.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/accounts/BalanceDisplay.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/services/userMessageQueueService.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/services/geminiToOpenAI.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/utils/commonHelper.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/views/BalanceScriptsView.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/tutorial/NodeInstallTutorial.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/admin/ChangeRoleModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/routes/admin/concurrency.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/apistats/ServiceCostCards.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/user/CreateApiKeyModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/user/ViewApiKeyModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/tutorial/GeminiCliTutorial.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file web/admin-spa/src/components/apikeys/RecordDetailModal.vue:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
+ 26 more in this group — see findings.md.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×40
Diagnostic log message is built whether or not it is wanted REDACTED:313— `debug` at line 313 is called with an argument built by `Object.keys(entries[0])` (line 316), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted REDACTED:560— `debug` at line 560 is called with an argument built by `Object.keys(ldapEntry || { })` (line 563), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:107— `debug` at line 107 is called with an argument built by `JSON.stringify(processedBody)` (line 116), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:119— `debug` at line 119 is called with an argument built by `Object.keys(requestHeaders)` (line 122), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:127— `debug` at line 127 is called with an argument built by `Object.keys(processedBody)` (line 130), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:142— `debug` at line 142 is called with an argument built by `Object.keys(response.headers || { })` (line 146), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:621— `debug` at line 621 is called with an argument built by `Object.keys(responseData || { })` (line 622), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:98— `debug` at line 98 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 98), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:161— `debug` at line 161 is called with an argument built by `JSON.stringify(options)` (line 161), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:162— `debug` at line 162 is called with an argument built by `JSON.stringify(clientHeaders)` (line 162), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:166— `debug` at line 166 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 166), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:208— `debug` at line 208 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 209), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:221— `debug` at line 221 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 223), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:253— `debug` at line 253 is called with an argument built by `JSON.stringify(response.headers)` (line 253), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:255— `debug` at line 255 is called with an argument built by `JSON.stringify(response.data)` (line 256), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:258— `debug` at line 258 is called with an argument built by `JSON.stringify(response.data)` (line 259), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:584— `debug` at line 584 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 584), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:817— `debug` at line 817 is called with an argument built by `JSON.stringify(collectedUsage)` (line 817), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:139— `debug` at line 139 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 139), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:204— `debug` at line 204 is called with an argument built by `JSON.stringify(options)` (line 204), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:205— `debug` at line 205 is called with an argument built by `JSON.stringify(clientHeaders)` (line 205), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:209— `debug` at line 209 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 209), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:251— `debug` at line 251 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 252), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:264— `debug` at line 264 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 266), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted src/services/relay/claudeConsoleRelayService.js:296— `debug` at line 296 is called with an argument built by `JSON.stringify(response.headers)` (line 296), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Interpolated log message defeats structured logging REDACTED:62— `info` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:125— `info` at line 125 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:256— `info` at line 256 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:274— `info` at line 274 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:507— `info` at line 507 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:610— `info` at line 610 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:613— `info` at line 613 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:616— `info` at line 616 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:617— `info` at line 617 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:618— `info` at line 618 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:624— `info` at line 624 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:657— `info` at line 657 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:664— `info` at line 664 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:699— `info` at line 699 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:708— `info` at line 708 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:781— `error` at line 781 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:786— `info` at line 786 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:789— `warn` at line 789 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:836— `info` at line 836 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging REDACTED:901— `info` at line 901 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/validators/clientValidator.js:38— `warn` at line 38 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/validators/clientValidator.js:62— `warn` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/validators/clientValidator.js:69— `error` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/validators/clientValidator.js:97— `warn` at line 97 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/validators/clientValidator.js:103— `debug` at line 103 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Duplicated predicate src/services/relay/claudeRelayService.js:1116— `!Array.isArray(messages) || messages.length === 0` appears character-identically in 2 files — src/services/relay/claudeRelayService.js, src/services/userMessageQueueService.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/accountBalanceService.js:651— `!Number.isFinite(dailyQuota) || dailyQuota <= 0` appears character-identically in 2 files — src/services/account/accountBalanceService.js, src/services/balanceProviders/baseBalanceProvider.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/scheduler/droidScheduler.js:63— `!account || !isAccountHealthy(account) || !this._isAccountSchedulable(account)` appears character-identically in 2 files — src/services/scheduler/droidScheduler.js, src/services/scheduler/grokScheduler.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/geminiApiAccountService.js:423— `!account || account.rateLimitStatus !== 'limited'` appears character-identically in 3 files — src/services/account/geminiApiAccountService.js, src/services/account/grokAccountService.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:408— `!accountData || Object.keys(accountData).length === 0` appears character-identically in 8 files — REDACTED, src/services/account/azureOpenaiAccountService.js, src/services/account/ccrAccountService.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 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:1279— `!command || command === '--help' || command === 'help'` 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— `!importDataObj.metadata || !importDataObj.data` 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/account/grokAccountService.js:227— `!includeInactive && accountData.isActive !== 'true'` appears character-identically in 2 files — src/services/account/grokAccountService.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:2467— `!keyData || Object.keys(keyData).length === 0` appears character-identically in 6 files — REDACTED, 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:426— `!messages || !Array.isArray(messages) || messages.length === 0` 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/account/ccrAccountService.js:599— `!modelMapping || Object.keys(modelMapping).length === 0` appears character-identically in 3 files — src/services/account/ccrAccountService.js, src/services/account/claudeConsoleAccountService.js, 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 REDACTED:344— `!password || typeof password !== 'string'` appears character-identically in 2 files — REDACTED, src/utils/inputValidator.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/bedrockRelayService.js:122— `!queueResult.acquired && !queueResult.skipped` appears character-identically in 4 files — src/services/relay/bedrockRelayService.js, src/services/relay/ccrRelayService.js, src/services/relay/claudeConsoleRelayService.js, src/services/relay/claudeRelayService.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/droidRelayService.js:58— `!requestBody || typeof requestBody !== 'object'` appears character-identically in 2 files — src/services/relay/droidRelayService.js, src/utils/sessionHelper.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:573— `!supportedModels || (Array.isArray(supportedModels) && supportedModels.length === 0)` 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 src/services/account/claudeAccountService.js:2260— `!usageData || typeof usageData !== 'object'` appears character-identically in 2 files — src/services/account/claudeAccountService.js, src/services/relay/openaiResponsesRelayService.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:2090— `!usageReported && totalUsage.totalTokenCount > 0` 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:1312— `'realCostMicro' in data || 'ratedCostMicro' in data` appears character-identically in 3 files — REDACTED, 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: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 REDACTED:494— `abortController && !abortController.signal.aborted` appears character-identically in 8 files — REDACTED, REDACTED, REDACTED, src/services/relay/bedrockRelayService.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:266— `account && account.accountType === 'group'` appears character-identically in 4 files — REDACTED, src/routes/admin/claudeAccounts.js, src/routes/admin/claudeConsoleAccounts.js, src/routes/admin/geminiAccounts.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.
Deprecated: @humanwhocodes/config-array REDACTED:1518— @humanwhocodes/config-array 0.13.0 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/config-array instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @humanwhocodes/object-schema REDACTED:1573— @humanwhocodes/object-schema 2.0.3 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/object-schema instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/asn1 REDACTED:2079— @ldapjs/asn1 2.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/attribute REDACTED:2086— @ldapjs/attribute 1.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/change REDACTED:2098— @ldapjs/change 1.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/controls REDACTED:2109— @ldapjs/controls 2.1.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/asn1 REDACTED:2120— @ldapjs/asn1 1.2.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/dn REDACTED:2127— @ldapjs/dn 1.1.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/filter REDACTED:2138— @ldapjs/filter 2.1.1 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/messages REDACTED:2150— @ldapjs/messages 1.3.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @ldapjs/protocol REDACTED:2167— @ldapjs/protocol 1.2.1 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: glob REDACTED:5236— glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: inflight REDACTED:5575— inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: node-domexception REDACTED:7041— node-domexception 1.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "Use your platform's native DOMException instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: rimraf REDACTED:8020— rimraf 3.0.2 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: superagent REDACTED:8597— superagent 8.1.2 is resolved in REDACTED and is marked deprecated by its publisher: "Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @humanwhocodes/config-array REDACTED:622— @humanwhocodes/config-array 0.13.0 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/config-array instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: @humanwhocodes/object-schema REDACTED:652— @humanwhocodes/object-schema 2.0.3 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/object-schema instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: glob REDACTED:2651— glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: inflight REDACTED:2807— inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: rimraf REDACTED:4008— rimraf 3.0.2 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
P2 · Observability· Console output used as the logging channel · ×14
Console output used as the logging channel src/utils/costCalculator.js:368— `src/utils/costCalculator.js` reports through `console.*` at line 368 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/utils/costCalculator.js:376— `src/utils/costCalculator.js` reports through `console.*` at line 376 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:203— `REDACTED` reports through `console.*` at line 203 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:207— `REDACTED` reports through `console.*` at line 207 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:211— `REDACTED` reports through `console.*` at line 211 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:335— `REDACTED` reports through `console.*` at line 335 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/utils/lruCache.js:89— `src/utils/lruCache.js` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/utils/lruCache.js:102— `src/utils/lruCache.js` reports through `console.*` at line 102 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/utils/lruCache.js:128— `src/utils/lruCache.js` reports through `console.*` at line 128 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/utils/runtimeAddon.js:114— `src/utils/runtimeAddon.js` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/utils/runtimeAddon.js:116— `src/utils/runtimeAddon.js` reports through `console.*` at line 116 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:3014— `REDACTED` reports through `console.*` at line 3014 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:3081— `REDACTED` reports through `console.*` at line 3081 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:3171— `REDACTED` reports through `console.*` at line 3171 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
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.
Outdated (npm): commander package.json:57— 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): inquirer package.json:65— inquirer is pinned at 8.2.7; registry.npmjs.org publishes 14.2.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): nodemailer package.json:70— nodemailer is pinned at 7.0.11; registry.npmjs.org publishes 10.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): ora package.json:71— 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): rate-limiter-flexible package.json:72— rate-limiter-flexible is pinned at 5.0.5; registry.npmjs.org publishes 11.2.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): uuid package.json:76— uuid is pinned at 9.0.1; registry.npmjs.org publishes 14.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.
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.
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.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: REDACTED, src/utils/rateLimitHeaderHelper.js, src/utils/accountRollingUsage.js. Pair on, review, or document these before any departure.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies REDACTED:197— Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 8 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 (17 single-owned of 234 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 234 of the 267 production source files in this repository met that bar). They are anonymized user #3 (3 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue, web/admin-spa/src/components/apikeys/RecordDetailModal.vue, src/routes/admin/accountBalance.js, src/services/relay/bedrockRelayService.js, src/services/quotaCardService.js, REDACTED, src/services/requestIdentityService.js, src/routes/admin/concurrency.js (+2 more).
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 module-visible 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) — 51 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: REDACTED, src/routes/admin/sync.js, src/services/accountTestSchedulerService.js, src/services/userMessageQueueService.js, src/services/geminiToOpenAI.js, src/utils/commonHelper.js, web/admin-spa/src/views/ApiKeyUsageRecordsView.vue, src/routes/admin/concurrency.js (and 43 more) (64 orphaned of 234 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 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.
README/code drift README_EN.md:85— README_EN.md links to `docs/preview.md`, but `docs/preview.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
No SAST REDACTED:4— 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 dependency-update automation package.json:51— `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
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.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 10/47 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Outdated (npm): @aws-sdk/client-bedrock-runtime — @aws-sdk/client-bedrock-runtime is pinned at 3.943.0; registry.npmjs.org publishes 3.1160.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.1160.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.21.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.6.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): 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.9 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.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): google-auth-library — google-auth-library is pinned at 10.5.0; registry.npmjs.org publishes 11.3.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): 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): 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): pinia — pinia is pinned at 2.3.1; registry.npmjs.org publishes 4.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): socks-proxy-agent — socks-proxy-agent is pinned at 8.0.5; registry.npmjs.org publishes 10.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): vue — vue is pinned at 3.5.18; registry.npmjs.org publishes 3.5.44 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): vue-router — vue-router is pinned at 4.5.1; registry.npmjs.org publishes 5.4.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): winston — winston is pinned at 3.18.3; registry.npmjs.org publishes 3.19.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): winston-daily-rotate-file — winston-daily-rotate-file is pinned at 4.7.1; registry.npmjs.org publishes 5.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.
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 01a18a22-f8b0-7517-9423-0a0e98e3dfee · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 229 · Warnings: 1496 · Recommendations: 234 · Info: 25 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 30-10-2026 @ 00:08 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.