Public report of Yeachan-Heo/oh-my-codex, published 7 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.2). 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, 7 November 2026, 18:11 UTC · Survey ID cd_1d5e23bd4bdf450a92a59801667e1f41
Yeachan-Heo/oh-my-codex
Measured 7 November 2026, 18:06 UTC, at code version dd0eba5
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureTestRunFailed).
CAI scoreAt riskUp 4 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 210,059 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 3.4 person-years · Weakest lens: Code Health, 48
Findings by how serious they are
94 critical2049 serious189 minor
7 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
7 November 2026, 18:06 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
81of 81 dimensions measured by tools.
2320of 2332 findings point to an exact file and line, so you can open each one in the code. The other 12 concern the repository as a whole, such as missing documentation.
81dimensions across 7 lenses, read from 210,059 lines of product code in 8 projects.
Yeachan-Heo/oh-my-codex is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 59 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Code Health, at 48, is the weakest lens and counts most in the score. The best first step is splitting the oversized files, worth about 6 points. Removing the blocking calls comes next, worth about 4 points. Raising Code Health to 67 would lift the score to about 66.
Seventy-two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seven known security holes in the packages the code depends on can be used by attackers, and four sets of files in separate parts keep changing together, which points to hidden dependencies. Pinning each tool to an exact version, updating the vulnerable packages and making the hidden dependencies explicit would close these risks. The two places where the code runs text as code or as a command need a direct call instead. The two unsafe settings in infrastructure or container files need changing to safe values. The four loops of files that import each other need breaking.
The product code is 210,059 lines, about €490,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.
We compare 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: 1628 findings
These 1628 critical or serious findings were in the previous survey, on 21 October 2026, and are gone from this one. The first 100 are listed here.
€160,000 to €820,000, for 2,706 to 8,584 hours of work, about 3.4 person-years for 2 to 7 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.8 at a score of 59. 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: 210,059 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: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 6 points · Medium effort · Large Files
2
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.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €490,000 to build again, about 3.4 person-years of work. Its weakest lens is Code Health, at 48 (Weak). 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
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 214,411 lines over the last 90 days, which is about 869,556 lines a year. At that pace, the extra work comes to an estimated 109.5 to 657 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
361 modules, with 402 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 321 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.
omx_runtime_core.engine uses omx_runtime_core, so a change to omx_runtime_core can break omx_runtime_core.engine, while a change to omx_runtime_core.engine can't break omx_runtime_core.
Position
Below the diagonal: omx_runtime_core.engine uses a module listed above it, which is the healthy direction.
src.adapt.herdr uses src.adapt.herdr.bridge, so a change to src.adapt.herdr.bridge can break src.adapt.herdr, while a change to src.adapt.herdr can't break src.adapt.herdr.bridge.
Position
Below the diagonal: src.adapt.herdr uses a module listed above it, which is the healthy direction.
src.adapt.herdr uses src.hooks.extensibility.types, so a change to src.hooks.extensibility.types can break src.adapt.herdr, while a change to src.adapt.herdr can't break src.hooks.extensibility.types.
Position
Below the diagonal: src.adapt.herdr uses a module listed above it, which is the healthy direction.
src.autoresearch uses src.autoresearch.contracts, so a change to src.autoresearch.contracts can break src.autoresearch, while a change to src.autoresearch can't break src.autoresearch.contracts.
Position
Below the diagonal: src.autoresearch uses a module listed above it, which is the healthy direction.
34 pairs of types, where a type in src.config uses a type in src.config.codex-hooks. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.config uses src.config.codex-hooks, so a change to src.config.codex-hooks can break src.config, while a change to src.config can't break src.config.codex-hooks.
Position
Below the diagonal: src.config uses a module listed above it, which is the healthy direction.
24→29 src.mcp.state-paths uses src.hooks.sessionpart of a loop✕
Connections
4 pairs of types, where a type in src.mcp.state-paths uses a type in src.hooks.session.
src.mcp.state-paths uses src.hooks.session, so a change to src.hooks.session can break src.mcp.state-paths, while a change to src.mcp.state-paths can't break src.hooks.session.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
src.question uses src.question.types, so a change to src.question.types can break src.question, while a change to src.question can't break src.question.types.
Position
Below the diagonal: src.question uses a module listed above it, which is the healthy direction.
src.ralplan uses src.ralplan.runtime-contract, so a change to src.ralplan.runtime-contract can break src.ralplan, while a change to src.ralplan can't break src.ralplan.runtime-contract.
Position
Below the diagonal: src.ralplan uses a module listed above it, which is the healthy direction.
src.team.state.types uses src.team.worktree, so a change to src.team.worktree can break src.team.state.types, while a change to src.team.state.types can't break src.team.worktree.
Position
Below the diagonal: src.team.state.types uses a module listed above it, which is the healthy direction.
src.utils uses src.agents.definitions, so a change to src.agents.definitions can break src.utils, while a change to src.utils can't break src.agents.definitions.
Position
Below the diagonal: src.utils uses a module listed above it, which is the healthy direction.
src.utils uses src.utils.file-durability, so a change to src.utils.file-durability can break src.utils, while a change to src.utils can't break src.utils.file-durability.
Position
Below the diagonal: src.utils uses a module listed above it, which is the healthy direction.
src.hooks.session uses src.utils.file-durability, so a change to src.utils.file-durability can break src.hooks.session, while a change to src.hooks.session can't break src.utils.file-durability.
Position
Below the diagonal: src.hooks.session uses a module listed above it, which is the healthy direction.
src.hooks.session uses src.mcp.state-paths, so a change to src.mcp.state-paths can break src.hooks.session, while a change to src.hooks.session can't break src.mcp.state-paths.
Position
Below the diagonal: src.hooks.session uses a module listed above it, which is the healthy direction.
src.state uses src.mcp.state-paths, so a change to src.mcp.state-paths can break src.state, while a change to src.state can't break src.mcp.state-paths.
Position
Below the diagonal: src.state uses a module listed above it, which is the healthy direction.
src.team.runtime uses src.team.repo-aware-decomposition, so a change to src.team.repo-aware-decomposition can break src.team.runtime, while a change to src.team.runtime can't break src.team.repo-aware-decomposition.
Position
Below the diagonal: src.team.runtime uses a module listed above it, which is the healthy direction.
src.team.runtime uses src.team.worktree, so a change to src.team.worktree can break src.team.runtime, while a change to src.team.runtime can't break src.team.worktree.
Position
Below the diagonal: src.team.runtime uses a module listed above it, which is the healthy direction.
src.team.runtime uses src.team.state.types, so a change to src.team.state.types can break src.team.runtime, while a change to src.team.runtime can't break src.team.state.types.
Position
Below the diagonal: src.team.runtime uses a module listed above it, which is the healthy direction.
src.team.state uses src.team.worktree, so a change to src.team.worktree can break src.team.state, while a change to src.team.state can't break src.team.worktree.
Position
Below the diagonal: src.team.state uses a module listed above it, which is the healthy direction.
31 pairs of types, where a type in src.team.state uses a type in src.team.state.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.team.state uses src.team.state.types, so a change to src.team.state.types can break src.team.state, while a change to src.team.state can't break src.team.state.types.
Position
Below the diagonal: src.team.state uses a module listed above it, which is the healthy direction.
src.cli uses src.autoresearch.contracts, so a change to src.autoresearch.contracts can break src.cli, while a change to src.cli can't break src.autoresearch.contracts.
Position
Below the diagonal: src.cli uses a module listed above it, which is the healthy direction.
31 pairs of types, where a type in src.cli uses a type in src.cli.setup. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.cli uses src.config.codex-hooks, so a change to src.config.codex-hooks can break src.cli, while a change to src.cli can't break src.config.codex-hooks.
Position
Below the diagonal: src.cli uses a module listed above it, which is the healthy direction.
src.cli uses src.utils.file-durability, so a change to src.utils.file-durability can break src.cli, while a change to src.cli can't break src.utils.file-durability.
Position
Below the diagonal: src.cli uses a module listed above it, which is the healthy direction.
src.hooks.prompt-session-provenance uses src.hooks.session, so a change to src.hooks.session can break src.hooks.prompt-session-provenance, while a change to src.hooks.prompt-session-provenance can't break src.hooks.session.
Position
Below the diagonal: src.hooks.prompt-session-provenance uses a module listed above it, which is the healthy direction.
src.team uses src.team.repo-aware-decomposition, so a change to src.team.repo-aware-decomposition can break src.team, while a change to src.team can't break src.team.repo-aware-decomposition.
Position
Below the diagonal: src.team uses a module listed above it, which is the healthy direction.
40 pairs of types, where a type in src.team uses a type in src.team.state.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.team uses src.team.state.types, so a change to src.team.state.types can break src.team, while a change to src.team can't break src.team.state.types.
Position
Below the diagonal: src.team uses a module listed above it, which is the healthy direction.
src.hooks.keyword-detector uses src.hooks.prompt-session-provenance, so a change to src.hooks.prompt-session-provenance can break src.hooks.keyword-detector, while a change to src.hooks.keyword-detector can't break src.hooks.prompt-session-provenance.
Position
Below the diagonal: src.hooks.keyword-detector uses a module listed above it, which is the healthy direction.
src.scripts.notify-hook uses src.hooks.session, so a change to src.hooks.session can break src.scripts.notify-hook, while a change to src.scripts.notify-hook can't break src.hooks.session.
Position
Below the diagonal: src.scripts.notify-hook uses a module listed above it, which is the healthy direction.
src.scripts.notify-hook uses src.hooks.prompt-session-provenance, so a change to src.hooks.prompt-session-provenance can break src.scripts.notify-hook, while a change to src.scripts.notify-hook can't break src.hooks.prompt-session-provenance.
Position
Below the diagonal: src.scripts.notify-hook uses a module listed above it, which is the healthy direction.
src.hooks uses src.utils.file-durability, so a change to src.utils.file-durability can break src.hooks, while a change to src.hooks can't break src.utils.file-durability.
Position
Below the diagonal: src.hooks uses a module listed above it, which is the healthy direction.
36 pairs of types, where a type in src.hooks uses a type in src.hooks.session. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.hooks uses src.hooks.prompt-session-provenance, so a change to src.hooks.prompt-session-provenance can break src.hooks, while a change to src.hooks can't break src.hooks.prompt-session-provenance.
Position
Below the diagonal: src.hooks uses a module listed above it, which is the healthy direction.
src.hooks uses src.hooks.keyword-detector, so a change to src.hooks.keyword-detector can break src.hooks, while a change to src.hooks can't break src.hooks.keyword-detector.
Position
Below the diagonal: src.hooks uses a module listed above it, which is the healthy direction.
src.scripts uses src.agents.definitions, so a change to src.agents.definitions can break src.scripts, while a change to src.scripts can't break src.agents.definitions.
Position
Below the diagonal: src.scripts uses a module listed above it, which is the healthy direction.
src.scripts uses src.config.codex-hooks, so a change to src.config.codex-hooks can break src.scripts, while a change to src.scripts can't break src.config.codex-hooks.
Position
Below the diagonal: src.scripts uses a module listed above it, which is the healthy direction.
src.scripts uses src.hooks.session, so a change to src.hooks.session can break src.scripts, while a change to src.scripts can't break src.hooks.session.
Position
Below the diagonal: src.scripts uses a module listed above it, which is the healthy direction.
src.scripts uses src.hooks.prompt-session-provenance, so a change to src.hooks.prompt-session-provenance can break src.scripts, while a change to src.scripts can't break src.hooks.prompt-session-provenance.
Position
Below the diagonal: src.scripts uses a module listed above it, which is the healthy direction.
src.scripts uses src.hooks.keyword-detector, so a change to src.hooks.keyword-detector can break src.scripts, while a change to src.scripts can't break src.hooks.keyword-detector.
Position
Below the diagonal: src.scripts uses a module listed above it, which is the healthy direction.
src.scripts uses src.scripts.notify-hook, so a change to src.scripts.notify-hook can break src.scripts, while a change to src.scripts can't break src.scripts.notify-hook.
Position
Below the diagonal: src.scripts uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 48% · Adequate · gated by D1, D2, R3 ·
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
92
High / Critical
A03:2025 — Software Supply Chain Failures
18
High / Critical
A02:2025 — Security Misconfiguration
3
High / Critical
Roadmap
Top priorities: Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; 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; Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
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.
Bring the 53 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with codex-native-hook.dispatchCodexNativeHook (cyclomatic 290), api-interop.executeTeamApiOperation (cyclomatic 275), codex-native-hook.collectConductorDownloaderOutputTargets (cyclomatic 274).
Bring the 100 bodies over 60 down to 60 or less in Cognitive Complexity — start with codex-native-hook.collectConductorDownloaderOutputTargets (cognitive 476), codex-native-hook.dispatchCodexNativeHook (cognitive 441), setup.setup (cognitive 394).
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 — 94
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 — 2049
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 — 189
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 7
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 81 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 81 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, 2320 of 2332 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 or a scanner, 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.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 8,419 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 4 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the node:test run in packages/vscode-extension/ produced no per-test report (> oh-my-codex-vscode@0.5.7 test). This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the node:test suite in packages/vscode-extension/ was NOT MEASURED: the node:test run in packages/vscode-extension/ produced no per-test report (> oh-my-codex-vscode@0.5.7 test). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (111 contributor(s) across 4336 commit(s) sampled, automation and bot accounts excluded). One of them holds 84% of the history; the other 110 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `REDACTED`, `src/cli/cleanup.ts`, `src/cli/index.ts`, `src/cli/setup.ts`, `src/config/codex-hooks.ts`, … (+12 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in src/config/generator.ts, whose lifetimes are not modelled 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.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The dev server kept running but no port it opened served a page in the time allowed. (rule: no-answer). The renderer reported: the dev server (`npm run dev`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> oh-my-codex@0.21.47 dev / > tsc --watch / 06:08:43 PM - Starting compilation in watch mode... / 06:08:48 PM - Found 0 errors. Watching for file changes." No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> oh-my-codex@0.21.47 dev / > tsc --watch / 06:08:43 PM - Starting compilation in watch mode... / 06:08:48 PM - Found 0 errors. Watching for file changes." No runtime evidence was gathered.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
PF3 Async & latency hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 411 further occurrence(s) are not listed individually; the score already reflects all 451.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 633 further occurrence(s) are not listed individually; the score already reflects all 673.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 55 further occurrence(s) are not listed individually; the score already reflects all 95.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 54 further occurrence(s) are not listed individually; the score already reflects all 94.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 432 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled certificate validation, obsolete TLS versions, plaintext password storage and session cookies set without HttpOnly, Secure or SameSite, and none was found. The server controls this dimension also scores were not assessed, so no score is given.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 495 further occurrence(s) are not listed individually; the score already reflects all 535.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D25 ADR Conformance: ADR conformance checks only decisions stated in a checkable form (a ruled-out element, package or dependency, an adr-rules block, a declared delivery status): a decision written only as prose is unverifiable, and decisions never written down are not checked.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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.
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.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
707 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was codex-native-hook.dispatchCodexNativeHook at 290. A further 10 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 team.sampleValueForTeamApiField at 36 — they are counted neither in the figure above nor in this dimension's score.
+ 687 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 53 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with codex-native-hook.dispatchCodexNativeHook (cyclomatic 290), api-interop.executeTeamApiOperation (cyclomatic 275), codex-native-hook.collectConductorDownloaderOutputTargets (cyclomatic 274). — 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 53 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; 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.
+ 844 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 100 bodies over 60 down to 60 or less in Cognitive Complexity — start with codex-native-hook.collectConductorDownloaderOutputTargets (cognitive 476), codex-native-hook.dispatchCodexNativeHook (cognitive 441), setup.setup (cognitive 394). — 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 100 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; 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 Classes8.3 / 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 68 FunctionTooLong finding(s) in God Classes — start with REDACTED (6), REDACTED (6), setup.ts (5). — One of this dimension's main actionable groups (68 warning-level).
Resolve the 56 FileTooLong finding(s) in God Classes — start with REDACTED (3), index.ts (2), REDACTED (2). — One of this dimension's main actionable groups (56 warning-level).
Resolve the 1 ClassTooLong finding(s) in God Classes — start with setup.ts. — One of this dimension's main actionable groups (1 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.
25 duplicated block group(s) detected. A further 2 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 7 of the 27 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .ts (93% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
Members sharing a duplicated core (4 members, 50+ identical tokens)crates/omx-api/src/lib.rs:1250
+ 17 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with main.rs (2), lib.rs. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with eval-noisy-bayesopt-highdim.py, codex_bridge.rs. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with main.rs, optimizer.py. — One of this dimension's main actionable groups (2 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.0 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
8 production modules (Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 2 module(s) off the main sequence.
Off the main sequence: omx-runtime-core · ×2
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Resolve the 3 Classify ADR enforcement finding(s) in Architectural Integrity — start with 3194-codex-01445-documented-leader-proof.md, 3212-same-user-native-child-auth-boundary.md, 3459-team-tmux-argv-separator-boundary.md. — One of this dimension's main actionable groups (3 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_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.
8704 test methods: 8605 unit, 76 integration, 0 BDD, 23 e2e. The JavaScript/TypeScript suite contributes 8419 `it`/`test` case(s) across 476 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 285 `#[test]` function(s) across 20 file(s) declaring at least one; its unit/integration split is Cargo's own — 4 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Adequategated by 1 critical finding✓ 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.
24 skipped (24 with a documented reason), 11 zero-assertion, 1 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 8419 tests. Measured on the JavaScript/TypeScript suite only — at least 4 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions (empty test): backs off idle polling and resets to the base cadence after fresh rollout activitysrc/hooks/__tests__/notify-fallback-watcher.test.ts:4374
No assertions: removeTeamWorkerInstructionsFile is safe to call when file does not exist · ×10src/team/__tests__/worker-bootstrap.test.ts:1509
Fixed-sleep synchronisation: backs off identical failed detached repair attemptssrc/hud/__tests__/watch-detached.test.ts:374
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with notify-fallback-watcher.test.ts. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 10 No assertions finding(s) in Test Quality — start with notifier.test.ts (4), sdk.test.ts (2), worker-bootstrap.test.ts. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 Fixed-sleep synchronisation finding(s) in Test Quality — start with watch-detached.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
0 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from Cargo.lock there.
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.
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 18 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's Cargo.lock closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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.
Top hotspots: src/cli/index.ts (70×212=14840); src/cli/setup.ts (49×231=11319); src/scripts/codex-native-hook.ts (35×290=10150) Repeated repair below the complexity floor: src/team/mcp-comm.ts (4 of 4 changes were fixes); src/scripts/sync-plugin-mirror.ts (4 of 4 changes were fixes); src/auth/redact.ts (4 of 4 changes were fixes)
Resolve the 44 Hotspot finding(s) in Churn × Complexity Hotspots — start with index.ts (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (44 warning-level).
Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mcp-comm.ts, sync-plugin-mirror.ts, redact.ts. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 207932 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
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. 237 document(s) read across 2 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality6.0 / 10Adequate✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
3 of 3 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
ADR has no Context section · ×3docs/adr/3194-codex-01445-documented-leader-proof.md:1detected by adr-integrity
What to do
Resolve the 3 ADR has no Context section finding(s) in ADR Quality — start with 3194-codex-01445-documented-leader-proof.md, 3212-same-user-native-child-auth-boundary.md, 3459-team-tmux-argv-separator-boundary.md. — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.
Method: Each binding ADR read for checkable forms: a backticked element its Decision section rules out, a ruled-out package the manifests declare, a forbidden module dependency, an opt-in adr-rules block, and a declared delivery status the code does not yet carry. A prose decision with no checkable form is unverifiable, neither a finding nor a pass. Deterministic, no model. Advisory.
1 of 1 checkable records are broken by the code or by their own declared delivery (1 of 3 binding records state a rule in checkable form or declare their delivery; prose decisions are unverifiable).
ADR not followed: ADR 3194: Documented leader proof for exact reviewed Codex releasesdocs/adr/3194-codex-01445-documented-leader-proof.md:7detected by adr-prohibition
What to do
Resolve the 1 ADR not followed finding(s) in ADR Conformance — start with 3194-codex-01445-documented-leader-proof.md. — One of this dimension's main actionable groups (1 recommendation-level).
Enforce ADR Conformance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d25_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 8 build units (Cargo, 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: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
14 % of calls cross a namespace and 2 % go through an interface, but 87 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret 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.
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).
92 finding(s): 0 critical, 75 high, 17 medium, 0 low. 72 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 65 file(s) — `docs/index.html` (lines 109–114), `src/agents/__tests__/definitions.test.ts` (line 109), `REDACTED` (line 852), `src/cli/__tests__/agents-init.test.ts`, `src/cli/__tests__/doctor-warning-copy.test.ts`, … (+60 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 72 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 (72 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 6 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d31_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.
7 of 358 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/team/dag-schema.ts. Counted over 358 of the 464 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned file · ×7src/team/dag-schema.ts:1
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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 4 Boundary-crossing change coupling finding(s) in Change Coupling — start with session.ts, REDACTED, team-tmux-guard.ts. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 2 Change coupling finding(s) in Change Coupling — start with contracts.ts, codex_bridge.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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 — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
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).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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 1 platform declaration(s) and 6 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.
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.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
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.
The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. (×2) — plugins/oh-my-codex/hooks/codex-native-hook.mjs:925, src/cli/plugin-marketplace.ts:1369
`autoresearchCommand` 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/cli/autoresearch.ts:104
The guard above `return false;` also returns `false`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. (×3) — REDACTED:1299, src/team/tmux-session.ts:3645, src/team/tmux-session.ts:3767
`exploreCommand` 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/cli/explore.ts:89
`listCommand` 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/cli/list.ts:29
`setupNotifyHook` 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/cli/setup.ts:6933
`defaultRunProcess` 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/hud/authority.ts:70
`assertModeStartAllowed` 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/modes/base.ts:176
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. (×2) — src/notifications/formatter.ts:153, src/scripts/notify-hook/team-worker-posttooluse.ts:346
`buildNativeOutsideTmuxUltragoalPromptBlockState` 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/scripts/codex-native-hook.ts:2707
`buildRalplanPreToolUseBoundaryOutput` 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/scripts/codex-native-hook.ts:10785
`buildDeepInterviewPreToolUseBoundaryOutput` 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/scripts/codex-native-hook.ts:10806
`buildPlanningRootPointerConflictPreToolUseOutput` 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/scripts/codex-native-hook.ts:10868
`buildUltragoalNoOwnerActivationGuardOutput` 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/scripts/codex-native-hook.ts:11051
`buildConductorPreToolUseWriteGuardOutput` 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/scripts/codex-native-hook.ts:20422
`buildOversizedStopInactiveWorkflowOutput` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src/scripts/codex-native-hook.ts:23079
The guard above `return 'still_actionable';` also returns `'still_actionable'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/scripts/notify-hook/orchestration-intent.ts:48
`isReportTrackedInIndex` 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/team/runtime.ts:1708
`probeProcessIdentity` 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/team/runtime.ts:2654
The guard above `return 'auto';` also returns `'auto'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/team/state.ts:625
The guard above `return null;` also returns `null`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. (×2) — src/team/state.ts:1671, src/team/state.ts:2761
The guard above `return unknownStatus;` also returns `unknownStatus`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/team/state.ts:1701
The guard above `return 'direct';` also returns `'direct'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/utils/platform-command.ts:83
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. — src/hud/__tests__/tmux.test.ts:457
A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead. (×8) — src/scripts/check-runtime-syntax.ts:2, src/scripts/notify-hook/auto-nudge.ts:1, src/scripts/notify-hook/orchestration-intent.ts:1, …
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 6 of 7 project(s) that lack one — worth up to 1.7 pts.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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.
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's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability5.5 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/omx-api`, `crates/omx-explore`, `crates/omx-runtime`, `crates/omx-sparkshell`.
`src/team/runtime.ts` reports through `console.*` at line 3422 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/team/runtime.ts:3422
`src/team/runtime.ts` reports through `console.*` at line 3424 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/team/runtime.ts:3424
`src/team/runtime.ts` reports through `console.*` at line 3426 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/team/runtime.ts:3426
`src/team/runtime.ts` reports through `console.*` at line 4181 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/team/runtime.ts:4181
`src/team/runtime.ts` reports through `console.*` at line 5322 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/team/runtime.ts:5322
`src/team/runtime.ts` reports through `console.*` at line 5646 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/team/runtime.ts:5646
`src/team/runtime.ts` reports through `console.*` at line 5683 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/team/runtime.ts:5683
`src/team/scaling.ts` reports through `console.*` at line 1095 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/team/scaling.ts:1095
`src/team/scaling.ts` reports through `console.*` at line 1304 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/team/scaling.ts:1304
`src/team/worktree.ts` reports through `console.*` at line 751 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/team/worktree.ts:751
`src/openclaw/config.ts` reports through `console.*` at line 115 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/openclaw/config.ts:115
`src/openclaw/config.ts` reports through `console.*` at line 475 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/openclaw/config.ts:475
`src/notifications/config.ts` reports through `console.*` at line 328 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/notifications/config.ts:328
`src/notifications/config.ts` reports through `console.*` at line 822 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/notifications/config.ts:822
`src/notifications/reply-listener.ts` reports through `console.*` at line 983 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/notifications/reply-listener.ts:983
`src/notifications/session-registry.ts` reports through `console.*` at line 258 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/notifications/session-registry.ts:258
`src/imagegen/continuation.ts` reports through `console.*` at line 233 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/imagegen/continuation.ts:233
`src/imagegen/continuation.ts` reports through `console.*` at line 249 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/imagegen/continuation.ts:249
`src/imagegen/continuation.ts` reports through `console.*` at line 259 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/imagegen/continuation.ts:259
`src/hooks/keyword-detector.ts` reports through `console.*` at line 4008 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/hooks/keyword-detector.ts:4008
`src/hooks/keyword-detector.ts` reports through `console.*` at line 4302 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/hooks/keyword-detector.ts:4302
`src/hooks/keyword-detector.ts` reports through `console.*` at line 4362 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/hooks/keyword-detector.ts:4362
`src/hooks/extensibility/dispatcher.ts` reports through `console.*` at line 54 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/hooks/extensibility/dispatcher.ts:54
`src/hooks/extensibility/logging.ts` reports through `console.*` at line 19 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/hooks/extensibility/logging.ts:19
`src/exec/followup.ts` reports through `console.*` at line 418 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/exec/followup.ts:418
`src/exec/followup.ts` reports through `console.*` at line 424 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/exec/followup.ts:424
`src/config/deep-interview.ts` reports through `console.*` at line 106 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/config/deep-interview.ts:106
`src/config/generator.ts` reports through `console.*` at line 4494 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/config/generator.ts:4494
`src/agents/native-config.ts` reports through `console.*` at line 496 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/agents/native-config.ts:496
`src/agents/native-config.ts` reports through `console.*` at line 501 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/agents/native-config.ts:501
`src/agents/native-config.ts` reports through `console.*` at line 507 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/agents/native-config.ts:507
`src/agents/native-config.ts` reports through `console.*` at line 517 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/agents/native-config.ts:517
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.
What to do
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.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`existsSync` in `loadOmxCore` 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. — packages/vscode-extension/src/core.ts:54
`existsSync` in `sqliteHasTable` 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/adapt/hermes.ts:204
`existsSync` in `collectHermesEvidence` 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. (×4) — src/adapt/hermes.ts:274, src/adapt/hermes.ts:290, src/adapt/hermes.ts:294, …
`writeFileSync` in `initAdaptFoundationForTarget` 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) — src/adapt/index.ts:463, src/adapt/index.ts:485
`existsSync` in `installNativeAgentConfigs` 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) — src/agents/native-config.ts:500, src/agents/native-config.ts:506
`existsSync` in `readAuthConfig` 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/auth/config.ts:58
`existsSync` in `collectRollouts` 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/auth/sessions.ts:14
`existsSync` in `readAuthMetadata` 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/auth/storage.ts:65
`existsSync` in `callback to slots.filter` 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/auth/storage.ts:150
`existsSync` in `loadAutoresearchMissionContract` 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. (×3) — src/autoresearch/contracts.ts:214, src/autoresearch/contracts.ts:223, src/autoresearch/contracts.ts:226
`existsSync` in `createAutoresearchGoal` 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/autoresearch/goal.ts:143
`existsSync` in `readAutoresearchGoalCompletion` 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/autoresearch/goal.ts:190
`existsSync` in `writeGitInfoExclude` 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:191
`existsSync` in `ensureAutoresearchWorktreeDependencies` 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:210
`existsSync` in `readActiveRunState` 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:280
`existsSync` in `initializeAutoresearchResultsFile` 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:332
`existsSync` in `appendAutoresearchResultsRow` 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:348
`existsSync` in `appendAutoresearchLedgerEntry` 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:400
`existsSync` in `readAutoresearchLedgerEntries` 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:421
`spawnSync` in `runAutoresearchEvaluator` 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:465
`execFileSync` in `materializeAutoresearchMissionToWorktree` 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:723, REDACTED:726
`existsSync` in `loadAutoresearchRunManifest` 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:745
`existsSync` in `resumeAutoresearchRuntime` 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:962
`existsSync` in `readCandidateArtifact` 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:1050
`existsSync` in `assessAutoresearchCompletionState` 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/autoresearch/skill-validation.ts:165
`existsSync` in `collectExternalMcpServers` 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/capabilities/lockfile.ts:287
`existsSync` in `compareDirectoryMirror` 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/catalog/skill-mirror.ts:40
`existsSync` in `compareSkillMirror` 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/catalog/skill-mirror.ts:82
`existsSync` in `ensureBackup` 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/cli/agents-init.ts:198
`existsSync` in `syncManagedAgentsFile` 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/cli/agents-init.ts:231
`existsSync` in `agentsInit` 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) — src/cli/agents-init.ts:328, src/cli/agents-init.ts:346
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 Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
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.
117 duplicated blocks under src/ have copies in at least two of the sibling directories adapt, agents, auth, autopilot, autoresearch, catalog (+28 more sibling(s) not listed) — 73 of them are reported below, and 44 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 117 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 117 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 117 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/autoresearch/goal.ts:109
5 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, plugins, src — 2 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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. — plugins/oh-my-codex/hooks/codex-native-hook.mjs:41
src/team/state.ts:84 · src/team/state/types.ts:6 — the two spans are one implementation copied and then locally edited — 1176 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/team/state.ts:84
src/cli/api.ts:34 · REDACTED:34 — the two spans are one implementation copied and then locally edited — 1134 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/cli/api.ts:34
src/cli/autoresearch-goal.ts:39 · src/cli/performance-goal.ts:43 — the two spans are one implementation copied and then locally edited — 905 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/cli/autoresearch-goal.ts:39
src/state/pinned-atomic-file-darwin-helper.ts:28 · src/state/pinned-atomic-file-darwin-janitor.ts:29 — the two spans are one implementation copied and then locally edited — 1048 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/state/pinned-atomic-file-darwin-helper.ts:28
src/autoresearch/goal.ts:109 · src/performance-goal/artifacts.ts:109 — the two spans are one implementation copied and then locally edited — 863 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/autoresearch/goal.ts:109
src/scripts/notify-hook/team-worker.ts:352 · src/scripts/notify-hook/team-worker.ts:544 — the two spans are one implementation copied and then locally edited — 567 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/scripts/notify-hook/team-worker.ts:352
src/team/state/locks.ts:69 · src/team/state/locks.ts:119 — both copies are in the same file, so extract the 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/team/state/locks.ts:69
plugins/oh-my-codex/hooks/codex-native-hook.mjs:41 · src/scripts/hook-payload-guard.ts:27 — the two spans are one implementation copied and then locally edited — 417 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. — plugins/oh-my-codex/hooks/codex-native-hook.mjs:41
src/notifications/tmux.ts:86 · src/notifications/tmux.ts:246 — 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/notifications/tmux.ts:86
src/team/state.ts:2764 · src/team/state/monitor.ts:33 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/team/state.ts:2764
src/config/generator.ts:500 · src/scripts/notify-dispatcher.ts:307 — the two spans are one implementation copied and then locally edited — 268 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/config/generator.ts:500
src/team/state.ts:436 · src/team/state/types.ts:297 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/team/state.ts:436
src/question/events.ts:55 · src/question/state.ts:256 — 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/question/events.ts:55
src/config/generator.ts:458 · src/scripts/notify-dispatcher.ts:269 — 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. — src/config/generator.ts:458
REDACTED:3679 · REDACTED:3804 — 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:3679
src/hooks/agents-overlay.ts:60 · src/team/worker-bootstrap.ts:611 — the two spans are one implementation copied and then locally edited — 218 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/hooks/agents-overlay.ts:60
src/cli/setup.ts:708 · src/cli/uninstall.ts:919 — 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. — src/cli/setup.ts:708
src/scripts/notify-hook/team-leader-nudge.ts:302 · src/scripts/notify-hook/team-worker.ts:119 — 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/scripts/notify-hook/team-leader-nudge.ts:302
REDACTED:496 · REDACTED:561 — the two spans are one implementation copied and then locally edited — 158 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:496
src/scripts/hook-derived-watcher.ts:513 · src/scripts/notify-fallback-watcher.ts:1767 — 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/scripts/hook-derived-watcher.ts:513
src/scripts/build-api.ts:7 · src/scripts/build-sparkshell.ts:7 — 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/scripts/build-api.ts:7
src/scripts/codex-native-hook.ts:5873 · src/scripts/codex-native-hook.ts:7789 — 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/scripts/codex-native-hook.ts:5873
src/scripts/eval/eval-cli-discoverability.ts:8 · src/scripts/eval/eval-security-path-traversal.ts:6 — 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. — src/scripts/eval/eval-cli-discoverability.ts:8
src/catalog/schema.ts:53 · src/catalog/schema.ts:89 — 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/catalog/schema.ts:53
src/cli/index.ts:9814 · src/cli/index.ts:9884 — 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/cli/index.ts:9814
src/cli/plugin-marketplace.ts:359 · src/cli/plugin-marketplace.ts:431 — 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/cli/plugin-marketplace.ts:359
src/cli/session-search.ts:139 · src/cli/session-search.ts:201 — both copies are in the same file, so extract the 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/cli/session-search.ts:139
src/cli/setup.ts:5344 · src/cli/setup.ts:5514 — 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/cli/setup.ts:5344
src/mcp/memory-server.ts:156 · src/mcp/trace-server.ts:229 — 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/mcp/memory-server.ts:156
src/notifications/dispatch-cooldown.ts:31 · src/notifications/idle-cooldown.ts:39 — 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/notifications/dispatch-cooldown.ts:31
src/scripts/codex-native-hook.ts:1323 · src/scripts/codex-native-hook.ts:1388 — 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/scripts/codex-native-hook.ts:1323
src/scripts/smoke-packed-install.ts:5169 · src/scripts/smoke-packed-install.ts:5197 — both copies are in the same file, so extract the 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/scripts/smoke-packed-install.ts:5169
src/team/mcp-comm.ts:326 · src/team/mcp-comm.ts:427 — both copies are in the same file, so extract the 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/team/mcp-comm.ts:326
src/team/state-root.ts:255 · src/team/state-root.ts:388 — both copies are in the same file, so extract the 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/team/state-root.ts:255
src/autopilot/completion-gate.ts:20 · src/autopilot/completion-gate.ts:51 — 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/autopilot/completion-gate.ts:20
src/cli/index.ts:5668 · src/cli/index.ts:5864 — both copies are in the same file, so extract the 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/cli/index.ts:5668
src/cli/index.ts:5707 · src/cli/index.ts:5897 — both copies are in the same file, so extract the 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/cli/index.ts:5707
src/cli/plugin-marketplace.ts:328 · src/cli/plugin-marketplace.ts:399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/cli/plugin-marketplace.ts:328
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 · 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.
dispatchCodexNativeHook has cyclomatic complexity 326 and cognitive complexity 520; 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/scripts/codex-native-hook.ts:21948
executeTeamApiOperation has cyclomatic complexity 284 and cognitive complexity 321; 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/team/api-interop.ts:612
collectConductorDownloaderOutputTargets has cyclomatic complexity 263 and cognitive complexity 492; 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/scripts/codex-native-hook.ts:14853
setup has cyclomatic complexity 239 and cognitive complexity 415; 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/cli/setup.ts:4449
main has cyclomatic complexity 205 and cognitive complexity 324; 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/scripts/notify-hook.ts:612
scanConductorShellSegment has cyclomatic complexity 190 and cognitive complexity 310; 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/scripts/codex-native-hook.ts:18826
inspectConductorRuntimeExecutions has cyclomatic complexity 176 and cognitive complexity 343; 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/scripts/codex-native-hook.ts:13056
shutdownTeam has cyclomatic complexity 167 and cognitive complexity 290; 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/team/runtime.ts:5068
maybeNudgeTeamLeader has cyclomatic complexity 164 and cognitive complexity 279; 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/scripts/notify-hook/team-leader-nudge.ts:652
smokeInstalledNativeHookDist has cyclomatic complexity 160 and cognitive complexity 217; 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/scripts/smoke-packed-install.ts:2449
startTeam has cyclomatic complexity 155 and cognitive complexity 308; 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/team/runtime.ts:3562
recordSkillActivation has cyclomatic complexity 149 and cognitive complexity 214; 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/hooks/keyword-detector.ts:3883
applyShellPosixStateEffect has cyclomatic complexity 133 and cognitive complexity 240; 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/scripts/codex-native-hook.ts:18083
(anonymous) has cyclomatic complexity 122 and cognitive complexity 225; 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/team/scaling.ts:602
createTeamSession has cyclomatic complexity 116 and cognitive complexity 220; 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/team/tmux-session.ts:2403
extractNodeFsSemanticMutations has cyclomatic complexity 101 and cognitive complexity 174; 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/scripts/codex-native-hook.ts:13472
renderTick has cyclomatic complexity 99 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/hud/index.ts:322
collectConductorMutationCommandTargets has cyclomatic complexity 94 and cognitive complexity 154; 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/scripts/codex-native-hook.ts:15724
materializePackagedOmxPluginCacheImpl has cyclomatic complexity 93 and cognitive complexity 184; 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/cli/plugin-marketplace.ts:3876
buildSessionTimeline has cyclomatic complexity 91 and cognitive complexity 224; 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/session-history/timeline.ts:191
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files1.1 / 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.
src/cli/index.ts has 10352 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/cli/index.ts:1
src/team/runtime.ts has 7007 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/team/runtime.ts:1
src/cli/setup.ts has 6498 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/cli/setup.ts:1
src/scripts/smoke-packed-install.ts has 5536 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/scripts/smoke-packed-install.ts:1
src/cli/plugin-marketplace.ts has 4472 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/cli/plugin-marketplace.ts:1
src/team/tmux-session.ts has 4400 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/team/tmux-session.ts:1
REDACTED has 4140 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/config/generator.ts has 4086 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/config/generator.ts:1
src/hooks/keyword-detector.ts has 4066 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/hooks/keyword-detector.ts:1
src/hooks/session.ts has 3800 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/hooks/session.ts:1
src/config/codex-hooks.ts has 2881 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/config/codex-hooks.ts:1
src/team/state.ts has 2880 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/team/state.ts:1
src/team/scaling.ts has 2195 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/team/scaling.ts:1
src/ultragoal/artifacts.ts has 2133 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/ultragoal/artifacts.ts:1
src/hud/tmux.ts has 2117 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/hud/tmux.ts:1
src/cli/uninstall.ts has 1949 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/cli/uninstall.ts:1
src/scripts/notify-fallback-watcher.ts has 1925 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/scripts/notify-fallback-watcher.ts:1
plugins/oh-my-codex/hooks/codex-native-hook.mjs has 1799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — plugins/oh-my-codex/hooks/codex-native-hook.mjs:1
src/subagents/tracker.ts has 1785 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/subagents/tracker.ts:1
REDACTED has 1679 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/scripts/codex-native-pre-post.ts has 1349 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/scripts/codex-native-pre-post.ts:1
src/scripts/notify-hook/team-dispatch.ts has 1272 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/scripts/notify-hook/team-dispatch.ts:1
src/scripts/notify-hook/team-leader-nudge.ts has 1240 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/scripts/notify-hook/team-leader-nudge.ts:1
src/mcp/state-paths.ts has 1231 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/mcp/state-paths.ts:1
REDACTED has 1223 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/team/api-interop.ts has 1188 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/team/api-interop.ts:1
src/scripts/notify-hook.ts has 1142 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/scripts/notify-hook.ts:1
src/state/operations.ts has 1068 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/state/operations.ts:1
src/team/worker-bootstrap.ts has 1030 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/team/worker-bootstrap.ts:1
src/state/skill-active.ts has 1025 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/state/skill-active.ts:1
src/question/renderer.ts has 974 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/question/renderer.ts:1
src/notifications/reply-listener.ts has 973 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/notifications/reply-listener.ts:1
src/ralplan/advisory.ts has 970 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/ralplan/advisory.ts:1
REDACTED has 937 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 916 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/team/pane-status.ts has 840 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/team/pane-status.ts:1
src/ralplan/runtime.ts has 798 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/ralplan/runtime.ts:1
src/scripts/notify-hook/auto-nudge.ts has 776 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/scripts/notify-hook/auto-nudge.ts:1
src/notifications/config.ts has 753 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/notifications/config.ts:1
src/cli/native-assets.ts has 733 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/cli/native-assets.ts: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 Coverage9.4 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×24) — src/scripts/notify-dispatcher.ts:1, src/team/state/types.ts:1, packages/vscode-extension/src/chatView.ts: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.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code7.9 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 292 application, 27 tooling and 493 test entry point(s) detected in this repo. Gate removals on `bun run build` — an undetected custom entry would make these reachable.
no import path from any entry point (292 application, 27 tooling, 493 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 (×15) — src/state/pinned-atomic-file-darwin-helper.ts, src/state/pinned-atomic-file-darwin-janitor.ts, src/scripts/eval/collect-astra-defaults.ts, …
no import path from any entry point (292 application, 27 tooling, 493 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/team/state/index.ts) — 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 (×5) — src/team/state/config.ts, src/team/state/workers.ts, src/team/state/io.ts, …
Nothing imports this binding — it is safe to review for removal. (×13) — packages/vscode-extension/src/core.ts:75, src/adapt/herdr/sanitize.ts:11, src/config/codex-feature-flags.ts:14, …
Nothing ultimately consumes this binding: its only referrer is the re-export in src/adapt/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/adapt/index.ts in the same commit, or the barrel will import a name that no longer exists. — src/adapt/herdr/bridge.ts:287
Nothing ultimately consumes this binding: its only referrer is the re-export in src/hooks/extensibility/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/hooks/extensibility/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — src/hooks/extensibility/types.ts:204, src/hooks/extensibility/types.ts:219
Nothing ultimately consumes this binding: its only referrer is the re-export in src/notifications/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/notifications/index.ts in the same commit, or the barrel will import a name that no longer exists. (×3) — src/notifications/reply-listener.ts:951, src/notifications/reply-listener.ts:1034, src/notifications/reply-listener.ts:1087
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.
Do you agree with this assessment?
R9 · Circular Imports2.8 / 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.
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 document3.0 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`createLifecycleBroadcastFingerprint` is exported, takes a document from its caller (line 181) and hands it to `stableSerialize`, which calls itself at line 95 (`stableSerialize`) with a piece of `value` (and at line 101) — and nowhere in `stableSerialize` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stableSerialize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/notifications/lifecycle-dedupe.ts:95
`parseCodexGoalSnapshot` is exported and takes `value: unknown` from its caller, and it calls itself at line 161 (`parseCodexGoalSnapshot`) with a piece of `value` — and nowhere in `parseCodexGoalSnapshot` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `parseCodexGoalSnapshot` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/goal-workflows/codex-goal-snapshot.ts:161
`canonicalStringify` is exported, takes a document from its caller (line 133) and hands it to `sortJson`, which calls itself at line 142 (`sortJson`) with a piece of `value` (and at line 147) — and nowhere in `sortJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sortJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/capabilities/lockfile.ts:142
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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 3/4 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`downloadFile` holds an AbortSignal but calls `pipeline(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `pipeline(…, { signal })`. — src/cli/native-assets.ts:281
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. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`.
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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, 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.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
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. (×15) — src/wiki/lifecycle.ts:34, src/wiki/lifecycle.ts:143, src/wiki/lifecycle.ts:269, …
`.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. (×25) — src/team/approved-execution.ts:276, src/team/delivery-log.ts:70, src/team/delivery-log.ts:71, …
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 strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~2.1 `!` null assertions per 1k TypeScript source lines — 452 assertion(s) across the 210290 source line(s) of the 424 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: src/cli/index.ts (44), src/team/runtime.ts (40), src/hud/tmux.ts (33). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 39 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 48 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not 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
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run dev`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> oh-my-codex@0.21.47 dev / > tsc --watch / 06:08:43 PM - Starting compilation in watch mode... / 06:08:48 PM - Found 0 errors. Watching for file changes." No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
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.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; JavaScript, Python, Rust not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, TypeScript 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"]`.
D32 Data Compliance (PII/GDPR) — 17 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the node:test suite in packages/vscode-extension/ ran and not one test passed (> oh-my-codex-vscode@0.5.7 test), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 6 value object(s); 2 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Rust source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `c8 --reporter=lcovonly <your existing test command>` (c8 is already a devDependency here)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
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 REDACTED, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — Not assessed: 432 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation, obsolete TLS versions, passwords stored or checked as plaintext and session cookies set without HttpOnly, Secure or SameSite, and none was found. That half of the dimension is clean, but it is not scored on its own: a C# repository with the same clean reading is scored on its server controls as well, or is N/A for having no web surface, and neither can be decided here. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and 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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Boundary-crossing change coupling: session.ts ↔ state-io.ts src/hooks/session.ts:1— `src/hooks/session.ts` (context hooks) and `src/scripts/notify-hook/state-io.ts` (context scripts) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `2a633a39` fix: keep Ralplan terminal state on the canonical session (#3158); `d7641a56` Make session-scoped runtime state the active authority (#2141); `41c5a132` Keep HUD state anchored to one OMX session scope — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ autoresearch.ts REDACTED:1— `REDACTED` (context autoresearch) and `src/cli/autoresearch.ts` (context cli) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `51579ce8` fix: comprehensive windowsHide for all child process spawns on Window…; `e8513e75` feat: launch autoresearch from interview via split-pane run path (#933); `bd4b7157` fix(autoresearch): finalize noop exhaustion runs — run `git show` on any of them.
Boundary-crossing change coupling: team-tmux-guard.ts ↔ tmux-session.ts src/scripts/notify-hook/team-tmux-guard.ts:1— `src/scripts/notify-hook/team-tmux-guard.ts` (context scripts) and `src/team/tmux-session.ts` (context team) sit in DIFFERENT parts of the tree yet change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `71029cdf` fix(team): recover dispatch state and guard startup input (#3876); `0ec1003a` fix(team): submit worker triggers with tmux named Enter and detect Cl…; `5e62305f` fix(team): preserve exact authority through recovery — run `git show` on any of them.
Boundary-crossing change coupling: ultragoal.ts ↔ codex-native-hook.ts src/cli/ultragoal.ts:1— `src/cli/ultragoal.ts` (context cli) and `src/scripts/codex-native-hook.ts` (context scripts) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `875851f4` feat(ultragoal): ordinary/strict modes with advisory cohort gate (#3500); `77a5a740` fix(state): recover exact stale session binding and revalidate durabl…; `732605db` Make completed Codex goal cleanup explicit (#2894) — run `git show` on any of them.
D10 · Test Quality· No assertions (empty test) · ×1
No assertions (empty test): backs off idle polling and resets to the base cadence after fresh rollout activity src/hooks/__tests__/notify-fallback-watcher.test.ts:4374— Test method has an empty body — it asserts nothing and exercises no code.
FunctionTooLong: setup.setup src/cli/setup.ts:4449— FunctionTooLong — setup runs 933 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 833 over it, 9.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: scaling.scaleUp src/team/scaling.ts:580— FunctionTooLong — scaleUp runs 697 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 597 over it, 6.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: pane-status.readTeamPaneStatus src/team/pane-status.ts:9— FunctionTooLong — readTeamPaneStatus runs 694 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 594 over it, 6.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: runtime.shutdownTeam src/team/runtime.ts:5068— FunctionTooLong — shutdownTeam runs 610 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 510 over it, 6.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: team-leader-nudge.maybeNudgeTeamLeader src/scripts/notify-hook/team-leader-nudge.ts:652— FunctionTooLong — maybeNudgeTeamLeader runs 560 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 460 over it, 5.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: api-interop.executeTeamApiOperation src/team/api-interop.ts:612— FunctionTooLong — executeTeamApiOperation runs 517 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 417 over it, 5.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: notify-hook.main src/scripts/notify-hook.ts:612— FunctionTooLong — main 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: runtime.runRalplanConsensus src/ralplan/runtime.ts:308— FunctionTooLong — runRalplanConsensus runs 386 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 286 over it, 3.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: team.teamCommand REDACTED:1424— FunctionTooLong — teamCommand runs 314 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 214 over it, 3.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: runtime.integrateWorkerCommitsIntoLeader src/team/runtime.ts:1290— FunctionTooLong — integrateWorkerCommitsIntoLeader runs 309 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tmux-injection.handleTmuxInjection src/scripts/notify-hook/tmux-injection.ts:419— FunctionTooLong — handleTmuxInjection runs 297 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 197 over it, 2.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: setup.planNativeHookSetupTransaction src/cli/setup.ts:4113— FunctionTooLong — planNativeHookSetupTransaction runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: runtime.dispatchCriticalInboxInstruction src/team/runtime.ts:6392— FunctionTooLong — dispatchCriticalInboxInstruction runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codex-native-hook.main plugins/oh-my-codex/hooks/codex-native-hook.mjs:1609— FunctionTooLong — main runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× 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: plugin-marketplace.removeChildIfIdentity src/cli/plugin-marketplace.ts:2349— FunctionTooLong — removeChildIfIdentity runs 234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: uninstall.uninstall src/cli/uninstall.ts:1837— FunctionTooLong — uninstall runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: session.recoverDeadSessionPointer src/hooks/session.ts:2043— FunctionTooLong — recoverDeadSessionPointer runs 206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: team-dispatch.injectDispatchRequest src/scripts/notify-hook/team-dispatch.ts:759— FunctionTooLong — injectDispatchRequest 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.
FunctionTooLong: state-paths.readCanonicalSessionBindingSnapshot src/mcp/state-paths.ts:448— FunctionTooLong — readCanonicalSessionBindingSnapshot runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: team-worker-stop.maybeNudgeLeaderForAllowedWorkerStop src/scripts/notify-hook/team-worker-stop.ts:228— FunctionTooLong — maybeNudgeLeaderForAllowedWorkerStop runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: memory-server.handleMemoryToolCall src/mcp/memory-server.ts:171— FunctionTooLong — handleMemoryToolCall 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.
FunctionTooLong: bootstrap.autoStartStdioMcpServer src/mcp/bootstrap.ts:495— FunctionTooLong — autoStartStdioMcpServer runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× 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: doctor.collectTeamDoctorIssues REDACTED:1017— FunctionTooLong — collectTeamDoctorIssues runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: question.questionCommand src/cli/question.ts:244— FunctionTooLong — questionCommand runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: team-worker.maybeNotifyLeaderWorkerIdle src/scripts/notify-hook/team-worker.ts:541— FunctionTooLong — maybeNotifyLeaderWorkerIdle runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: scripts/codex-native-hook.ts src/scripts/codex-native-hook.ts— FileTooLong — 17880 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 17380 over it, 35.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cli/index.ts src/cli/index.ts— FileTooLong — 8296 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7796 over it, 16.59× 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: team/runtime.ts src/team/runtime.ts— FileTooLong — 5749 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5249 over it, 11.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: cli/setup.ts src/cli/setup.ts— FileTooLong — 5055 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4555 over it, 10.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/smoke-packed-install.ts src/scripts/smoke-packed-install.ts— FileTooLong — 4018 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3518 over it, 8.04× 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: cli/plugin-marketplace.ts src/cli/plugin-marketplace.ts— FileTooLong — 3582 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3082 over it, 7.16× 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: team/tmux-session.ts src/team/tmux-session.ts— FileTooLong — 3485 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2985 over it, 6.97× 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: hooks/keyword-detector.ts src/hooks/keyword-detector.ts— FileTooLong — 3391 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2891 over it, 6.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 3243 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2743 over it, 6.49× 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: config/generator.ts src/config/generator.ts— FileTooLong — 3190 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2690 over it, 6.38× 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: hooks/session.ts src/hooks/session.ts— FileTooLong — 3036 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2536 over it, 6.07× 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: team/state.ts src/team/state.ts— FileTooLong — 2369 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1869 over it, 4.74× 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: config/codex-hooks.ts src/config/codex-hooks.ts— FileTooLong — 2305 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1805 over it, 4.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: hud/tmux.ts src/hud/tmux.ts— FileTooLong — 1790 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1290 over it, 3.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: ultragoal/artifacts.ts src/ultragoal/artifacts.ts— FileTooLong — 1779 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1279 over it, 3.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: team/scaling.ts src/team/scaling.ts— FileTooLong — 1763 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1263 over it, 3.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs crates/omx-api/src/lib.rs— FileTooLong — 1695 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 77 free functions. The bar is 500 significant lines; this is 1195 over it, 3.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/notify-fallback-watcher.ts src/scripts/notify-fallback-watcher.ts— FileTooLong — 1624 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1124 over it, 3.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cli/uninstall.ts src/cli/uninstall.ts— FileTooLong — 1557 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1057 over it, 3.11× 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: hooks/codex-native-hook.mjs plugins/oh-my-codex/hooks/codex-native-hook.mjs— FileTooLong — 1499 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 999 over it, 3.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1416 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 916 over it, 2.83× 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: subagents/tracker.ts src/subagents/tracker.ts— FileTooLong — 1394 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 894 over it, 2.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/main.rs crates/omx-explore/src/main.rs— FileTooLong — 1069 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 74 free functions. The bar is 500 significant lines; this is 569 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: scripts/codex-native-pre-post.ts src/scripts/codex-native-pre-post.ts— FileTooLong — 1063 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 563 over it, 2.13× 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 — 1049 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 549 over it, 2.10× 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.
Hotspot: src/cli/index.ts src/cli/index.ts:10503— src/cli/index.ts changed 70 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 212 in index.cancelModes at line 10503. 60 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/cli/index.ts`: 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/cli/setup.ts src/cli/setup.ts:4449— src/cli/setup.ts changed 49 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 231 in setup.setup at line 4449. 41 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/cli/setup.ts`: 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/scripts/codex-native-hook.ts src/scripts/codex-native-hook.ts:21948— src/scripts/codex-native-hook.ts changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 290 in codex-native-hook.dispatchCodexNativeHook at line 21948. 28 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/scripts/codex-native-hook.ts`: 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/cli/plugin-marketplace.ts src/cli/plugin-marketplace.ts:3876— src/cli/plugin-marketplace.ts changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in plugin-marketplace.materializePackagedOmxPluginCacheImpl at line 3876. 38 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/cli/plugin-marketplace.ts`: 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/team/runtime.ts src/team/runtime.ts:5068— src/team/runtime.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 232 in runtime.shutdownTeam at line 5068. 13 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/team/runtime.ts`: 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/hooks/keyword-detector.ts src/hooks/keyword-detector.ts:3883— src/hooks/keyword-detector.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 133 in keyword-detector.recordSkillActivation at line 3883. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/hooks/keyword-detector.ts`: 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: plugins/oh-my-codex/hooks/codex-native-hook.mjs plugins/oh-my-codex/hooks/codex-native-hook.mjs:1609— plugins/oh-my-codex/hooks/codex-native-hook.mjs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in codex-native-hook.main at line 1609. 21 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- plugins/oh-my-codex/hooks/codex-native-hook.mjs`: 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/team/tmux-session.ts src/team/tmux-session.ts:2403— src/team/tmux-session.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 125 in tmux-session.createTeamSession at line 2403. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/team/tmux-session.ts`: 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/scripts/smoke-packed-install.ts src/scripts/smoke-packed-install.ts:2449— src/scripts/smoke-packed-install.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 200 in smoke-packed-install.smokeInstalledNativeHookDist at line 2449. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/scripts/smoke-packed-install.ts`: 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:440— REDACTED changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in doctor.formatStateRootSessionBindingDiagnostic at line 440. 24 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +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/state/operations.ts src/state/operations.ts:743— src/state/operations.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in operations.executeStateOperation at line 743. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/state/operations.ts`: 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/ralplan/advisory.ts src/ralplan/advisory.ts:229— src/ralplan/advisory.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in advisory.readProjectionForGeneration at line 229. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/ralplan/advisory.ts`: 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/hud/index.ts src/hud/index.ts:222— src/hud/index.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in index.runWatchMode at line 222. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/hud/index.ts`: 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/hooks/session.ts src/hooks/session.ts:2043— src/hooks/session.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in session.recoverDeadSessionPointer at line 2043. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/hooks/session.ts`: 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/team/scaling.ts src/team/scaling.ts:580— src/team/scaling.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 169 in scaling.scaleUp at line 580. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/team/scaling.ts`: 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/team/api-interop.ts src/team/api-interop.ts:612— src/team/api-interop.ts changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 275 in api-interop.executeTeamApiOperation at line 612. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/team/api-interop.ts`: 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/ralplan/runtime.ts src/ralplan/runtime.ts:308— src/ralplan/runtime.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in runtime.runRalplanConsensus at line 308. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/ralplan/runtime.ts`: 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/team/state.ts src/team/state.ts:2547— src/team/state.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in state.retireTeamMailboxMessages at line 2547. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/team/state.ts`: 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/cli/ralplan.ts src/cli/ralplan.ts:112— src/cli/ralplan.ts changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in ralplan.ralplanCommand at line 112. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/cli/ralplan.ts`: 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/hud/reconcile.ts src/hud/reconcile.ts:474— src/hud/reconcile.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in reconcile.reconcileHudForPromptSubmit at line 474. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/hud/reconcile.ts`: 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/hud/tmux.ts src/hud/tmux.ts:2124— src/hud/tmux.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in tmux.registerHudResizeHook at line 2124. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/hud/tmux.ts`: 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/modes/base.ts src/modes/base.ts:427— src/modes/base.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in base.updateModeStateUnderCanonicalLock at line 427. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/modes/base.ts`: 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:1424— REDACTED changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in team.teamCommand at line 1424. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +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/scripts/notify-hook.ts src/scripts/notify-hook.ts:612— src/scripts/notify-hook.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 197 in notify-hook.main at line 612. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/scripts/notify-hook.ts`: 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/config/generator.ts src/config/generator.ts:2305— src/config/generator.ts changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in generator.collectManagedHookTrustStateSourceRepresentations at line 2305. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/config/generator.ts`: 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.
Sync-over-async blocking packages/vscode-extension/src/core.ts:54— `existsSync` in `loadOmxCore` 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/adapt/hermes.ts:204— `existsSync` in `sqliteHasTable` 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/adapt/hermes.ts:274— `existsSync` in `collectHermesEvidence` 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/adapt/hermes.ts:290— `existsSync` in `collectHermesEvidence` 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/adapt/hermes.ts:294— `existsSync` in `collectHermesEvidence` 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/adapt/hermes.ts:306— `existsSync` in `collectHermesEvidence` 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/adapt/index.ts:463— `writeFileSync` in `initAdaptFoundationForTarget` 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/adapt/index.ts:485— `writeFileSync` in `initAdaptFoundationForTarget` 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/agents/native-config.ts:500— `existsSync` in `installNativeAgentConfigs` 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/agents/native-config.ts:506— `existsSync` in `installNativeAgentConfigs` 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/auth/config.ts:58— `existsSync` in `readAuthConfig` 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/auth/sessions.ts:14— `existsSync` in `collectRollouts` 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/auth/storage.ts:65— `existsSync` in `readAuthMetadata` 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/auth/storage.ts:150— `existsSync` in `callback to slots.filter` 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/autoresearch/contracts.ts:214— `existsSync` in `loadAutoresearchMissionContract` 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/autoresearch/contracts.ts:223— `existsSync` in `loadAutoresearchMissionContract` 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/autoresearch/contracts.ts:226— `existsSync` in `loadAutoresearchMissionContract` 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/autoresearch/goal.ts:143— `existsSync` in `createAutoresearchGoal` 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/autoresearch/goal.ts:190— `existsSync` in `readAutoresearchGoalCompletion` 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:191— `existsSync` in `writeGitInfoExclude` 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:210— `existsSync` in `ensureAutoresearchWorktreeDependencies` 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:280— `existsSync` in `readActiveRunState` 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:332— `existsSync` in `initializeAutoresearchResultsFile` 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:348— `existsSync` in `appendAutoresearchResultsRow` 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:400— `existsSync` in `appendAutoresearchLedgerEntry` 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.
Swallowed exception (empty catch) src/wiki/lifecycle.ts:34— 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/wiki/lifecycle.ts:143— 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/wiki/lifecycle.ts:269— 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/file-durability.ts:122— 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/git-layout.ts:57— 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/package.ts:27— 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/paths.ts:308— 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/paths.ts:407— 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/team/approved-execution.ts:276— `.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/team/delivery-log.ts:70— `.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/team/delivery-log.ts:71— `.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/team/leader-activity.ts:99— 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/team/mcp-comm.ts:138— `.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/team/notice-ledger.ts:204— 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/team/runtime.ts:293— 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/team/runtime.ts:329— 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/team/runtime.ts:1166— `.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/team/runtime.ts:1233— 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/team/runtime.ts:1940— `.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/team/runtime.ts:2049— 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/team/runtime.ts:2201— `.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/team/runtime.ts:2505— `.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/team/runtime.ts:2517— `.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/team/runtime.ts:2539— `.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/team/runtime.ts:2549— `.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.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×24
No test reaches this file src/scripts/notify-dispatcher.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/team/state/types.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/vscode-extension/src/chatView.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/state/pinned-atomic-file-darwin-helper.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/state/pinned-atomic-file-darwin-janitor.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/run-provider-advisor.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/collect-astra-defaults.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/generate-native-release-manifest.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/vscode-extension/src/sessionManager.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/cli/update-worker.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/hooks/extensibility/plugin-runner.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/vscode-extension/src/core.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/check-runtime-syntax.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/vscode-extension/src/extension.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/check-version-sync.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-cli-discoverability.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-security-path-traversal.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-in-action-cat-shellout-demo.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-parity-sweep.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-parity-smoke.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-help-consistency.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-candidate-handoff.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-fresh-run-tagging.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/scripts/eval/eval-resume-dirty-guard.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Fake-async — async method never awaits src/cli/autoresearch.ts:104— `autoresearchCommand` 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/cli/explore.ts:89— `exploreCommand` 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/cli/list.ts:29— `listCommand` 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/cli/setup.ts:6933— `setupNotifyHook` 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/hud/authority.ts:70— `defaultRunProcess` 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/modes/base.ts:176— `assertModeStartAllowed` 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/scripts/codex-native-hook.ts:2707— `buildNativeOutsideTmuxUltragoalPromptBlockState` 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/scripts/codex-native-hook.ts:10785— `buildRalplanPreToolUseBoundaryOutput` 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/scripts/codex-native-hook.ts:10806— `buildDeepInterviewPreToolUseBoundaryOutput` 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/scripts/codex-native-hook.ts:10868— `buildPlanningRootPointerConflictPreToolUseOutput` 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/scripts/codex-native-hook.ts:11051— `buildUltragoalNoOwnerActivationGuardOutput` 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/scripts/codex-native-hook.ts:20422— `buildConductorPreToolUseWriteGuardOutput` 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/team/runtime.ts:1708— `isReportTrackedInIndex` 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/team/runtime.ts:2654— `probeProcessIdentity` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×11
Guard cannot change the result — returns what the code already falls through to plugins/oh-my-codex/hooks/codex-native-hook.mjs:925— The guard above `return true;` also returns `true`, 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 REDACTED:1299— The guard above `return false;` also returns `false`, 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 src/cli/plugin-marketplace.ts:1369— The guard above `return true;` also returns `true`, 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 src/scripts/notify-hook/orchestration-intent.ts:48— The guard above `return 'still_actionable';` also returns `'still_actionable'`, 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 src/team/state.ts:625— The guard above `return 'auto';` also returns `'auto'`, 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 src/team/state.ts:1671— The guard above `return null;` also returns `null`, 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 src/team/state.ts:1701— The guard above `return unknownStatus;` also returns `unknownStatus`, 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 src/team/state.ts:2761— The guard above `return null;` also returns `null`, 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 src/team/tmux-session.ts:3645— The guard above `return false;` also returns `false`, 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 src/team/tmux-session.ts:3767— The guard above `return false;` also returns `false`, 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 src/utils/platform-command.ts:83— The guard above `return 'direct';` also returns `'direct'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
No assertions: removeTeamWorkerInstructionsFile is safe to call when file does not exist src/team/__tests__/worker-bootstrap.test.ts:1509— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: assertNativeHookAdvisoryPreToolUse accepts the two documented advisory shapes src/scripts/__tests__/smoke-packed-install.test.ts:1768— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: lets a detached excluded writer acquire a fresh reentrant lease after activation releases src/ralplan/__tests__/advisory-activation.test.ts:199— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: does nothing when config is null src/notifications/__tests__/notifier.test.ts:66— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: does nothing when all channels are disabled src/notifications/__tests__/notifier.test.ts:71— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: accepts all notification types src/notifications/__tests__/notifier.test.ts:77— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: resolves for 2xx responses src/notifications/__tests__/notifier.test.ts:219— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: exposes info, warn, error methods src/hooks/extensibility/__tests__/sdk.test.ts:145— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: does not throw when files do not exist src/hooks/extensibility/__tests__/sdk.test.ts:646— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: requires a four-valued reasoning default on every AgentDefinition src/agents/__tests__/definitions.test.ts:32— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Duplicated block (27 lines × 2 locations) src/catalog/schema.ts:53— src/catalog/schema.ts:53 · src/catalog/schema.ts:89 — 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 (27 lines × 2 locations) src/cli/index.ts:9814— src/cli/index.ts:9814 · src/cli/index.ts:9884 — 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 (27 lines × 2 locations) src/cli/plugin-marketplace.ts:359— src/cli/plugin-marketplace.ts:359 · src/cli/plugin-marketplace.ts:431 — 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 (27 lines × 2 locations) src/cli/session-search.ts:139— src/cli/session-search.ts:139 · src/cli/session-search.ts:201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2 locations) src/cli/setup.ts:5344— src/cli/setup.ts:5344 · src/cli/setup.ts:5514 — 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 (27 lines × 2 locations) src/mcp/memory-server.ts:156— src/mcp/memory-server.ts:156 · src/mcp/trace-server.ts:229 — 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 (27 lines × 2 locations) src/notifications/dispatch-cooldown.ts:31— src/notifications/dispatch-cooldown.ts:31 · src/notifications/idle-cooldown.ts:39 — 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.
Repeated repair: src/team/mcp-comm.ts src/team/mcp-comm.ts:240— src/team/mcp-comm.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is mcp-comm.queueDirectMailboxMessage at line 240), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(team): isolate mailbox messages by team (#3810)”; “fix: prevent duplicate Team wakes and retire terminal projections (#3608)”; “fix(team): retain bridge dispatch failure state”; “fix(team): isolate mailbox dispatch receipts”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/team/mcp-comm.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/scripts/sync-plugin-mirror.ts src/scripts/sync-plugin-mirror.ts:192— src/scripts/sync-plugin-mirror.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is sync-plugin-mirror.comparePluginTemplate at line 192), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(#3707): check that templates dir contains exactly AGENTS.md in check mode”; “fix(3707): validate templates directory and AGENTS.md with lstat”; “fix(plugin): address bot review findings on template sync”; “fix(plugin): make plugin skill contract links resolve inside the plugin snapshot”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/scripts/sync-plugin-mirror.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/auth/redact.ts src/auth/redact.ts:63— src/auth/redact.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is redact.createAuthStderrRedactor.accept at line 63), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(auth): stop oversized stderr suppression from eating the next record (#3676)”; “fix(auth): resume stderr redaction after an oversized record”; “fix: keep stderr suppressed after redaction buffer overflow”; “fix: preserve auth secrets, resume identities, and multiline TOML values”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/auth/redact.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/state/handoff-carrier.ts src/state/handoff-carrier.ts:15— src/state/handoff-carrier.ts changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is handoff-carrier.isValidHandoffCarrier at line 15), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: close advisory evidence and Darwin authority gaps”; “fix(keyword): reject a corrupt parent carrier before reconciling child state”; “fix(state): make the handoff-carrier invariant total across writers and representations”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/state/handoff-carrier.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/utils/platform-command.ts src/utils/platform-command.ts:119— src/utils/platform-command.ts changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is platform-command.resolveWindowsCommandPath at line 119), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve auth accounts and resolve config and CLI paths correctly”; “fix(platform): POSIX PATH edge cases in command discovery”; “fix(team): make startup checks side-effect free and errors actionable (#3643)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-09..2026-11-07, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-09 17:16:47 +00:00' --until='2026-11-07 17:16:47 +00:00' --full-history --no-merges -- src/utils/platform-command.ts`: 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.
Duplicated block (26 lines × 2 locations) src/scripts/codex-native-hook.ts:1323— src/scripts/codex-native-hook.ts:1323 · src/scripts/codex-native-hook.ts:1388 — 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 (26 lines × 2 locations) src/scripts/smoke-packed-install.ts:5169— src/scripts/smoke-packed-install.ts:5169 · src/scripts/smoke-packed-install.ts:5197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2 locations) src/team/mcp-comm.ts:326— src/team/mcp-comm.ts:326 · src/team/mcp-comm.ts:427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2 locations) src/team/state-root.ts:255— src/team/state-root.ts:255 · src/team/state-root.ts:388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2 locations) src/autopilot/completion-gate.ts:20— src/autopilot/completion-gate.ts:20 · src/autopilot/completion-gate.ts:51 — 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 (25 lines × 2 locations) src/cli/index.ts:5668— src/cli/index.ts:5668 · src/cli/index.ts:5864 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2 locations) src/cli/index.ts:5707— src/cli/index.ts:5707 · src/cli/index.ts:5897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2 locations) src/cli/plugin-marketplace.ts:328— src/cli/plugin-marketplace.ts:328 · src/cli/plugin-marketplace.ts:399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Dead file (~8 LoC) src/scripts/eval/eval-candidate-handoff.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~8 LoC) src/scripts/eval/eval-fresh-run-tagging.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~8 LoC) src/scripts/eval/eval-resume-dirty-guard.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~8 LoC) src/team/state/workers.ts— no import path from any entry point (292 application, 27 tooling, 493 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/team/state/index.ts) — 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
omx_sparkshell::parse_input (cognitive 89) crates/omx-sparkshell/src/main.rs:186— omx_sparkshell::parse_input has cognitive complexity 89 (threshold 15). Drivers by points: if/else 38 (84 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (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.
omx_sparkshell::redaction::redact_key_value_secrets (cognitive 23) crates/omx-sparkshell/src/redaction.rs:68— omx_sparkshell::redaction::redact_key_value_secrets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 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.
omx_sparkshell::codex_bridge::normalize_summary (cognitive 19) crates/omx-sparkshell/src/codex_bridge.rs:479— omx_sparkshell::codex_bridge::normalize_summary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
omx_explore_harness::validate_direct_command (cognitive 24) crates/omx-explore/src/main.rs:1297— omx_explore_harness::validate_direct_command has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
omx_explore_harness::run_command_with_timeout (cognitive 23) crates/omx-explore/src/main.rs:430— omx_explore_harness::run_command_with_timeout has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
omx_explore_harness::validate_repo_paths (cognitive 21) crates/omx-explore/src/main.rs:1411— omx_explore_harness::validate_repo_paths has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
omx_api::redact_key_value_secret_fragments (cognitive 23) crates/omx-api/src/lib.rs:303— omx_api::redact_key_value_secret_fragments has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 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.
omx_api::extract_backend_text_response (cognitive 22) crates/omx-api/src/lib.rs:1502— omx_api::extract_backend_text_response has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
omx_api::extract_backend_image_response (cognitive 19) crates/omx-api/src/lib.rs:1446— omx_api::extract_backend_image_response has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (6 lines × 2) crates/omx-explore/src/main.rs:477— crates/omx-explore/src/main.rs:477-482 | crates/omx-explore/src/main.rs:492-497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/omx-runtime/src/main.rs:217— crates/omx-runtime/src/main.rs:217-222 | crates/omx-runtime/src/main.rs:254-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/omx-api/src/lib.rs:1095— crates/omx-api/src/lib.rs:1095-1100 | crates/omx-api/src/lib.rs:1200-1205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2 locations) src/scripts/build-api.ts:7— src/scripts/build-api.ts:7 · src/scripts/build-sparkshell.ts:7 — 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 (28 lines × 2 locations) src/scripts/codex-native-hook.ts:5873— src/scripts/codex-native-hook.ts:5873 · src/scripts/codex-native-hook.ts:7789 — 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 (28 lines × 2 locations) src/scripts/eval/eval-cli-discoverability.ts:8— src/scripts/eval/eval-cli-discoverability.ts:8 · src/scripts/eval/eval-security-path-traversal.ts:6 — 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.
Dead file (~5 LoC) src/hooks/extensibility/index.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~5 LoC) src/team/state/io.ts— no import path from any entry point (292 application, 27 tooling, 493 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/team/state/index.ts) — 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 (~5 LoC) src/team/state/shutdown.ts— no import path from any entry point (292 application, 27 tooling, 493 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/team/state/index.ts) — 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
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×3
Recursive walk over a caller-supplied document has no depth cap src/notifications/lifecycle-dedupe.ts:95— `createLifecycleBroadcastFingerprint` is exported, takes a document from its caller (line 181) and hands it to `stableSerialize`, which calls itself at line 95 (`stableSerialize`) with a piece of `value` (and at line 101) — and nowhere in `stableSerialize` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stableSerialize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/goal-workflows/codex-goal-snapshot.ts:161— `parseCodexGoalSnapshot` is exported and takes `value: unknown` from its caller, and it calls itself at line 161 (`parseCodexGoalSnapshot`) with a piece of `value` — and nowhere in `parseCodexGoalSnapshot` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `parseCodexGoalSnapshot` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/capabilities/lockfile.ts:142— `canonicalStringify` is exported, takes a document from its caller (line 133) and hands it to `sortJson`, which calls itself at line 142 (`sortJson`) with a piece of `value` (and at line 147) — and nowhere in `sortJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sortJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
RuntimeEngine::load (cyclomatic 22) crates/omx-runtime-core/src/engine.rs:385— RuntimeEngine::load 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.
RuntimeEngine::process (cyclomatic 17) crates/omx-runtime-core/src/engine.rs:134— RuntimeEngine::process has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
omx_runtime::run (cognitive 34) crates/omx-runtime/src/main.rs:16— omx_runtime::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
omx_runtime::lease_mutex::run_protocol (cognitive 17) crates/omx-runtime/src/lease_mutex.rs:62— omx_runtime::lease_mutex::run_protocol has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 1 (2 pts), loops 1 (nesting depth added 10). 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.
Change coupling: contracts.ts ↔ REDACTED src/team/contracts.ts:1— `src/team/contracts.ts` and `src/team/runtime.ts` change together 60% of the time (6 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 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 6 shared commits counted here, the most recent 3 are `8a823af7` Prevent false team integration success when leader HEAD is unchanged …; `038c5321` feat(team): add incremental worktree merge tracking; `7cc422ea` feat: enforce team worktrees by default (#804) — run `git show` on any of them.
Change coupling: codex_bridge.rs ↔ REDACTED crates/omx-sparkshell/src/codex_bridge.rs:1— `crates/omx-sparkshell/src/codex_bridge.rs` and `REDACTED` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `1cfe395a` Support local real generation compatibility; `1ba0e932` Support local real generation compatibility; `530fb9a7` Keep explore and sparkshell on lean fallback lanes — run `git show` on any of them.
Duplicated block (5 lines × 2) src/scripts/eval/eval-noisy-bayesopt-highdim.py:35— src/scripts/eval/eval-noisy-bayesopt-highdim.py:35-39 | src/scripts/eval/eval-noisy-latent-subspace-discovery.py:35-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/omx-sparkshell/src/codex_bridge.rs:498— crates/omx-sparkshell/src/codex_bridge.rs:498-502 | crates/omx-sparkshell/src/codex_bridge.rs:503-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/omx-runtime/src/main.rs:202— crates/omx-runtime/src/main.rs:202-215 | crates/omx-runtime/src/main.rs:239-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) playground/bayesopt_highdim_demo/optimizer.py:49— playground/bayesopt_highdim_demo/optimizer.py:49-62 | playground/bayesopt_latent_discovery_demo/optimizer.py:38-51 — `playground/bayesopt_highdim_demo/optimizer.py` and `playground/bayesopt_latent_discovery_demo/optimizer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `length_scale` to `float = 0.18` in one and `float = 0.22` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/omx-api/src/lib.rs:817— crates/omx-api/src/lib.rs:817-828 | crates/omx-api/src/lib.rs:830-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) playground/bayesopt_highdim_demo/optimizer.py:142— playground/bayesopt_highdim_demo/optimizer.py:142-153 | playground/bayesopt_latent_discovery_demo/optimizer.py:202-214 — `playground/bayesopt_highdim_demo/optimizer.py` and `playground/bayesopt_latent_discovery_demo/optimizer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Off the main sequence: omx-runtime-core — omx-runtime-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: omx-mux — omx-mux: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
IC1 · Incompleteness & stubs· Both branches are identical · ×2
Both branches are identical — the condition decides nothing src/notifications/formatter.ts:153— 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.
Both branches are identical — the condition decides nothing src/scripts/notify-hook/team-worker-posttooluse.ts:346— 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.
codex-native-hook.dispatchCodexNativeHook (cyclomatic 290) src/scripts/codex-native-hook.ts:21948— codex-native-hook.dispatchCodexNativeHook has cyclomatic complexity 290 (threshold 15). Of this number, 288 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
api-interop.executeTeamApiOperation (cyclomatic 275) src/team/api-interop.ts:612— api-interop.executeTeamApiOperation has cyclomatic complexity 275 (threshold 15). Of this number, 270 points are the body's own statements and 5 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.
codex-native-hook.collectConductorDownloaderOutputTargets (cyclomatic 274) src/scripts/codex-native-hook.ts:14853— codex-native-hook.collectConductorDownloaderOutputTargets has cyclomatic complexity 274 (threshold 15). Of this number, 249 points are the body's own statements and 25 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
runtime.shutdownTeam (cyclomatic 232) src/team/runtime.ts:5068— runtime.shutdownTeam has cyclomatic complexity 232 (threshold 15). Of this number, 159 points are the body's own statements and 73 belong to 18 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.
setup.setup (cyclomatic 231) src/cli/setup.ts:4449— setup.setup has cyclomatic complexity 231 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
notify-hook.main (cyclomatic 197) src/scripts/notify-hook.ts:612— notify-hook.main has cyclomatic complexity 197 (threshold 15). Of this number, 194 points are the body's own statements and 3 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.
codex-native-hook.inspectConductorRuntimeExecutions (cyclomatic 174) src/scripts/codex-native-hook.ts:13056— codex-native-hook.inspectConductorRuntimeExecutions has cyclomatic complexity 174 (threshold 15). Of this number, 165 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.scanConductorShellSegment (cyclomatic 171) src/scripts/codex-native-hook.ts:18826— codex-native-hook.scanConductorShellSegment has cyclomatic complexity 171 (threshold 15). Of this number, 166 points are the body's own statements and 5 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
scaling.scaleUp (cyclomatic 169) src/team/scaling.ts:580— scaling.scaleUp has cyclomatic complexity 169 (threshold 15). Most of this is not in the body itself: 4 of the 169 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 602, 784, 908, …). 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.
smoke-packed-install.smokeInstalledNativeHookDist (cyclomatic 158) src/scripts/smoke-packed-install.ts:2449— smoke-packed-install.smokeInstalledNativeHookDist has cyclomatic complexity 158 (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. This shape REPEATS in the file: one other method here (smoke-packed-install.smokeInstalledNativeHookDist::runPackedTransportRegressions) 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.
team-leader-nudge.maybeNudgeTeamLeader (cyclomatic 154) src/scripts/notify-hook/team-leader-nudge.ts:652— team-leader-nudge.maybeNudgeTeamLeader has cyclomatic complexity 154 (threshold 15). To reduce it, separate the cases: extract each independent 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 (team-leader-nudge.maybeNudgeTeamLeader::persistLeaderNudgeBookkeeping) 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.
keyword-detector.recordSkillActivation (cyclomatic 133) src/hooks/keyword-detector.ts:3883— keyword-detector.recordSkillActivation has cyclomatic complexity 133 (threshold 15). Of this number, 120 points are the body's own statements and 13 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.
codex-native-hook.applyShellPosixStateEffect (cyclomatic 132) src/scripts/codex-native-hook.ts:18083— codex-native-hook.applyShellPosixStateEffect has cyclomatic complexity 132 (threshold 15). Of this number, 123 points are the body's own statements and 9 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
runtime.startTeam (cyclomatic 131) src/team/runtime.ts:3562— runtime.startTeam 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. This shape REPEATS in the file: one other method here (runtime.startTeam::runWorkerStartupAttempt) 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.
tmux-session.createTeamSession (cyclomatic 125) src/team/tmux-session.ts:2403— tmux-session.createTeamSession has cyclomatic complexity 125 (threshold 15). Of this number, 108 points are the body's own statements and 17 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.
timeline.buildSessionTimeline (cyclomatic 106) src/session-history/timeline.ts:191— timeline.buildSessionTimeline has cyclomatic complexity 106 (threshold 15). Of this number, 83 points are the body's own statements and 23 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.
codex-native-hook.extractNodeFsSemanticMutations (cyclomatic 102) src/scripts/codex-native-hook.ts:13472— codex-native-hook.extractNodeFsSemanticMutations has cyclomatic complexity 102 (threshold 15). Of this number, 82 points are the body's own statements and 20 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity· main (cyclomatic 102) · ×1
main (cyclomatic 102) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1609— main has cyclomatic complexity 102 (threshold 15). Of this number, 55 points are the body's own statements and 47 belong to 10 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.
operations.executeStateOperation (cyclomatic 95) src/state/operations.ts:743— operations.executeStateOperation has cyclomatic complexity 95 (threshold 15). Of this number, 18 points are the body's own statements and 77 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.
index.runWatchMode::renderTick (cyclomatic 91) src/hud/index.ts:322— index.runWatchMode::renderTick has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
reconcile.reconcileHudForPromptSubmit (cyclomatic 89) src/hud/reconcile.ts:474— reconcile.reconcileHudForPromptSubmit has cyclomatic complexity 89 (threshold 15). Of this number, 66 points are the body's own statements and 23 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.
plugin-marketplace.materializePackagedOmxPluginCacheImpl (cyclomatic 88) src/cli/plugin-marketplace.ts:3876— plugin-marketplace.materializePackagedOmxPluginCacheImpl has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.collectConductorMutationCommandTargets (cyclomatic 87) src/scripts/codex-native-hook.ts:15724— codex-native-hook.collectConductorMutationCommandTargets has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
keyword-detector.persistStatefulSkillSeedState (cyclomatic 84) src/hooks/keyword-detector.ts:703— keyword-detector.persistStatefulSkillSeedState has cyclomatic complexity 84 (threshold 15). Of this number, 78 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.
advisory.readProjectionForGeneration (cyclomatic 82) src/ralplan/advisory.ts:229— advisory.readProjectionForGeneration 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.
codex-native-hook.commandHasUnsafeDynamicLoaderEnvironment (cyclomatic 82) src/scripts/codex-native-hook.ts:11828— codex-native-hook.commandHasUnsafeDynamicLoaderEnvironment has cyclomatic complexity 82 (threshold 15). Of this number, 76 points are the body's own statements and 6 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
plugin-marketplace.removeChildIfIdentity (cyclomatic 80) src/cli/plugin-marketplace.ts:2349— plugin-marketplace.removeChildIfIdentity has cyclomatic complexity 80 (threshold 15). Of this number, 53 points are the body's own statements and 27 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.
artifacts.checkpointUltragoal (cyclomatic 79) src/ultragoal/artifacts.ts:1796— artifacts.checkpointUltragoal has cyclomatic complexity 79 (threshold 15). Most of this is not in the body itself: 1 of the 79 points is its own statement and the rest belongs to one function literal inside it that branches (line 1797). 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.
tmux-injection.handleTmuxInjection (cyclomatic 77) src/scripts/notify-hook/tmux-injection.ts:419— tmux-injection.handleTmuxInjection has cyclomatic complexity 77 (threshold 15). Of this number, 63 points are the body's own statements and 14 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.
plugin-marketplace.readOmxPluginCacheFileNoFollow (cyclomatic 76) src/cli/plugin-marketplace.ts:682— plugin-marketplace.readOmxPluginCacheFileNoFollow has cyclomatic complexity 76 (threshold 15). Of this number, 75 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.
notify-fallback-delivery.deliverNotifyFallback (cyclomatic 76) src/scripts/notify-fallback-delivery.ts:244— notify-fallback-delivery.deliverNotifyFallback 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.
index.main (cyclomatic 75) src/cli/index.ts:5072— index.main has cyclomatic complexity 75 (threshold 15). Of this number, 74 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
tracker.recordSubagentTurn (cyclomatic 74) src/subagents/tracker.ts:937— tracker.recordSubagentTurn 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.
pane-status.readTeamPaneStatus (cyclomatic 72) src/team/pane-status.ts:9— pane-status.readTeamPaneStatus has cyclomatic complexity 72 (threshold 15). Of this number, 22 points are the body's own statements and 50 belong to 46 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.
scaling.scaleDown (cyclomatic 70) src/team/scaling.ts:1927— scaling.scaleDown has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 1 of the 70 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 1940, 2087, 2187, …). 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.
doctor.collectTeamDoctorIssues (cyclomatic 70) REDACTED:1017— doctor.collectTeamDoctorIssues has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
team.teamCommand (cyclomatic 70) REDACTED:1424— team.teamCommand has cyclomatic complexity 70 (threshold 15). Of this number, 65 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.
ralplan.ralplanCommand (cyclomatic 70) src/cli/ralplan.ts:112— ralplan.ralplanCommand has cyclomatic complexity 70 (threshold 15). Of this number, 65 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.
runtime.monitorTeam (cyclomatic 69) src/team/runtime.ts:4609— runtime.monitorTeam has cyclomatic complexity 69 (threshold 15). Of this number, 66 points are the body's own statements and 3 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.
doctor.formatStateRootSessionBindingDiagnostic (cyclomatic 69) REDACTED:440— doctor.formatStateRootSessionBindingDiagnostic has cyclomatic complexity 69 (threshold 15). Of this number, 64 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.
team-dispatch.injectDispatchRequest (cyclomatic 69) src/scripts/notify-hook/team-dispatch.ts:759— team-dispatch.injectDispatchRequest has cyclomatic complexity 69 (threshold 15). Of this number, 66 points are the body's own statements and 3 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.
session.recoverDeadSessionPointer (cyclomatic 68) src/hooks/session.ts:2043— session.recoverDeadSessionPointer 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.
tracker.normalizeSubagentTrackingState (cyclomatic 67) src/subagents/tracker.ts:287— tracker.normalizeSubagentTrackingState has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.firstInterpreterScriptOperands (cyclomatic 66) src/scripts/codex-native-hook.ts:6378— codex-native-hook.firstInterpreterScriptOperands has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandHasUnsafeConductorShellState (cyclomatic 66) src/scripts/codex-native-hook.ts:11668— codex-native-hook.commandHasUnsafeConductorShellState has cyclomatic complexity 66 (threshold 15). Of this number, 63 points are the body's own statements and 3 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
team.formatInspectItemLine (cyclomatic 65) REDACTED:705— team.formatInspectItemLine has cyclomatic complexity 65 (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.
tracker.parseStrictSubagentTrackingState (cyclomatic 64) src/subagents/tracker.ts:391— tracker.parseStrictSubagentTrackingState has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ultragoal.ultragoalCommand (cyclomatic 64) src/cli/ultragoal.ts:364— ultragoal.ultragoalCommand has cyclomatic complexity 64 (threshold 15). Of this number, 63 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.
plugin-marketplace.registerOmxPluginCacheLivePin (cyclomatic 63) src/cli/plugin-marketplace.ts:1674— plugin-marketplace.registerOmxPluginCacheLivePin has cyclomatic complexity 63 (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.
codex-native-hook.evaluateConductorBashWrite (cyclomatic 63) src/scripts/codex-native-hook.ts:20192— codex-native-hook.evaluateConductorBashWrite has cyclomatic complexity 63 (threshold 15). Of this number, 50 points are the body's own statements and 13 belong to 4 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.runDetachedSessionLeader (cyclomatic 62) src/cli/index.ts:8999— index.runDetachedSessionLeader has cyclomatic complexity 62 (threshold 15). Of this number, 48 points are the body's own statements and 14 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.
team-worker.maybeNotifyLeaderWorkerIdle (cyclomatic 61) src/scripts/notify-hook/team-worker.ts:541— team-worker.maybeNotifyLeaderWorkerIdle has cyclomatic complexity 61 (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.
state.retireTeamMailboxMessages (cyclomatic 60) src/team/state.ts:2547— state.retireTeamMailboxMessages has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 15 of the 60 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 2581, 2593, 2621, …). 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.
code-intel-server.handleCodeIntelToolCall (cyclomatic 60) src/mcp/code-intel-server.ts:459— code-intel-server.handleCodeIntelToolCall has cyclomatic complexity 60 (threshold 15). Of this number, 58 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.
team-tmux-guard.evaluatePaneInjectionReadiness (cyclomatic 59) src/scripts/notify-hook/team-tmux-guard.ts:196— team-tmux-guard.evaluatePaneInjectionReadiness has cyclomatic complexity 59 (threshold 15). Of this number, 51 points are the body's own statements and 8 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.
codex-native-hook.tokenizeShellWords (cyclomatic 59) src/scripts/codex-native-hook.ts:6802— codex-native-hook.tokenizeShellWords has cyclomatic complexity 59 (threshold 15). Of this number, 56 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.unwrapOmxStateTransportCommandOnce (cyclomatic 59) src/scripts/codex-native-hook.ts:7054— codex-native-hook.unwrapOmxStateTransportCommandOnce has cyclomatic complexity 59 (threshold 15). Of this number, 56 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
generator.reconcileProjectTrustPayload (cyclomatic 55) src/config/generator.ts:1199— generator.reconcileProjectTrustPayload has cyclomatic complexity 55 (threshold 15). Of this number, 50 points are the body's own statements and 5 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.
mode-binding-lease-helper.readPinnedOwner (cyclomatic 55) src/state/mode-binding-lease-helper.ts:73— mode-binding-lease-helper.readPinnedOwner has cyclomatic complexity 55 (threshold 15). Of this number, 50 points are the body's own statements and 5 belong to 2 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.
plugin-marketplace.isLivePinnedSnapshot (cyclomatic 54) src/cli/plugin-marketplace.ts:1503— plugin-marketplace.isLivePinnedSnapshot has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.collectConductorStaticReadOnlyDownloadUrls (cyclomatic 54) src/scripts/codex-native-hook.ts:14629— codex-native-hook.collectConductorStaticReadOnlyDownloadUrls has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
tracker.consumeDirectChildReopenContext (cyclomatic 53) src/subagents/tracker.ts:1629— tracker.consumeDirectChildReopenContext has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 3 of the 53 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1637, 1665, 1675, …). 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.
memory-server.handleMemoryToolCall (cyclomatic 52) src/mcp/memory-server.ts:171— memory-server.handleMemoryToolCall has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
uninstall.uninstall (cyclomatic 52) src/cli/uninstall.ts:1837— uninstall.uninstall has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.isAllowedDeepInterviewBashWrite (cyclomatic 52) src/scripts/codex-native-hook.ts:10340— codex-native-hook.isAllowedDeepInterviewBashWrite has cyclomatic complexity 52 (threshold 15). Of this number, 38 points are the body's own statements and 14 belong to 3 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.maskJavaScriptStringsAndComments (cyclomatic 52) src/scripts/codex-native-hook.ts:11278— codex-native-hook.maskJavaScriptStringsAndComments has cyclomatic complexity 52 (threshold 15). Of this number, 50 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.cancelModes (cyclomatic 52) src/cli/index.ts:10503— index.cancelModes has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (index.cancelModes::loadStates) 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.
session.resumeRecoveryCheckpoint (cyclomatic 51) src/hooks/session.ts:1715— session.resumeRecoveryCheckpoint has cyclomatic complexity 51 (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.
auto-nudge.maybeAutoNudge (cyclomatic 51) src/scripts/notify-hook/auto-nudge.ts:637— auto-nudge.maybeAutoNudge has cyclomatic complexity 51 (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.
codex-native-hook.isPositivelyReadOnlyNodeInlineEval (cyclomatic 51) src/scripts/codex-native-hook.ts:13726— codex-native-hook.isPositivelyReadOnlyNodeInlineEval 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
update.executeUpdate (cyclomatic 50) REDACTED:776— update.executeUpdate has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.writePendingSessionRegistration (cyclomatic 49) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1014— codex-native-hook.writePendingSessionRegistration has cyclomatic complexity 49 (threshold 15). Of this number, 44 points are the body's own statements and 5 belong to 2 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.
codex-native-hook.buildStopHookOutput (cyclomatic 49) src/scripts/codex-native-hook.ts:21527— codex-native-hook.buildStopHookOutput 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.joinConductorShellStates (cyclomatic 47) src/scripts/codex-native-hook.ts:16863— codex-native-hook.joinConductorShellStates 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
team-dispatch.drainPendingTeamDispatch (cyclomatic 47) src/scripts/notify-hook/team-dispatch.ts:1153— team-dispatch.drainPendingTeamDispatch has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 9 of the 47 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1191, 1204). 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.
mode-binding-lease-helper.runPinnedClaimMode (cyclomatic 47) src/state/mode-binding-lease-helper.ts:249— mode-binding-lease-helper.runPinnedClaimMode has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
team-worker-stop.maybeNudgeLeaderForAllowedWorkerStop (cyclomatic 46) src/scripts/notify-hook/team-worker-stop.ts:228— team-worker-stop.maybeNudgeLeaderForAllowedWorkerStop has cyclomatic complexity 46 (threshold 15). Of this number, 45 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.
codex-native-hook.buildAdditionalContextMessage (cyclomatic 46) src/scripts/codex-native-hook.ts:2770— codex-native-hook.buildAdditionalContextMessage has cyclomatic complexity 46 (threshold 15). Of this number, 41 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.runCodex (cyclomatic 46) src/cli/index.ts:8119— index.runCodex 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. This shape REPEATS in the file: one other method here (index.runCodex::launchDetachedSession::bootstrapLeader) 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.
setup.installSkills (cyclomatic 45) src/cli/setup.ts:6363— setup.installSkills has cyclomatic complexity 45 (threshold 15). Of this number, 44 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
runtime.integrateWorkerCommitsIntoLeader (cyclomatic 44) src/team/runtime.ts:1290— runtime.integrateWorkerCommitsIntoLeader has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.teamWorkerMutationTargetsProtectedWorkflowState (cyclomatic 44) src/scripts/codex-native-hook.ts:10697— codex-native-hook.teamWorkerMutationTargetsProtectedWorkflowState has cyclomatic complexity 44 (threshold 15). Of this number, 42 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
state-root.resolveVerifiedDetachedTeamContext (cyclomatic 43) src/team/state-root.ts:90— state-root.resolveVerifiedDetachedTeamContext has cyclomatic complexity 43 (threshold 15). Of this number, 41 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.
mailbox.sendDirectMessage (cyclomatic 43) src/team/state/mailbox.ts:208— mailbox.sendDirectMessage has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 3 of the 43 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 218, 260, 247, …). 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.
tmux.parseTmuxPaneSnapshot (cyclomatic 43) src/hud/tmux.ts:186— tmux.parseTmuxPaneSnapshot 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.
plugin-marketplace.retireUnpinnedManagedSnapshots (cyclomatic 43) src/cli/plugin-marketplace.ts:3665— plugin-marketplace.retireUnpinnedManagedSnapshots 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mission.parseMissionArgs (cyclomatic 43) src/cli/mission.ts:138— mission.parseMissionArgs 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.
model-contract.parseTeamWorkerLaunchArgs (cyclomatic 42) REDACTED:373— model-contract.parseTeamWorkerLaunchArgs 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.
triage-heuristic.triagePrompt (cyclomatic 42) src/hooks/triage-heuristic.ts:236— triage-heuristic.triagePrompt has cyclomatic complexity 42 (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.
friction.inspectRolloutFile (cyclomatic 42) src/session-history/friction.ts:281— friction.inspectRolloutFile has cyclomatic complexity 42 (threshold 15). Of this number, 41 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.
codex-native-hook.buildSessionStartContext (cyclomatic 42) src/scripts/codex-native-hook.ts:2353— codex-native-hook.buildSessionStartContext 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.rsyncInvocationHasUnsafeRuntimeEnvironment (cyclomatic 42) src/scripts/codex-native-hook.ts:19799— codex-native-hook.rsyncInvocationHasUnsafeRuntimeEnvironment 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorStateWriteTransportIsBoundToActiveSession (cyclomatic 42) src/scripts/codex-native-hook.ts:20109— codex-native-hook.conductorStateWriteTransportIsBoundToActiveSession has cyclomatic complexity 42 (threshold 15). Of this number, 38 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
omx_sparkshell::parse_input (cyclomatic 42) crates/omx-sparkshell/src/main.rs:186— omx_sparkshell::parse_input 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.
policy.validateNativeReleaseManifest (cyclomatic 41) src/native-assets/policy.ts:131— policy.validateNativeReleaseManifest has cyclomatic complexity 41 (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.
runtime.runRalplanConsensus (cyclomatic 41) src/ralplan/runtime.ts:308— runtime.runRalplanConsensus has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
team-tmux-guard.sendPaneInput (cyclomatic 41) src/scripts/notify-hook/team-tmux-guard.ts:388— team-tmux-guard.sendPaneInput has cyclomatic complexity 41 (threshold 15). Of this number, 36 points are the body's own statements and 5 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.
codex-native-pre-post.tokenizeShellCommandWithBoundaries (cyclomatic 41) src/scripts/codex-native-pre-post.ts:325— codex-native-pre-post.tokenizeShellCommandWithBoundaries has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-native-hook.applyConductorTrackedVariableWriter (cyclomatic 41) src/scripts/codex-native-hook.ts:17372— codex-native-hook.applyConductorTrackedVariableWriter has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.scanConductorShellSource (cyclomatic 41) src/scripts/codex-native-hook.ts:19624— codex-native-hook.scanConductorShellSource has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.notifyLifecycle (cyclomatic 41) src/notifications/index.ts:206— index.notifyLifecycle has cyclomatic complexity 41 (threshold 15). Of this number, 38 points are the body's own statements and 3 belong 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.
advisory.readCurrentRalplanAdvisory (cyclomatic 40) src/ralplan/advisory.ts:334— advisory.readCurrentRalplanAdvisory 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.
plugin-marketplace.sweepExpiredOmxPluginCacheLivePinIntents (cyclomatic 40) src/cli/plugin-marketplace.ts:1375— plugin-marketplace.sweepExpiredOmxPluginCacheLivePinIntents has cyclomatic complexity 40 (threshold 15). Of this number, 38 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.
setup.planNativeHookSetupTransaction (cyclomatic 40) src/cli/setup.ts:4113— setup.planNativeHookSetupTransaction 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.
codex-native-hook.parseShellHeredocDelimiter (cyclomatic 40) src/scripts/codex-native-hook.ts:8649— codex-native-hook.parseShellHeredocDelimiter 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.cleanupPostLaunchModeStateFiles (cyclomatic 40) src/cli/index.ts:7776— index.cleanupPostLaunchModeStateFiles has cyclomatic complexity 40 (threshold 15). Of this number, 38 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smoke-packed-install.smokePackedHookTrustLifecycle (cyclomatic 40) src/scripts/smoke-packed-install.ts:5026— smoke-packed-install.smokePackedHookTrustLifecycle has cyclomatic complexity 40 (threshold 15). Of this number, 39 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.
tasks.transitionTaskStatus (cyclomatic 39) src/team/state/tasks.ts:195— tasks.transitionTaskStatus has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 6 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 205). 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.
session-timeline.parseSessionTimelineArgs (cyclomatic 39) src/cli/session-timeline.ts:34— session-timeline.parseSessionTimelineArgs 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.
codex-native-hook.terminalizeExactWorkflowSessionForHookCancel (cyclomatic 39) src/scripts/codex-native-hook.ts:4070— codex-native-hook.terminalizeExactWorkflowSessionForHookCancel has cyclomatic complexity 39 (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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
notify-hook.isOmxManagedCwd (cyclomatic 39) src/scripts/notify-hook.ts:160— notify-hook.isOmxManagedCwd has cyclomatic complexity 39 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smoke-packed-install.assertInstalledPluginSurface (cyclomatic 39) src/scripts/smoke-packed-install.ts:1665— smoke-packed-install.assertInstalledPluginSurface has cyclomatic complexity 39 (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.
codex-hooks.validateCodexHooksDocument (cyclomatic 38) src/config/codex-hooks.ts:1114— codex-hooks.validateCodexHooksDocument 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.
advisory.observeRalplanAdvisoryPrompt (cyclomatic 38) src/ralplan/advisory.ts:856— advisory.observeRalplanAdvisoryPrompt has cyclomatic complexity 38 (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.
doctor.checkNativePostCompactHookRuntime (cyclomatic 38) REDACTED:3296— doctor.checkNativePostCompactHookRuntime has cyclomatic complexity 38 (threshold 15). Of this number, 20 points are the body's own statements and 18 belong 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.
codex-native-hook.recoverStaleDeadStopTranscriptSession (cyclomatic 38) src/scripts/codex-native-hook.ts:4493— codex-native-hook.recoverStaleDeadStopTranscriptSession 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorStaticGhApiInvocation (cyclomatic 38) src/scripts/codex-native-hook.ts:12300— codex-native-hook.parseConductorStaticGhApiInvocation has cyclomatic complexity 38 (threshold 15). Of this number, 28 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasExactConductorOrchestrationOptionSchema (cyclomatic 38) src/scripts/codex-native-hook.ts:16495— codex-native-hook.hasExactConductorOrchestrationOptionSchema 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
tmux-injection.resolvePaneTarget (cyclomatic 38) src/scripts/notify-hook/tmux-injection.ts:304— tmux-injection.resolvePaneTarget 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.
smoke-packed-install.smokeInstalledNativeHookDist::runPackedTransportRegressions (cyclomatic 38) src/scripts/smoke-packed-install.ts:2450— smoke-packed-install.smokeInstalledNativeHookDist::runPackedTransportRegressions has cyclomatic complexity 38 (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 (smoke-packed-install.smokeInstalledNativeHookDist) 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.
pinned-atomic-file-darwin-janitor.main (cyclomatic 38) src/state/pinned-atomic-file-darwin-janitor.ts:186— pinned-atomic-file-darwin-janitor.main 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.
advisory-evidence.projectAdvisoryReviewLifecycle (cyclomatic 37) src/ralplan/advisory-evidence.ts:381— advisory-evidence.projectAdvisoryReviewLifecycle 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.
scaling.reconcileScaleDownCleanupDebt (cyclomatic 37) src/team/scaling.ts:1757— scaling.reconcileScaleDownCleanupDebt has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1764, 1877). 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.
dispatcher.dispatchHookEvent (cyclomatic 37) src/hooks/extensibility/dispatcher.ts:347— dispatcher.dispatchHookEvent has cyclomatic complexity 37 (threshold 15). Of this number, 36 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.
native-hook-claim-journal.recoverNativeHookClaimJournal (cyclomatic 37) src/cli/native-hook-claim-journal.ts:247— native-hook-claim-journal.recoverNativeHookClaimJournal 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.
team-worker.maybeNotifyLeaderAllWorkersIdle (cyclomatic 37) src/scripts/notify-hook/team-worker.ts:351— team-worker.maybeNotifyLeaderAllWorkersIdle has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 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.
codex-native-hook.resolveStateWriteInputFileCwd (cyclomatic 37) src/scripts/codex-native-hook.ts:5917— codex-native-hook.resolveStateWriteInputFileCwd 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.sourcesFileWrittenEarlierInSameCommand::scanCommand (cyclomatic 37) src/scripts/codex-native-hook.ts:6537— codex-native-hook.sourcesFileWrittenEarlierInSameCommand::scanCommand 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorFiniteDestinationLeaves (cyclomatic 37) src/scripts/codex-native-hook.ts:15598— codex-native-hook.collectConductorFiniteDestinationLeaves has cyclomatic complexity 37 (threshold 15). Of this number, 19 points are the body's own statements and 18 belong to 3 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasSafeConductorOrchestrationRuntimeEnvironment (cyclomatic 37) src/scripts/codex-native-hook.ts:16285— codex-native-hook.hasSafeConductorOrchestrationRuntimeEnvironment 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.cancelModes::loadStates (cyclomatic 37) src/cli/index.ts:10526— index.cancelModes::loadStates 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. This shape REPEATS in the file: one other method here (index.cancelModes) 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.
team-dispatch.finalizeClaimedDispatchRequest (cyclomatic 37) src/scripts/notify-hook/team-dispatch.ts:502— team-dispatch.finalizeClaimedDispatchRequest has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to one function literal inside it that branches (line 519). 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.
state-paths.readCanonicalSessionBindingSnapshot (cyclomatic 36) src/mcp/state-paths.ts:448— state-paths.readCanonicalSessionBindingSnapshot 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.
generator.analyzeOmxSeededBehavioralDefaults (cyclomatic 36) src/config/generator.ts:645— generator.analyzeOmxSeededBehavioralDefaults has cyclomatic complexity 36 (threshold 15). Of this number, 17 points are the body's own statements and 19 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.
plugin-marketplace.getPinnedLauncherIncompatibilityReason (cyclomatic 36) src/cli/plugin-marketplace.ts:3576— plugin-marketplace.getPinnedLauncherIncompatibilityReason has cyclomatic complexity 36 (threshold 15). Of this number, 35 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.
worker-provenance.resolveAuthoritativeTeamWorkerContext (cyclomatic 36) src/team/worker-provenance.ts:96— worker-provenance.resolveAuthoritativeTeamWorkerContext has cyclomatic complexity 36 (threshold 15). Of this number, 33 points are the body's own statements and 3 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.
documented-leader-preflight.darwinPinned (cyclomatic 35) src/ralplan/documented-leader-preflight.ts:96— documented-leader-preflight.darwinPinned has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 128, 115, 104, …). 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.
skill-active.syncCanonicalSkillStateForModeUnlocked (cyclomatic 35) src/state/skill-active.ts:923— skill-active.syncCanonicalSkillStateForModeUnlocked has cyclomatic complexity 35 (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 (skill-active.syncCanonicalSkillStateForModeUnlocked::applyEntriesToState) 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.
plugin-marketplace.hasLivePinIntent (cyclomatic 35) src/cli/plugin-marketplace.ts:1293— plugin-marketplace.hasLivePinIntent has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
artifacts.validateUltragoalSteeringProposal (cyclomatic 35) src/ultragoal/artifacts.ts:1311— artifacts.validateUltragoalSteeringProposal has cyclomatic complexity 35 (threshold 15). Of this number, 34 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.
codex-native-hook.isAllowedDeepInterviewTerminalStateWriteCommand (cyclomatic 35) src/scripts/codex-native-hook.ts:9551— codex-native-hook.isAllowedDeepInterviewTerminalStateWriteCommand has cyclomatic complexity 35 (threshold 15). Of this number, 34 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.launchWithHud (cyclomatic 35) src/cli/index.ts:5634— index.launchWithHud has cyclomatic complexity 35 (threshold 15). Of this number, 34 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.
session.writeSessionEnd (cyclomatic 34) src/hooks/session.ts:3808— session.writeSessionEnd 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.
generator.hasUnprovenManagedMarkerHooksStateSyntax (cyclomatic 34) src/config/generator.ts:1803— generator.hasUnprovenManagedMarkerHooksStateSyntax 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.
documented-leader-preflight.routingOnlySkill (cyclomatic 34) src/ralplan/documented-leader-preflight.ts:164— documented-leader-preflight.routingOnlySkill 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.
tmux-session.restoreStandaloneHudPane (cyclomatic 34) src/team/tmux-session.ts:3050— tmux-session.restoreStandaloneHudPane has cyclomatic complexity 34 (threshold 15). Of this number, 27 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
setup.atomicWriteNativeHookTransactionArtifact (cyclomatic 34) src/cli/setup.ts:1279— setup.atomicWriteNativeHookTransactionArtifact 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.
artifacts.validateQualityGate (cyclomatic 34) src/ultragoal/artifacts.ts:1694— artifacts.validateQualityGate 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.
codex-native-hook.collectConductorRsyncStaticTransferPaths (cyclomatic 34) src/scripts/codex-native-hook.ts:19877— codex-native-hook.collectConductorRsyncStaticTransferPaths has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.mergeProjectLaunchRuntimeHistoryEntries (cyclomatic 34) src/cli/index.ts:1936— index.mergeProjectLaunchRuntimeHistoryEntries has cyclomatic complexity 34 (threshold 15). Of this number, 31 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.
dispatch.normalizeDispatchRequest (cyclomatic 33) src/team/state/dispatch.ts:95— dispatch.normalizeDispatchRequest has cyclomatic complexity 33 (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.
state.isTeamManifestV2 (cyclomatic 33) src/team/state.ts:787— state.isTeamManifestV2 has cyclomatic complexity 33 (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.
completion-gate.validateAutopilotCompletionTransition (cyclomatic 33) src/autopilot/completion-gate.ts:367— completion-gate.validateAutopilotCompletionTransition has cyclomatic complexity 33 (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.
advisory.terminalizeRalplanAdvisoryUnlocked (cyclomatic 33) src/ralplan/advisory.ts:481— advisory.terminalizeRalplanAdvisoryUnlocked 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.
tmux-hook.parseConfig (cyclomatic 33) src/cli/tmux-hook.ts:109— tmux-hook.parseConfig has cyclomatic complexity 33 (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.
tmux.registerHudResizeHook (cyclomatic 33) src/hud/tmux.ts:2124— tmux.registerHudResizeHook 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.
notice-ledger.normalizeLedger (cyclomatic 33) src/team/notice-ledger.ts:121— notice-ledger.normalizeLedger has cyclomatic complexity 33 (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.
runtime.assignTask (cyclomatic 33) src/team/runtime.ts:4893— runtime.assignTask has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to one function literal inside it that branches (line 4900). 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.
runtime.dispatchCriticalInboxInstruction (cyclomatic 33) src/team/runtime.ts:6392— runtime.dispatchCriticalInboxInstruction 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.
doctor.doctor (cyclomatic 33) REDACTED:742— doctor.doctor 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.
doctor.checkExistingNativeHooks (cyclomatic 33) REDACTED:2817— doctor.checkExistingNativeHooks 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.
index.isSafeIpv4 (cyclomatic 33) src/url-reader/index.ts:319— index.isSafeIpv4 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
package-manager-ownership.validatePackageManagerOwnership (cyclomatic 33) src/cli/package-manager-ownership.ts:74— package-manager-ownership.validatePackageManagerOwnership has cyclomatic complexity 33 (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.
managed-tmux.resolveManagedSessionContext (cyclomatic 33) src/scripts/notify-hook/managed-tmux.ts:260— managed-tmux.resolveManagedSessionContext has cyclomatic complexity 33 (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.
codex-native-hook.stateReadTrailingArgsAreSafe (cyclomatic 33) src/scripts/codex-native-hook.ts:9806— codex-native-hook.stateReadTrailingArgsAreSafe has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isStaticallyValidatedOmxStateWriteInvocation (cyclomatic 33) src/scripts/codex-native-hook.ts:16433— codex-native-hook.isStaticallyValidatedOmxStateWriteInvocation 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.listHookVisibleRunDirStateRefs (cyclomatic 33) src/cli/index.ts:10035— index.listHookVisibleRunDirStateRefs has cyclomatic complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 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.
state.readDispatchRequests (cyclomatic 32) src/team/state.ts:2126— state.readDispatchRequests has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 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.
hotswap.runAuthHotswap (cyclomatic 32) src/auth/hotswap.ts:265— hotswap.runAuthHotswap 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.
tmux.createHudWatchPane (cyclomatic 32) src/hud/tmux.ts:1801— tmux.createHudWatchPane has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
base.updateModeStateUnderCanonicalLock (cyclomatic 32) src/modes/base.ts:427— base.updateModeStateUnderCanonicalLock has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
team.parseTeamArgs (cyclomatic 32) REDACTED:845— team.parseTeamArgs 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. This is NOT this file's highest cyclomatic complexity: team.sampleValueForTeamApiField (cyclomatic 36) 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.
package-manager-ownership.isCompletePackageManagerOwnership (cyclomatic 32) src/cli/package-manager-ownership.ts:37— package-manager-ownership.isCompletePackageManagerOwnership 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.
codex-native-hook.commandExecutesUninspectedScript (cyclomatic 32) src/scripts/codex-native-hook.ts:5447— codex-native-hook.commandExecutesUninspectedScript 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectOmxStateCommandOperations::scanNestedSubstitutions (cyclomatic 32) src/scripts/codex-native-hook.ts:7968— codex-native-hook.collectOmxStateCommandOperations::scanNestedSubstitutions 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isInsideConductorSubstitutionGrouping (cyclomatic 32) src/scripts/codex-native-hook.ts:19490— codex-native-hook.isInsideConductorSubstitutionGrouping 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
hasLivePinForDelegate (cyclomatic 32) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1214— hasLivePinForDelegate 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.
session.readNativeSessionOwnerEvidence (cyclomatic 31) src/hooks/session.ts:3556— session.readNativeSessionOwnerEvidence has cyclomatic complexity 31 (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.
generator.collectManagedHookTrustStateSourceRepresentations (cyclomatic 31) src/config/generator.ts:2305— generator.collectManagedHookTrustStateSourceRepresentations has cyclomatic complexity 31 (threshold 15). Of this number, 20 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generator.migrateManagedCodexHookTrustStateCoordinates (cyclomatic 31) src/config/generator.ts:2520— generator.migrateManagedCodexHookTrustStateCoordinates 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.
tmux-hook-engine.evaluateInjectionGuards (cyclomatic 31) src/scripts/tmux-hook-engine.ts:101— tmux-hook-engine.evaluateInjectionGuards 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.
reconcile.assessOwnedHudLayout (cyclomatic 31) src/hud/reconcile.ts:40— reconcile.assessOwnedHudLayout has cyclomatic complexity 31 (threshold 15). Of this number, 18 points are the body's own statements and 13 belong to 4 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.
runtime.terminateTrackedProcessTree (cyclomatic 31) src/team/runtime.ts:2768— runtime.terminateTrackedProcessTree 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.
export.exportSessionHistory (cyclomatic 31) src/session-history/export.ts:68— export.exportSessionHistory 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.
mission.missionCommand (cyclomatic 31) src/cli/mission.ts:361— mission.missionCommand has cyclomatic complexity 31 (threshold 15). Of this number, 29 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.
keyword-detector.directCandidateIndexes::addBlock (cyclomatic 31) src/hooks/keyword-detector.ts:2849— keyword-detector.directCandidateIndexes::addBlock 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. This shape REPEATS in the file: one other method here (keyword-detector.directCandidateIndexes) 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.
codex-native-hook.tokenizeConductorShellWords (cyclomatic 31) src/scripts/codex-native-hook.ts:16022— codex-native-hook.tokenizeConductorShellWords 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nestedExecEnvironmentClearBoundary (cyclomatic 31) src/scripts/codex-native-hook.ts:18709— codex-native-hook.nestedExecEnvironmentClearBoundary 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.decodeDetachedLeaderPayload (cyclomatic 31) src/cli/index.ts:8879— index.decodeDetachedLeaderPayload has cyclomatic complexity 31 (threshold 15). Of this number, 29 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.
index.selectAuthorizedHookVisibleRunDirState (cyclomatic 31) src/cli/index.ts:10217— index.selectAuthorizedHookVisibleRunDirState 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.
notify-fallback-delivery.validateOutcome (cyclomatic 31) src/scripts/notify-fallback-delivery.ts:184— notify-fallback-delivery.validateOutcome has cyclomatic complexity 31 (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.
notify-fallback-watcher.resolveActiveTeamState (cyclomatic 31) src/scripts/notify-fallback-watcher.ts:655— notify-fallback-watcher.resolveActiveTeamState 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.
scaling.validateScaleDownCleanupResources (cyclomatic 30) src/team/scaling.ts:1562— scaling.validateScaleDownCleanupResources 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.
wiki-server.handleWikiToolCallWithOptions (cyclomatic 30) src/mcp/wiki-server.ts:170— wiki-server.handleWikiToolCallWithOptions 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.
setup.applyNativeHookTransactionArtifact (cyclomatic 30) src/cli/setup.ts:1587— setup.applyNativeHookTransactionArtifact has cyclomatic complexity 30 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
setup.refreshNativeAgentConfigs (cyclomatic 30) src/cli/setup.ts:6176— setup.refreshNativeAgentConfigs 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.
uninstall.atomicReplaceFile (cyclomatic 30) src/cli/uninstall.ts:1150— uninstall.atomicReplaceFile 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.
codex-native-hook.buildRalplanAdvisoryRoutingObservation (cyclomatic 30) src/scripts/codex-native-hook.ts:10270— codex-native-hook.buildRalplanAdvisoryRoutingObservation 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nestedShellHasUnsafeStartup (cyclomatic 30) src/scripts/codex-native-hook.ts:12992— codex-native-hook.nestedShellHasUnsafeStartup 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorSafeReferenceControlTargets (cyclomatic 30) src/scripts/codex-native-hook.ts:14203— codex-native-hook.collectConductorSafeReferenceControlTargets 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyShellCwdStateEffect (cyclomatic 30) src/scripts/codex-native-hook.ts:17223— codex-native-hook.applyShellCwdStateEffect has cyclomatic complexity 30 (threshold 15). Of this number, 27 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nestedShellEnablesPosix (cyclomatic 30) src/scripts/codex-native-hook.ts:18618— codex-native-hook.nestedShellEnablesPosix has cyclomatic complexity 30 (threshold 15). Of this number, 27 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
template-engine.computeTemplateVariables (cyclomatic 30) src/notifications/template-engine.ts:88— template-engine.computeTemplateVariables 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.
index.acquireHistoryPersistenceLock (cyclomatic 30) src/cli/index.ts:1384— index.acquireHistoryPersistenceLock has cyclomatic complexity 30 (threshold 15). Of this number, 23 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.
index.persistProjectLaunchRuntimeHistoryArtifacts (cyclomatic 30) src/cli/index.ts:1620— index.persistProjectLaunchRuntimeHistoryArtifacts has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1631, 1661, 1665). 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.
runtime-cli.main (cyclomatic 30) src/team/runtime-cli.ts:296— runtime-cli.main has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 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.
hasKnownLiveSessionPin (cyclomatic 30) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1169— hasKnownLiveSessionPin 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.
session.recoverSessionPointerLock (cyclomatic 29) src/hooks/session.ts:1789— session.recoverSessionPointerLock 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.
mailbox.executeBridgeCommand (cyclomatic 29) src/team/state/mailbox.ts:132— mailbox.executeBridgeCommand has cyclomatic complexity 29 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
generator.inventoryProjectTrustPayload (cyclomatic 29) src/config/generator.ts:1081— generator.inventoryProjectTrustPayload 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.
state.readUltragoalState (cyclomatic 29) REDACTED:335— state.readUltragoalState has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 belong to 6 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.
advisory.reconcileRalplanAdvisoryUnlocked (cyclomatic 29) src/ralplan/advisory.ts:665— advisory.reconcileRalplanAdvisoryUnlocked has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 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.
tmux.readHudHookHealth (cyclomatic 29) src/hud/tmux.ts:1249— tmux.readHudHookHealth has cyclomatic complexity 29 (threshold 15). Of this number, 28 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.
bootstrap.autoStartStdioMcpServer (cyclomatic 29) src/mcp/bootstrap.ts:495— bootstrap.autoStartStdioMcpServer has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (runDuplicateSiblingWatchdog, stopDuplicateSiblingWatchdog, logLifecycle, …). 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.
runtime.terminateExactPaneProcessTree (cyclomatic 29) src/team/runtime.ts:2981— runtime.terminateExactPaneProcessTree has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
runtime.isValidGonePaneDescendantCleanupDebt (cyclomatic 29) src/team/runtime.ts:3198— runtime.isValidGonePaneDescendantCleanupDebt has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 3203). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
plugin-marketplace.claimPublicationLock (cyclomatic 29) src/cli/plugin-marketplace.ts:2690— plugin-marketplace.claimPublicationLock 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.
codex-native-pre-post.parseGitCommitCommand (cyclomatic 29) src/scripts/codex-native-pre-post.ts:796— codex-native-pre-post.parseGitCommitCommand 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.
codex-native-hook.isConductorFinalPipelineMember (cyclomatic 29) src/scripts/codex-native-hook.ts:16150— codex-native-hook.isConductorFinalPipelineMember 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.postLaunch (cyclomatic 29) src/cli/index.ts:9250— index.postLaunch 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.
codex-hooks.tokenizePosixCommand (cyclomatic 28) src/config/codex-hooks.ts:1317— codex-hooks.tokenizePosixCommand 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.
session.reconcileNativeTransition.<returned closure> (cyclomatic 28) src/hooks/session.ts:3646— session.reconcileNativeTransition.<returned closure> has cyclomatic complexity 28 (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.
completion-evidence.validateCompletionEvidence (cyclomatic 28) src/team/completion-evidence.ts:12— completion-evidence.validateCompletionEvidence has cyclomatic complexity 28 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
worktree.ensureWorktree (cyclomatic 28) src/team/worktree.ts:382— worktree.ensureWorktree 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.
tmux-hook-engine.normalizeTmuxHookConfig (cyclomatic 28) src/scripts/tmux-hook-engine.ts:19— tmux-hook-engine.normalizeTmuxHookConfig has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
session-status.readRelevantSkillState (cyclomatic 28) src/notifications/session-status.ts:84— session-status.readRelevantSkillState has cyclomatic complexity 28 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
render.renderTeamWorkers (cyclomatic 28) src/hud/render.ts:214— render.renderTeamWorkers has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 215, 253, 252, …). 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.
tmux-session.buildWorkerProcessLaunchSpecForMode (cyclomatic 28) src/team/tmux-session.ts:2254— tmux-session.buildWorkerProcessLaunchSpecForMode has cyclomatic complexity 28 (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.
phase-controller.buildTransitionPath (cyclomatic 28) src/team/phase-controller.ts:55— phase-controller.buildTransitionPath 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.
plugin-marketplace.openManagedCacheNamespace (cyclomatic 28) src/cli/plugin-marketplace.ts:3058— plugin-marketplace.openManagedCacheNamespace has cyclomatic complexity 28 (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.
team.resolveApprovedTeamFollowupContext (cyclomatic 28) REDACTED:166— team.resolveApprovedTeamFollowupContext 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. This is NOT this file's highest cyclomatic complexity: team.sampleValueForTeamApiField (cyclomatic 36) 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.
question.questionCommand (cyclomatic 28) src/cli/question.ts:244— question.questionCommand 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.
continuation.parseImagegenContinuationArgs (cyclomatic 28) src/imagegen/continuation.ts:145— continuation.parseImagegenContinuationArgs has cyclomatic complexity 28 (threshold 15). Of this number, 27 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.
keyword-detector.collectQuoteRanges (cyclomatic 28) src/hooks/keyword-detector.ts:1539— keyword-detector.collectQuoteRanges 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.
auto-nudge.syncSkillStateFromTurn (cyclomatic 28) src/scripts/notify-hook/auto-nudge.ts:220— auto-nudge.syncSkillStateFromTurn 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.
codex-native-hook.classifyPreToolUseMutationTransport (cyclomatic 28) src/scripts/codex-native-hook.ts:5653— codex-native-hook.classifyPreToolUseMutationTransport 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractPackageManagerExecCommand (cyclomatic 28) src/scripts/codex-native-hook.ts:6998— codex-native-hook.extractPackageManagerExecCommand 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorTimeInvocation (cyclomatic 28) src/scripts/codex-native-hook.ts:7475— codex-native-hook.parseConductorTimeInvocation 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedTrustedAbsoluteOmxReadOnlyCommand (cyclomatic 28) src/scripts/codex-native-hook.ts:10128— codex-native-hook.isAllowedTrustedAbsoluteOmxReadOnlyCommand has cyclomatic complexity 28 (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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedRalplanBashWrite (cyclomatic 28) src/scripts/codex-native-hook.ts:10536— codex-native-hook.isAllowedRalplanBashWrite has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedRgCommand (cyclomatic 28) src/scripts/codex-native-hook.ts:12558— codex-native-hook.isPositivelyClassifiedRgCommand 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.wgetInvocationHasUnsafeFiniteTransferMode (cyclomatic 28) src/scripts/codex-native-hook.ts:14390— codex-native-hook.wgetInvocationHasUnsafeFiniteTransferMode 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorMutationOptionValueWordCount (cyclomatic 28) src/scripts/codex-native-hook.ts:15539— codex-native-hook.conductorMutationOptionValueWordCount 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectProcessSubstitutionExpansionPrefix (cyclomatic 28) src/scripts/codex-native-hook.ts:19444— codex-native-hook.collectProcessSubstitutionExpansionPrefix 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
report.renderReport (cyclomatic 28) src/evals/astra-defaults/report.ts:125— report.renderReport has cyclomatic complexity 28 (threshold 15). Of this number, 25 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.
notify-fallback-delivery.terminalGraph (cyclomatic 28) src/scripts/notify-fallback-delivery.ts:360— notify-fallback-delivery.terminalGraph 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.
smoke-packed-install.resolvePinnedCodexExecutable (cyclomatic 28) src/scripts/smoke-packed-install.ts:494— smoke-packed-install.resolvePinnedCodexExecutable 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.
smoke-packed-install.assertNativeHookAdvisoryPreToolUse (cyclomatic 28) src/scripts/smoke-packed-install.ts:2367— smoke-packed-install.assertNativeHookAdvisoryPreToolUse 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.
codex-native-hook.livePinDirectory (cyclomatic 27) plugins/oh-my-codex/hooks/codex-native-hook.mjs:486— codex-native-hook.livePinDirectory has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong 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.
codex-native-hook.writePendingSessionPin (cyclomatic 27) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1267— codex-native-hook.writePendingSessionPin 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.
codex-hooks.planManagedCodexHooksMerge (cyclomatic 27) src/config/codex-hooks.ts:2713— codex-hooks.planManagedCodexHooksMerge has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 3 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.
generator.reconcileProjectScopeTrustState (cyclomatic 27) src/config/generator.ts:1450— generator.reconcileProjectScopeTrustState 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.
reply-listener.pollDiscordOnce (cyclomatic 27) src/notifications/reply-listener.ts:548— reply-listener.pollDiscordOnce 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.
renderer.launchQuestionRenderer (cyclomatic 27) src/question/renderer.ts:850— renderer.launchQuestionRenderer 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.
autoresearch-goal.autoresearchGoalCommand (cyclomatic 27) src/cli/autoresearch-goal.ts:83— autoresearch-goal.autoresearchGoalCommand 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.
setup.installPrompts (cyclomatic 27) src/cli/setup.ts:6025— setup.installPrompts 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.
usage.buildSessionUsageReport (cyclomatic 27) src/session-history/usage.ts:189— usage.buildSessionUsageReport has cyclomatic complexity 27 (threshold 15). Of this number, 23 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.
codex-native-hook.shouldRetireShadowedRalphStartingSeed (cyclomatic 27) src/scripts/codex-native-hook.ts:1249— codex-native-hook.shouldRetireShadowedRalphStartingSeed 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractDeepInterviewCommandWriteTargets (cyclomatic 27) src/scripts/codex-native-hook.ts:5712— codex-native-hook.extractDeepInterviewCommandWriteTargets 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractStateWriteOperationPayload (cyclomatic 27) src/scripts/codex-native-hook.ts:6645— codex-native-hook.extractStateWriteOperationPayload has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to 2 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractEnvSplitStringCommand (cyclomatic 27) src/scripts/codex-native-hook.ts:6967— codex-native-hook.extractEnvSplitStringCommand 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedOmxReadOnlyCommand (cyclomatic 27) src/scripts/codex-native-hook.ts:10098— codex-native-hook.isAllowedOmxReadOnlyCommand 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.executeDetachedLaunchStateMachine (cyclomatic 27) src/cli/index.ts:4857— index.executeDetachedLaunchStateMachine 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.
readPinnedRoutingRecord (cyclomatic 27) plugins/oh-my-codex/hooks/codex-native-hook.mjs:250— readPinnedRoutingRecord 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.
toml-source.analyzeTomlSource (cyclomatic 26) src/utils/toml-source.ts:23— toml-source.analyzeTomlSource 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.
codex-hooks.inspectOwnership (cyclomatic 26) src/config/codex-hooks.ts:1942— codex-hooks.inspectOwnership 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session.createSessionState (cyclomatic 26) src/hooks/session.ts:1262— session.createSessionState 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.
session.parseLockOwner (cyclomatic 26) src/hooks/session.ts:1444— session.parseLockOwner 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.
generator.upsertTuiStatusLine (cyclomatic 26) src/config/generator.ts:3634— generator.upsertTuiStatusLine 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.
mode-binding-lease.withModeBindingOwnerTransaction (cyclomatic 26) src/state/mode-binding-lease.ts:175— mode-binding-lease.withModeBindingOwnerTransaction has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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.
events.normalizeSubmittedAnswers (cyclomatic 26) src/question/events.ts:201— events.normalizeSubmittedAnswers has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 215). 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.
tmux-session.waitForWorkerReadyDetailedAsync (cyclomatic 26) src/team/tmux-session.ts:3653— tmux-session.waitForWorkerReadyDetailedAsync has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 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.
runtime.startTeam::runWorkerStartupAttempt (cyclomatic 26) src/team/runtime.ts:4159— runtime.startTeam::runWorkerStartupAttempt has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (runtime.startTeam) 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. This is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
session-search.parseSessionSearchArgs (cyclomatic 26) src/cli/session-search.ts:122— session-search.parseSessionSearchArgs 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.
codex-native-hook.conductorMetadataWriteSizesStayBounded (cyclomatic 26) src/scripts/codex-native-hook.ts:5300— codex-native-hook.conductorMetadataWriteSizesStayBounded has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.firstPlanningTmpScriptExecutionTarget::scanCommand (cyclomatic 26) src/scripts/codex-native-hook.ts:6463— codex-native-hook.firstPlanningTmpScriptExecutionTarget::scanCommand has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectShellCasePhases (cyclomatic 26) src/scripts/codex-native-hook.ts:7678— codex-native-hook.collectShellCasePhases has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readActiveRalplanStateForPreToolUse (cyclomatic 26) src/scripts/codex-native-hook.ts:10489— codex-native-hook.readActiveRalplanStateForPreToolUse has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 3 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedFindCommand (cyclomatic 26) src/scripts/codex-native-hook.ts:12193— codex-native-hook.isPositivelyClassifiedFindCommand has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.curlUrlGlobCaptureValues (cyclomatic 26) src/scripts/codex-native-hook.ts:14578— codex-native-hook.curlUrlGlobCaptureValues has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.stripShellCommentsForConductorScan (cyclomatic 26) src/scripts/codex-native-hook.ts:19316— codex-native-hook.stripShellCommentsForConductorScan has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
update-worker.main (cyclomatic 26) src/cli/update-worker.ts:81— update-worker.main 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.
collector.collectRecord (cyclomatic 26) src/evals/astra-defaults/collector.ts:40— collector.collectRecord 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.
isChildRoutingSessionStart (cyclomatic 26) plugins/oh-my-codex/hooks/codex-native-hook.mjs:180— isChildRoutingSessionStart 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.
artifacts.readApprovedExecutionLaunchHintOutcome (cyclomatic 25) src/planning/artifacts.ts:699— artifacts.readApprovedExecutionLaunchHintOutcome 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.
native-assets.inspectManagedNativeBinary (cyclomatic 25) src/cli/native-assets.ts:559— native-assets.inspectManagedNativeBinary 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.
session.malformedRecoveryPointerReason (cyclomatic 25) src/hooks/session.ts:1953— session.malformedRecoveryPointerReason 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.
session.startPointerTransition.<returned closure> (cyclomatic 25) src/hooks/session.ts:2866— session.startPointerTransition.<returned closure> 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.
session.isAuthorizedBoundPointer (cyclomatic 25) src/hooks/session.ts:3254— session.isAuthorizedBoundPointer 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.
dispatch-recovery.reconcileRuntimeFinalizations (cyclomatic 25) src/team/state/dispatch-recovery.ts:69— dispatch-recovery.reconcileRuntimeFinalizations has cyclomatic complexity 25 (threshold 15). Of this number, 23 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.
tracker.selectReusableSubagentEntry (cyclomatic 25) src/subagents/tracker.ts:1874— tracker.selectReusableSubagentEntry has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1898, 1888, 1914). 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.
skill-active.normalizeSkillActiveState (cyclomatic 25) src/state/skill-active.ts:328— skill-active.normalizeSkillActiveState 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.
contract.validateAndNormalizeRalphState (cyclomatic 25) src/ralph/contract.ts:78— contract.validateAndNormalizeRalphState 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.
renderer.isWideCodePoint (cyclomatic 25) src/question/renderer.ts:143— renderer.isWideCodePoint 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.
state.validateAnswerAgainstQuestion (cyclomatic 25) src/question/state.ts:357— state.validateAnswerAgainstQuestion 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.
role-router.routeTaskToRole (cyclomatic 25) src/team/role-router.ts:187— role-router.routeTaskToRole 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.
plugin-marketplace.readOmxPluginCacheState (cyclomatic 25) src/cli/plugin-marketplace.ts:3352— plugin-marketplace.readOmxPluginCacheState 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.
state.stateCommand (cyclomatic 25) src/cli/state.ts:67— state.stateCommand 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.
codex-native-hook.readActiveRalphState (cyclomatic 25) src/scripts/codex-native-hook.ts:1391— codex-native-hook.readActiveRalphState 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findActiveGoalWorkflowReconciliationRequirement (cyclomatic 25) src/scripts/codex-native-hook.ts:3410— codex-native-hook.findActiveGoalWorkflowReconciliationRequirement has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolveEnvWrappedCommandCwd (cyclomatic 25) src/scripts/codex-native-hook.ts:5834— codex-native-hook.resolveEnvWrappedCommandCwd 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findPackageManagerExecSubcommandIndex (cyclomatic 25) src/scripts/codex-native-hook.ts:7034— codex-native-hook.findPackageManagerExecSubcommandIndex 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findTimeoutDispatchOperandIndex (cyclomatic 25) src/scripts/codex-native-hook.ts:7525— codex-native-hook.findTimeoutDispatchOperandIndex 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.splitStateScanSegments (cyclomatic 25) src/scripts/codex-native-hook.ts:7874— codex-native-hook.splitStateScanSegments has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.evaluateDeepInterviewRalplanHandoffCommand (cyclomatic 25) src/scripts/codex-native-hook.ts:9396— codex-native-hook.evaluateDeepInterviewRalplanHandoffCommand 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolvePreToolUseWriteActor (cyclomatic 25) src/scripts/codex-native-hook.ts:10893— codex-native-hook.resolvePreToolUseWriteActor 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nodeCommandHasUnsafeRuntimeOutput (cyclomatic 25) src/scripts/codex-native-hook.ts:12901— codex-native-hook.nodeCommandHasUnsafeRuntimeOutput 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorBoundedTruncateTargets (cyclomatic 25) src/scripts/codex-native-hook.ts:15688— codex-native-hook.collectConductorBoundedTruncateTargets 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isInvocationIsolated (cyclomatic 25) src/scripts/codex-native-hook.ts:16114— codex-native-hook.isInvocationIsolated 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.showStatus (cyclomatic 25) src/cli/index.ts:5423— index.showStatus has cyclomatic complexity 25 (threshold 15). Of this number, 21 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.
codex-native-hook.readLivePinMutationLock (cyclomatic 24) plugins/oh-my-codex/hooks/codex-native-hook.mjs:677— codex-native-hook.readLivePinMutationLock has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
codex-hooks.parseJsonSource::parseValue (cyclomatic 24) src/config/codex-hooks.ts:895— codex-hooks.parseJsonSource::parseValue 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.
codex-hooks.tokenizePowerShellCommand (cyclomatic 24) src/config/codex-hooks.ts:1524— codex-hooks.tokenizePowerShellCommand 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.
state-root.validateWorkerNotifyStateRoot (cyclomatic 24) src/team/state-root.ts:360— state-root.validateWorkerNotifyStateRoot 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.
state.commitTeamMembershipTaskTransaction (cyclomatic 24) src/team/state.ts:1017— state.commitTeamMembershipTaskTransaction 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.
tracker.recordNativeSubagentAuthorityObservation (cyclomatic 24) src/subagents/tracker.ts:1115— tracker.recordNativeSubagentAuthorityObservation has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1127, 1132). 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.
tmux.lexPosixWords (cyclomatic 24) src/hud/tmux.ts:307— tmux.lexPosixWords 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.
tmux.containsPowerShellHudOwnerReferenceOutsideQuotes (cyclomatic 24) src/hud/tmux.ts:438— tmux.containsPowerShellHudOwnerReferenceOutsideQuotes 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.
config.mergeEnvIntoFileConfig (cyclomatic 24) src/notifications/config.ts:184— config.mergeEnvIntoFileConfig 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.
quality-gates.readQualityGatesConfig (cyclomatic 24) src/config/quality-gates.ts:167— quality-gates.readQualityGatesConfig 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.
runtime.deliverPendingMailboxMessages (cyclomatic 24) src/team/runtime.ts:6911— runtime.deliverPendingMailboxMessages has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 6927, 6959). 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: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
api-interop.buildStallState (cyclomatic 24) src/team/api-interop.ts:342— api-interop.buildStallState has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
plugin-marketplace.removeChild (cyclomatic 24) src/cli/plugin-marketplace.ts:525— plugin-marketplace.removeChild has cyclomatic complexity 24 (threshold 15). Of this number, 20 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.
plugin-marketplace.discoverOmxPluginCacheDirs (cyclomatic 24) src/cli/plugin-marketplace.ts:3244— plugin-marketplace.discoverOmxPluginCacheDirs 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.
performance-goal.performanceGoalCommand (cyclomatic 24) src/cli/performance-goal.ts:99— performance-goal.performanceGoalCommand 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.
search.extractSearchableTexts (cyclomatic 24) src/session-history/search.ts:219— search.extractSearchableTexts has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codebase-map.generateCodebaseMap (cyclomatic 24) src/hooks/codebase-map.ts:185— codebase-map.generateCodebaseMap 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.
managed-tmux.verifyManagedPaneTarget (cyclomatic 24) src/scripts/notify-hook/managed-tmux.ts:492— managed-tmux.verifyManagedPaneTarget 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.
keyword-detector.persistDeepInterviewModeState (cyclomatic 24) src/hooks/keyword-detector.ts:587— keyword-detector.persistDeepInterviewModeState 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.
keyword-detector.collectMarkdownReferenceIndex (cyclomatic 24) src/hooks/keyword-detector.ts:2256— keyword-detector.collectMarkdownReferenceIndex 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.
keyword-detector.directCandidateIndexes (cyclomatic 24) src/hooks/keyword-detector.ts:2790— keyword-detector.directCandidateIndexes 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 (keyword-detector.directCandidateIndexes::addBlock) 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.
codex-native-pre-post.commandInvokesOmxQuestion (cyclomatic 24) src/scripts/codex-native-pre-post.ts:1177— codex-native-pre-post.commandInvokesOmxQuestion 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.
codex-native-hook.pythonInvocationHasUnsafeRuntimeEnvironment::applyRange (cyclomatic 24) src/scripts/codex-native-hook.ts:6299— codex-native-hook.pythonInvocationHasUnsafeRuntimeEnvironment::applyRange 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findEnvDispatchOperandIndex (cyclomatic 24) src/scripts/codex-native-hook.ts:7413— codex-native-hook.findEnvDispatchOperandIndex 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.expandShellPositionalParameters (cyclomatic 24) src/scripts/codex-native-hook.ts:8358— codex-native-hook.expandShellPositionalParameters 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.splitShellCommandSegments (cyclomatic 24) src/scripts/codex-native-hook.ts:8436— codex-native-hook.splitShellCommandSegments 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasUnsafeConductorArithmeticCommand (cyclomatic 24) src/scripts/codex-native-hook.ts:8781— codex-native-hook.hasUnsafeConductorArithmeticCommand 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.maskShellNonCommandExpansionsForConductorScan (cyclomatic 24) src/scripts/codex-native-hook.ts:8933— codex-native-hook.maskShellNonCommandExpansionsForConductorScan 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isStandaloneParsedOmxStateWriteTransport (cyclomatic 24) src/scripts/codex-native-hook.ts:9243— codex-native-hook.isStandaloneParsedOmxStateWriteTransport has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedSedCommand (cyclomatic 24) src/scripts/codex-native-hook.ts:12632— codex-native-hook.isPositivelyClassifiedSedCommand 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorPathMayResolveRepositoryExecutable (cyclomatic 24) src/scripts/codex-native-hook.ts:17825— codex-native-hook.conductorPathMayResolveRepositoryExecutable 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectLexicalCommandSubstitutions (cyclomatic 24) src/scripts/codex-native-hook.ts:19587— codex-native-hook.collectLexicalCommandSubstitutions 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
process-tree.runProcessTreeWithTimeout (cyclomatic 24) src/runtime/process-tree.ts:112— process-tree.runProcessTreeWithTimeout has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 129, 175, 185, …). 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.
index.copyProjectLaunchRuntimeHistoryDirectory (cyclomatic 24) src/cli/index.ts:1823— index.copyProjectLaunchRuntimeHistoryDirectory has cyclomatic complexity 24 (threshold 15). Of this number, 22 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.
index.readMadmaxDetachedActiveRecord (cyclomatic 24) src/cli/index.ts:4243— index.readMadmaxDetachedActiveRecord 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.
suite.validateRunRecords (cyclomatic 24) src/evals/astra-defaults/suite.ts:80— suite.validateRunRecords 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.
team-dispatch.updateMailboxNotified (cyclomatic 24) src/scripts/notify-hook/team-dispatch.ts:1040— team-dispatch.updateMailboxNotified has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 1043, 1049, 1046, …). 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.
omx_runtime::run (cyclomatic 24) crates/omx-runtime/src/main.rs:16— omx_runtime::run 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.
bridge.isStrictDispatchRecord (cyclomatic 23) src/runtime/bridge.ts:224— bridge.isStrictDispatchRecord 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.
state-paths.discoverSessionAuthorityBaseStateDir (cyclomatic 23) src/mcp/state-paths.ts:315— state-paths.discoverSessionAuthorityBaseStateDir 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.
state-paths.resolveWritableStateScope (cyclomatic 23) src/mcp/state-paths.ts:954— state-paths.resolveWritableStateScope has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
session.inspectSessionPointerLockAtContext (cyclomatic 23) src/hooks/session.ts:1542— session.inspectSessionPointerLockAtContext 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.
mailbox.readLegacyMailboxMessageIds (cyclomatic 23) src/team/state/mailbox.ts:24— mailbox.readLegacyMailboxMessageIds has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
state.normalizeTeamLeaderAttentionState (cyclomatic 23) src/team/state.ts:2848— state.normalizeTeamLeaderAttentionState has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
config.isEventEnabled (cyclomatic 23) src/notifications/config.ts:531— config.isEventEnabled 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.
tmux-session.waitForWorkerReady (cyclomatic 23) src/team/tmux-session.ts:3544— tmux-session.waitForWorkerReady has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (check, sendRobustEnter). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runtime.emitMonitorDerivedEvents (cyclomatic 23) src/team/runtime.ts:6097— runtime.emitMonitorDerivedEvents 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 is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
plugin-marketplace.refreshOmxPluginCacheLivePinRecordMtime (cyclomatic 23) src/cli/plugin-marketplace.ts:1165— plugin-marketplace.refreshOmxPluginCacheLivePinRecordMtime 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.
authority.validateAuthorityState (cyclomatic 23) src/hud/authority.ts:141— authority.validateAuthorityState 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.
team.buildTeamExecutionPlan (cyclomatic 23) REDACTED:1034— team.buildTeamExecutionPlan has cyclomatic complexity 23 (threshold 15). Of this number, 16 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. This is NOT this file's highest cyclomatic complexity: team.sampleValueForTeamApiField (cyclomatic 36) 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.
advisory-activation.activateOrResumeRalplanAdvisoryUnderCanonicalLock (cyclomatic 23) src/ralplan/advisory-activation.ts:202— advisory-activation.activateOrResumeRalplanAdvisoryUnderCanonicalLock has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
sparkshell.parseSparkShellFallbackInvocation (cyclomatic 23) REDACTED:305— sparkshell.parseSparkShellFallbackInvocation has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
update.runDeferredGlobalUpdate (cyclomatic 23) REDACTED:443— update.runDeferredGlobalUpdate 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 branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
keyword-detector.collectExplicitPrefixNegationIndex (cyclomatic 23) src/hooks/keyword-detector.ts:1773— keyword-detector.collectExplicitPrefixNegationIndex 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.
codex-native-hook.resolveTeamWorkerStopDecision (cyclomatic 23) src/scripts/codex-native-hook.ts:2963— codex-native-hook.resolveTeamWorkerStopDecision 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasDynamicNestedShellExecution (cyclomatic 23) src/scripts/codex-native-hook.ts:8238— codex-native-hook.hasDynamicNestedShellExecution 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readActiveDeepInterviewStateForPreToolUse (cyclomatic 23) src/scripts/codex-native-hook.ts:10433— codex-native-hook.readActiveDeepInterviewStateForPreToolUse has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 3 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readActiveConductorStateForPreToolUse (cyclomatic 23) src/scripts/codex-native-hook.ts:10937— codex-native-hook.readActiveConductorStateForPreToolUse has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandConfiguresNodeOptions (cyclomatic 23) src/scripts/codex-native-hook.ts:12670— codex-native-hook.commandConfiguresNodeOptions 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorBoundedDdTargets (cyclomatic 23) src/scripts/codex-native-hook.ts:15656— codex-native-hook.collectConductorBoundedDdTargets 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyNestedBashShoptOptions (cyclomatic 23) src/scripts/codex-native-hook.ts:18462— codex-native-hook.applyNestedBashShoptOptions 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectLexicalProcessSubstitutions (cyclomatic 23) src/scripts/codex-native-hook.ts:19549— codex-native-hook.collectLexicalProcessSubstitutions 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.runCodexNativeHookCli (cyclomatic 23) src/scripts/codex-native-hook.ts:23189— codex-native-hook.runCodexNativeHookCli 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
notify-fallback-watcher.processLine (cyclomatic 23) src/scripts/notify-fallback-watcher.ts:1679— notify-fallback-watcher.processLine has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
mode-binding-lease-helper.sameOwnerState (cyclomatic 23) src/state/mode-binding-lease-helper.ts:343— mode-binding-lease-helper.sameOwnerState 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.
artifacts.selectLaunchHintMatch (cyclomatic 22) src/planning/artifacts.ts:462— artifacts.selectLaunchHintMatch has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 503, 471, 488). 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.
codex-hooks.decodedPosixCommandWords (cyclomatic 22) src/config/codex-hooks.ts:1706— codex-hooks.decodedPosixCommandWords has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
policy.archiveHintMismatch (cyclomatic 22) src/native-assets/policy.ts:44— policy.archiveHintMismatch has cyclomatic complexity 22 (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.
native-assets.readOpenedFile (cyclomatic 22) src/cli/native-assets.ts:474— native-assets.readOpenedFile has cyclomatic complexity 22 (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.
prompt-session-provenance.evaluateResolvedPromptTurn (cyclomatic 22) src/hooks/prompt-session-provenance.ts:209— prompt-session-provenance.evaluateResolvedPromptTurn 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.
session.parseProcessIdentityOutput (cyclomatic 22) src/hooks/session.ts:780— session.parseProcessIdentityOutput has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
worktree.replaySubmoduleRecovery (cyclomatic 22) src/team/worktree.ts:595— worktree.replaySubmoduleRecovery has cyclomatic complexity 22 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mode-state-context.captureRalphPaneBinding (cyclomatic 22) src/state/mode-state-context.ts:79— mode-state-context.captureRalphPaneBinding has cyclomatic complexity 22 (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.
reply-listener.pollTelegramOnce (cyclomatic 22) src/notifications/reply-listener.ts:712— reply-listener.pollTelegramOnce has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
render.renderUltragoal (cyclomatic 22) src/hud/render.ts:267— render.renderUltragoal has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong 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.
tmux-session.captureSourcePaneAuthority (cyclomatic 22) src/team/tmux-session.ts:291— tmux-session.captureSourcePaneAuthority has cyclomatic complexity 22 (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.
runtime.prepareShutdownMergeReport (cyclomatic 22) src/team/runtime.ts:1792— runtime.prepareShutdownMergeReport has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
query.queryWiki (cyclomatic 22) src/wiki/query.ts:79— query.queryWiki 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.
doctor.checkPluginScopedNativeHooks (cyclomatic 22) REDACTED:2597— doctor.checkPluginScopedNativeHooks 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.
doctor.checkPluginMarketplaceRegistration (cyclomatic 22) REDACTED:3606— doctor.checkPluginMarketplaceRegistration has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 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.
setup.commitNativeHookTransaction (cyclomatic 22) src/cli/setup.ts:2099— setup.commitNativeHookTransaction 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.
team.renderTeamPaneStatus (cyclomatic 22) REDACTED:787— team.renderTeamPaneStatus has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: team.sampleValueForTeamApiField (cyclomatic 36) 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.
question.parseQuestionArgs (cyclomatic 22) src/cli/question.ts:97— question.parseQuestionArgs 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.
keyword-detector.classifyKeywordInput (cyclomatic 22) src/hooks/keyword-detector.ts:3474— keyword-detector.classifyKeywordInput 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.
codex-native-pre-post.commandInvokesApplyPatch (cyclomatic 22) src/scripts/codex-native-pre-post.ts:578— codex-native-pre-post.commandInvokesApplyPatch 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.
codex-native-hook.isStructuredUltragoalSteeringShellCommand (cyclomatic 22) src/scripts/codex-native-hook.ts:8196— codex-native-hook.isStructuredUltragoalSteeringShellCommand has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.gitStatusInvocationHasSafeEnvironment (cyclomatic 22) src/scripts/codex-native-hook.ts:12760— codex-native-hook.gitStatusInvocationHasSafeEnvironment has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findSudoDispatchOperandIndex (cyclomatic 22) src/scripts/codex-native-hook.ts:14074— codex-native-hook.findSudoDispatchOperandIndex has cyclomatic complexity 22 (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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findConductorIsolatedFunctionDefinitionRegion (cyclomatic 22) src/scripts/codex-native-hook.ts:19266— codex-native-hook.findConductorIsolatedFunctionDefinitionRegion has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readBlockingSkillForStop (cyclomatic 22) src/scripts/codex-native-hook.ts:20621— codex-native-hook.readBlockingSkillForStop has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.readDetachedLeaderReport (cyclomatic 22) src/cli/index.ts:6833— index.readDetachedLeaderReport has cyclomatic complexity 22 (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.
omx_explore_harness::validate_direct_command (cyclomatic 22) crates/omx-explore/src/main.rs:1297— omx_explore_harness::validate_direct_command 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.
config.normalizeFromCustomAliases (cyclomatic 21) src/openclaw/config.ts:87— config.normalizeFromCustomAliases has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-hooks.removalProof (cyclomatic 21) src/config/codex-hooks.ts:2192— codex-hooks.removalProof has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
native-assets.validateDescendant (cyclomatic 21) src/cli/native-assets.ts:425— native-assets.validateDescendant 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.
prompt-session-provenance.preflightSelectedTargetOwner (cyclomatic 21) src/hooks/prompt-session-provenance.ts:245— prompt-session-provenance.preflightSelectedTargetOwner 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.
worktree.rollbackProvisionedWorktrees (cyclomatic 21) src/team/worktree.ts:724— worktree.rollbackProvisionedWorktrees has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
tasks.claimTask (cyclomatic 21) src/team/state/tasks.ts:59— tasks.claimTask has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 72). 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.
state.removeDispatchRequestsForWorkers (cyclomatic 21) src/team/state.ts:2272— state.removeDispatchRequestsForWorkers has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 2278, 2309). 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.
generator.stripProofManagedCodexHookTrustStateTables (cyclomatic 21) src/config/generator.ts:2758— generator.stripProofManagedCodexHookTrustStateTables has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 function items 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.
generator.findLauncherTimeoutRepairTargets (cyclomatic 21) src/config/generator.ts:4041— generator.findLauncherTimeoutRepairTargets 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.
generator.buildMergedConfig (cyclomatic 21) src/config/generator.ts:4287— generator.buildMergedConfig 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.
tracker.readCrossProcessLockState (cyclomatic 21) src/subagents/tracker.ts:529— tracker.readCrossProcessLockState 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.
state.normalizeGuardexFinishEvent (cyclomatic 21) REDACTED:134— state.normalizeGuardexFinishEvent 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.
state.readAllState (cyclomatic 21) REDACTED:932— state.readAllState has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 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.
advisory-activation-verifier.verifyPinnedJsonAndSync (cyclomatic 21) src/ralplan/advisory-activation-verifier.ts:28— advisory-activation-verifier.verifyPinnedJsonAndSync 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.
tmux-hook.detectInitialTarget (cyclomatic 21) src/cli/tmux-hook.ts:272— tmux-hook.detectInitialTarget 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.
operations.completeRalplanSession (cyclomatic 21) src/state/operations.ts:531— operations.completeRalplanSession has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
tmux.hudPaneMatchesOwner (cyclomatic 21) src/hud/tmux.ts:629— tmux.hudPaneMatchesOwner has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
temp-contract.parseNotifyTempContractFromArgs (cyclomatic 21) src/notifications/temp-contract.ts:34— temp-contract.parseNotifyTempContractFromArgs 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.
runtime.removeGeneratedShutdownReport (cyclomatic 21) src/team/runtime.ts:1715— runtime.removeGeneratedShutdownReport has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent 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: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
events.normalizeRawTeamEvent (cyclomatic 21) src/team/state/events.ts:22— events.normalizeRawTeamEvent 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.
lifecycle.feedProjectMemory (cyclomatic 21) src/wiki/lifecycle.ts:193— lifecycle.feedProjectMemory has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
agents-init.agentsInit (cyclomatic 21) src/cli/agents-init.ts:279— agents-init.agentsInit 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.
uninstall.printSummary (cyclomatic 21) src/cli/uninstall.ts:1766— uninstall.printSummary 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.
watch-owner.createHudOwnerAliveProbe.<returned closure> (cyclomatic 21) src/hud/watch-owner.ts:24— watch-owner.createHudOwnerAliveProbe.<returned closure> 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.
ralplan.parseRoleIntentWriteArgs (cyclomatic 21) src/cli/ralplan.ts:323— ralplan.parseRoleIntentWriteArgs 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.
session-usage.parseSessionUsageArgs (cyclomatic 21) src/cli/session-usage.ts:22— session-usage.parseSessionUsageArgs 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.
session-search.parseSessionFrictionArgs (cyclomatic 21) src/cli/session-search.ts:191— session-search.parseSessionFrictionArgs 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.
update.runDevGlobalUpdate (cyclomatic 21) REDACTED:202— update.runDevGlobalUpdate 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.
keyword-detector.markdownDocumentationRange (cyclomatic 21) src/hooks/keyword-detector.ts:2369— keyword-detector.markdownDocumentationRange 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.
codex-native-hook.pythonCommandHasOnlySafeOptions (cyclomatic 21) src/scripts/codex-native-hook.ts:6241— codex-native-hook.pythonCommandHasOnlySafeOptions 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.handleDirectOmxCancel (cyclomatic 21) src/scripts/codex-native-hook.ts:9721— codex-native-hook.handleDirectOmxCancel 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.omxOrGjcReadOnlyShapeMatches (cyclomatic 21) src/scripts/codex-native-hook.ts:10041— codex-native-hook.omxOrGjcReadOnlyShapeMatches has cyclomatic complexity 21 (threshold 15). 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.gitConfigTextHasExecutableStatusSurface (cyclomatic 21) src/scripts/codex-native-hook.ts:12015— codex-native-hook.gitConfigTextHasExecutableStatusSurface 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isConductorPipelineMember (cyclomatic 21) src/scripts/codex-native-hook.ts:16136— codex-native-hook.isConductorPipelineMember 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isStaticallyRecognizedConductorOrchestrationMutation (cyclomatic 21) src/scripts/codex-native-hook.ts:16557— codex-native-hook.isStaticallyRecognizedConductorOrchestrationMutation has cyclomatic complexity 21 (threshold 15). Of this number, 20 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorCommandPrefixPreservesInheritedResolution (cyclomatic 21) src/scripts/codex-native-hook.ts:17702— codex-native-hook.conductorCommandPrefixPreservesInheritedResolution 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectInPlaceEditorWriteTargets (cyclomatic 21) src/scripts/codex-native-hook.ts:20438— codex-native-hook.collectInPlaceEditorWriteTargets 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.copyFilePreservingTimestamps (cyclomatic 21) src/cli/index.ts:987— index.copyFilePreservingTimestamps 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.
index.prepareRuntimeCodexHomeForProjectLaunch (cyclomatic 21) src/cli/index.ts:2142— index.prepareRuntimeCodexHomeForProjectLaunch has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
tmux.sendTmuxKeys (cyclomatic 21) src/hooks/extensibility/sdk/tmux.ts:125— tmux.sendTmuxKeys 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.
notify-dispatcher.acquireTurnDispatchGuard (cyclomatic 21) src/scripts/notify-dispatcher.ts:134— notify-dispatcher.acquireTurnDispatchGuard has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 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.
openclaw.observeOpenClaw (cyclomatic 20) src/adapt/openclaw.ts:53— openclaw.observeOpenClaw 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.
native-assets.hydrateNativeBinary (cyclomatic 20) src/cli/native-assets.ts:728— native-assets.hydrateNativeBinary 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.
session.acquirePointerLock (cyclomatic 20) src/hooks/session.ts:2409— session.acquirePointerLock 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.
session.establishLaunchSessionBinding (cyclomatic 20) src/hooks/session.ts:3099— session.establishLaunchSessionBinding has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 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.
dispatch.normalizeBridgeDispatchRecord (cyclomatic 20) src/team/state/dispatch.ts:211— dispatch.normalizeBridgeDispatchRecord 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, 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.
monitor.getTeamSummary (cyclomatic 20) src/team/state/monitor.ts:160— monitor.getTeamSummary 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.
monitor.readTeamPhase (cyclomatic 20) src/team/state/monitor.ts:295— monitor.readTeamPhase 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.
state.validateMembershipTransactionFiles (cyclomatic 20) src/team/state.ts:920— state.validateMembershipTransactionFiles 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.
generator.advancePastInlineTomlValue (cyclomatic 20) src/config/generator.ts:1610— generator.advancePastInlineTomlValue 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.
tracker.repairPersistedRootIdentityInState (cyclomatic 20) src/subagents/tracker.ts:1465— tracker.repairPersistedRootIdentityInState 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.
advisory-lifecycle-validation.journalValid (cyclomatic 20) src/ralplan/advisory-lifecycle-validation.ts:51— advisory-lifecycle-validation.journalValid 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.
advisory.commitBoundActivationIntent (cyclomatic 20) src/ralplan/advisory.ts:130— advisory.commitBoundActivationIntent has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 138). 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.
base.startModeUnderCanonicalLock (cyclomatic 20) src/modes/base.ts:201— base.startModeUnderCanonicalLock 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.
tmux-session.queryDetachedSessionLeaderBinding (cyclomatic 20) src/team/tmux-session.ts:4684— tmux-session.queryDetachedSessionLeaderBinding 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.
scaling.asScaleDownDebtResources (cyclomatic 20) src/team/scaling.ts:1666— scaling.asScaleDownDebtResources 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. This is NOT this file's highest cyclomatic complexity: scaling.asScaleDownDebtPanes::validate (cyclomatic 22) 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.
dispatcher.runPluginRunner (cyclomatic 20) src/hooks/extensibility/dispatcher.ts:67— dispatcher.runPluginRunner has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 200, 100, 125, …). 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.
runtime.destroyConfiguredDetachedTeamSession (cyclomatic 20) src/team/runtime.ts:883— runtime.destroyConfiguredDetachedTeamSession has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 885). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
ask.parseAskArgs (cyclomatic 20) src/cli/ask.ts:91— ask.parseAskArgs 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.
plugin-marketplace.readOmxPluginCacheLivePinMutationLock (cyclomatic 20) src/cli/plugin-marketplace.ts:874— plugin-marketplace.readOmxPluginCacheLivePinMutationLock 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.
index.resolveHudWatchCwd (cyclomatic 20) src/hud/index.ts:162— index.resolveHudWatchCwd 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.
keyword-detector.implicitClauseRange (cyclomatic 20) src/hooks/keyword-detector.ts:3180— keyword-detector.implicitClauseRange 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.
auto-nudge.normalizeAutoNudgeConfig (cyclomatic 20) src/scripts/notify-hook/auto-nudge.ts:478— auto-nudge.normalizeAutoNudgeConfig has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
codex-native-hook.maskQuotedRedirectMetacharsForCommandScan (cyclomatic 20) src/scripts/codex-native-hook.ts:5064— codex-native-hook.maskQuotedRedirectMetacharsForCommandScan 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.downloaderHasUnsafeTlsKeyLogEnvironment (cyclomatic 20) src/scripts/codex-native-hook.ts:14458— codex-native-hook.downloaderHasUnsafeTlsKeyLogEnvironment 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorResolvedPackageCliCandidateIsTrusted (cyclomatic 20) src/scripts/codex-native-hook.ts:17994— codex-native-hook.conductorResolvedPackageCliCandidateIsTrusted 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.functionDefinitionMayBeConditional (cyclomatic 20) src/scripts/codex-native-hook.ts:19227— codex-native-hook.functionDefinitionMayBeConditional has cyclomatic complexity 20 (threshold 15). 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, name the conditions: bind each compound test to a 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.execWithOverlay (cyclomatic 20) src/cli/index.ts:5855— index.execWithOverlay has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.buildDetachedLaunchControlPlane (cyclomatic 20) src/cli/index.ts:7088— index.buildDetachedLaunchControlPlane 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.
collect-astra-defaults.main (cyclomatic 20) src/scripts/eval/collect-astra-defaults.ts:41— collect-astra-defaults.main 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.
mode-binding-lease-helper.acquire (cyclomatic 20) src/state/mode-binding-lease-helper.ts:431— mode-binding-lease-helper.acquire 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.
pinned-atomic-file-darwin-janitor.recover (cyclomatic 20) src/state/pinned-atomic-file-darwin-janitor.ts:146— pinned-atomic-file-darwin-janitor.recover 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.
codex-hooks.tokenizeWindowsDirectCommand (cyclomatic 19) src/config/codex-hooks.ts:1405— codex-hooks.tokenizeWindowsDirectCommand 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.
codex-hooks.prepareLegacyState (cyclomatic 19) src/config/codex-hooks.ts:2512— codex-hooks.prepareLegacyState 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.
state-root.resolveWorkerTeamStateRootWithOptions (cyclomatic 19) src/team/state-root.ts:446— state-root.resolveWorkerTeamStateRootWithOptions 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.
state-paths.normalizeSessionMetadata (cyclomatic 19) src/mcp/state-paths.ts:776— state-paths.normalizeSessionMetadata 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.
session.writePointerTransaction (cyclomatic 19) src/hooks/session.ts:2695— session.writePointerTransaction 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.
session.consumeBoundDirectoryAuthorizationUnderLock (cyclomatic 19) src/hooks/session.ts:3411— session.consumeBoundDirectoryAuthorizationUnderLock 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.
coordination-protocol.normalizeTeamTaskCoordinationPlanForStorage (cyclomatic 19) src/team/coordination-protocol.ts:276— coordination-protocol.normalizeTeamTaskCoordinationPlanForStorage 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.
generator.parseTomlSourceTableHeader (cyclomatic 19) src/config/generator.ts:2050— generator.parseTomlSourceTableHeader 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.
generator.removeManagedHookTrustStateFences (cyclomatic 19) src/config/generator.ts:2711— generator.removeManagedHookTrustStateFences has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-goal-snapshot.parseCodexGoalSnapshot (cyclomatic 19) src/goal-workflows/codex-goal-snapshot.ts:158— codex-goal-snapshot.parseCodexGoalSnapshot 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.
contract.parseNativeSubagentResultDisposition (cyclomatic 19) src/leader/contract.ts:187— contract.parseNativeSubagentResultDisposition 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.
tracker.quarantinePersistedRootAuthority (cyclomatic 19) src/subagents/tracker.ts:1572— tracker.quarantinePersistedRootAuthority has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1580). 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.
skill-active.acquireRootSkillActiveStateLock (cyclomatic 19) src/state/skill-active.ts:529— skill-active.acquireRootSkillActiveStateLock 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.
advisory-contract.validateAdvisoryInactiveState (cyclomatic 19) src/ralplan/advisory-contract.ts:88— advisory-contract.validateAdvisoryInactiveState 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.
operations.listStateStatuses (cyclomatic 19) src/state/operations.ts:619— operations.listStateStatuses 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.
formatter.parseTmuxTail (cyclomatic 19) src/notifications/formatter.ts:59— formatter.parseTmuxTail 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.
quality-gates.validateAllQualityGates (cyclomatic 19) src/config/quality-gates.ts:244— quality-gates.validateAllQualityGates 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.
tmux-session.resolveTeamWorkerCliForResolvedLaunchArgs (cyclomatic 19) src/team/tmux-session.ts:1750— tmux-session.resolveTeamWorkerCliForResolvedLaunchArgs has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong 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.
tmux-session.killWorkerByPaneId (cyclomatic 19) src/team/tmux-session.ts:4128— tmux-session.killWorkerByPaneId 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 (tmux-session.killWorkerByPaneIdAsync) 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.
tmux-session.killWorkerByPaneIdAsync (cyclomatic 19) src/team/tmux-session.ts:4209— tmux-session.killWorkerByPaneIdAsync 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 (tmux-session.killWorkerByPaneId) 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.
runtime.reconcileStartupCleanupPanes (cyclomatic 19) src/team/runtime.ts:387— runtime.reconcileStartupCleanupPanes has cyclomatic complexity 19 (threshold 15). 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, separate the cases: extract each independent 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: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
runtime.applyCreatedInteractiveSessionToConfig (cyclomatic 19) src/team/runtime.ts:528— runtime.applyCreatedInteractiveSessionToConfig 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: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
trace-server.handleTraceToolCall (cyclomatic 19) src/mcp/trace-server.ts:244— trace-server.handleTraceToolCall has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
autoresearch-guided.parseInitArgs (cyclomatic 19) src/cli/autoresearch-guided.ts:254— autoresearch-guided.parseInitArgs 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.
native-hook-claim-journal.restoreNativeHookClaimNoClobber (cyclomatic 19) src/cli/native-hook-claim-journal.ts:118— native-hook-claim-journal.restoreNativeHookClaimNoClobber 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.
plugin-marketplace.writePendingOmxPluginCacheLivePinRegistration (cyclomatic 19) src/cli/plugin-marketplace.ts:1061— plugin-marketplace.writePendingOmxPluginCacheLivePinRegistration 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.
plugin-marketplace.hasLiveSessionPinRecord (cyclomatic 19) src/cli/plugin-marketplace.ts:1247— plugin-marketplace.hasLiveSessionPinRecord has cyclomatic complexity 19 (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.
plugin-marketplace.omxPluginCacheManifestProvenanceReason (cyclomatic 19) src/cli/plugin-marketplace.ts:2804— plugin-marketplace.omxPluginCacheManifestProvenanceReason 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.
doctor.checkStateRootSessionBinding (cyclomatic 19) REDACTED:598— doctor.checkStateRootSessionBinding 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.
doctor.repairStateProjections (cyclomatic 19) REDACTED:671— doctor.repairStateProjections 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.
uninstall.parseNotifyMetadata (cyclomatic 19) src/cli/uninstall.ts:500— uninstall.parseNotifyMetadata has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong 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.
sparkshell.sparkshellCommand (cyclomatic 19) REDACTED:406— sparkshell.sparkshellCommand 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.
usage.inspectTranscript (cyclomatic 19) src/session-history/usage.ts:97— usage.inspectTranscript 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.
auto-nudge.resolveNudgePaneTarget (cyclomatic 19) src/scripts/notify-hook/auto-nudge.ts:597— auto-nudge.resolveNudgePaneTarget 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.
codex-native-pre-post.tokenizeShellCommand (cyclomatic 19) src/scripts/codex-native-pre-post.ts:261— codex-native-pre-post.tokenizeShellCommand 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.
codex-native-pre-post.findGitCommandTokenIndex (cyclomatic 19) src/scripts/codex-native-pre-post.ts:519— codex-native-pre-post.findGitCommandTokenIndex 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.
pre-tool-use-advisory.toAdvisoryOrCancelPreToolUseOutput (cyclomatic 19) src/hooks/native/pre-tool-use-advisory.ts:56— pre-tool-use-advisory.toAdvisoryOrCancelPreToolUseOutput 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.
codex-native-hook.commandHasDestructiveGitSubcommand (cyclomatic 19) src/scripts/codex-native-hook.ts:5359— codex-native-hook.commandHasDestructiveGitSubcommand 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findShellFunctionBodyEnd (cyclomatic 19) src/scripts/codex-native-hook.ts:6004— codex-native-hook.findShellFunctionBodyEnd 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.envCommandHasCwdChangingOption (cyclomatic 19) src/scripts/codex-native-hook.ts:6738— codex-native-hook.envCommandHasCwdChangingOption 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractNestedCommandSubstitutionStringsForStateScan (cyclomatic 19) src/scripts/codex-native-hook.ts:8127— codex-native-hook.extractNestedCommandSubstitutionStringsForStateScan 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.staticExpansionAssignmentMarker (cyclomatic 19) src/scripts/codex-native-hook.ts:8901— codex-native-hook.staticExpansionAssignmentMarker 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedOmxSessionLockInspectCommand (cyclomatic 19) src/scripts/codex-native-hook.ts:10059— codex-native-hook.isAllowedOmxSessionLockInspectCommand 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.gitStatusTrackedSurfaceIsSafe (cyclomatic 19) src/scripts/codex-native-hook.ts:12069— codex-native-hook.gitStatusTrackedSurfaceIsSafe 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedUniqCommand (cyclomatic 19) src/scripts/codex-native-hook.ts:12529— codex-native-hook.isPositivelyClassifiedUniqCommand 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyModeledPythonSource (cyclomatic 19) src/scripts/codex-native-hook.ts:13820— codex-native-hook.isPositivelyModeledPythonSource 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorSedTargets (cyclomatic 19) src/scripts/codex-native-hook.ts:15397— codex-native-hook.collectConductorSedTargets 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyNestedShellEnvironment (cyclomatic 19) src/scripts/codex-native-hook.ts:18572— codex-native-hook.applyNestedShellEnvironment 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 file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.queryMadmaxDetachedRuntimeBinding (cyclomatic 19) src/cli/index.ts:4295— index.queryMadmaxDetachedRuntimeBinding 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.
index.parseDetachedHudAuthorityProof (cyclomatic 19) src/cli/index.ts:8914— index.parseDetachedHudAuthorityProof 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.
team-dispatch.runtimeExec (cyclomatic 19) src/scripts/notify-hook/team-dispatch.ts:40— team-dispatch.runtimeExec 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.
team-leader-nudge.maybeNudgeTeamLeader::persistLeaderNudgeBookkeeping (cyclomatic 19) src/scripts/notify-hook/team-leader-nudge.ts:914— team-leader-nudge.maybeNudgeTeamLeader::persistLeaderNudgeBookkeeping 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 (team-leader-nudge.maybeNudgeTeamLeader) 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.
notify-fallback-watcher.resolveActiveModeState (cyclomatic 19) src/scripts/notify-fallback-watcher.ts:587— notify-fallback-watcher.resolveActiveModeState 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.
notify-fallback-watcher.runFallbackAutoNudgeTick (cyclomatic 19) src/scripts/notify-fallback-watcher.ts:1361— notify-fallback-watcher.runFallbackAutoNudgeTick 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.
notify-fallback-watcher.enforceLifecycleGuards (cyclomatic 19) src/scripts/notify-fallback-watcher.ts:1485— notify-fallback-watcher.enforceLifecycleGuards 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.
smoke-packed-install.smokeInstalledLaunchArgumentBoundary (cyclomatic 19) src/scripts/smoke-packed-install.ts:1899— smoke-packed-install.smokeInstalledLaunchArgumentBoundary 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.
readNoFollowText (cyclomatic 19) plugins/oh-my-codex/hooks/codex-native-hook.mjs:640— readNoFollowText 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.
codex-native-hook.removeVerifiedLockEntry (cyclomatic 18) plugins/oh-my-codex/hooks/codex-native-hook.mjs:716— codex-native-hook.removeVerifiedLockEntry has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
codex-hooks.isValidRustRegexEscape (cyclomatic 18) src/config/codex-hooks.ts:794— codex-hooks.isValidRustRegexEscape 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.
session.classifySessionProcessForRecovery (cyclomatic 18) src/hooks/session.ts:1986— session.classifySessionProcessForRecovery 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.
session.authorizeBoundDirectoryBeforeTransaction (cyclomatic 18) src/hooks/session.ts:3357— session.authorizeBoundDirectoryBeforeTransaction 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.
monitor.normalizeWorkerIntegrationState (cyclomatic 18) src/team/state/monitor.ts:103— monitor.normalizeWorkerIntegrationState has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
coordination-protocol.normalizeTeamTaskCoordinationPlanForRender (cyclomatic 18) src/team/coordination-protocol.ts:236— coordination-protocol.normalizeTeamTaskCoordinationPlanForRender 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.
contract.supportEvidenceFromBlocker (cyclomatic 18) src/leader/contract.ts:254— contract.supportEvidenceFromBlocker 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.
skill-active.listActiveSkills (cyclomatic 18) src/state/skill-active.ts:221— skill-active.listActiveSkills 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.
skill-active.reclaimOwnerlessStaleLock (cyclomatic 18) src/state/skill-active.ts:478— skill-active.reclaimOwnerlessStaleLock 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.
types.normalizeQuestionItem (cyclomatic 18) src/question/types.ts:137— types.normalizeQuestionItem 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.
runtime.parseAutoresearchCandidateArtifact (cyclomatic 18) REDACTED:1009— runtime.parseAutoresearchCandidateArtifact 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.
model-contract.tokenizeWorkerLaunchArgs (cyclomatic 18) REDACTED:198— model-contract.tokenizeWorkerLaunchArgs 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.
worker-bootstrap.generateInitialInbox (cyclomatic 18) src/team/worker-bootstrap.ts:788— worker-bootstrap.generateInitialInbox has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 806). 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.
autoresearch-guided.runAutoresearchNoviceBridge (cyclomatic 18) src/cli/autoresearch-guided.ts:303— autoresearch-guided.runAutoresearchNoviceBridge has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
triage-config.readTriageConfig (cyclomatic 18) src/hooks/triage-config.ts:38— triage-config.readTriageConfig 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.
plugin-marketplace.validateStagedPluginSnapshot (cyclomatic 18) src/cli/plugin-marketplace.ts:3159— plugin-marketplace.validateStagedPluginSnapshot 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.
doctor.collectRepoArtifactOwnershipIssues::visit (cyclomatic 18) REDACTED:1671— doctor.collectRepoArtifactOwnershipIssues::visit 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.
doctor.checkSparkRouting (cyclomatic 18) REDACTED:4030— doctor.checkSparkRouting 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.
setup.ensureSnapshotBackup (cyclomatic 18) src/cli/setup.ts:2042— setup.ensureSnapshotBackup 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.
setup.assertManagedDestination (cyclomatic 18) src/cli/setup.ts:2351— setup.assertManagedDestination 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.
uninstall.stageAndRemoveFile (cyclomatic 18) src/cli/uninstall.ts:1300— uninstall.stageAndRemoveFile 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.
index.launchTmuxPane (cyclomatic 18) src/hud/index.ts:714— index.launchTmuxPane has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
team.parseTeamApiArgs (cyclomatic 18) REDACTED:521— team.parseTeamApiArgs 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 is NOT this file's highest cyclomatic complexity: team.sampleValueForTeamApiField (cyclomatic 36) 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.
AdvisoryLifecycleHandler.activate (cyclomatic 18) src/ralplan/runtime-advisory-lifecycle.ts:249— AdvisoryLifecycleHandler.activate has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session-export.parseSessionExportArgs (cyclomatic 18) src/cli/session-export.ts:27— session-export.parseSessionExportArgs 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.
keyword-detector.collectImplicitClauseIndex (cyclomatic 18) src/hooks/keyword-detector.ts:3088— keyword-detector.collectImplicitClauseIndex 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.
codex-native-pre-post.readInlineEnvironmentAssignments (cyclomatic 18) src/scripts/codex-native-pre-post.ts:666— codex-native-pre-post.readInlineEnvironmentAssignments has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
triage-state.isTriageStateFile (cyclomatic 18) src/hooks/triage-state.ts:171— triage-state.isTriageStateFile 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.
codex-native-hook.collectSloppyFallbackFindingsFromPatch (cyclomatic 18) src/scripts/codex-native-hook.ts:1895— codex-native-hook.collectSloppyFallbackFindingsFromPatch 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.classifyRalplanBeadsMetadataCommand (cyclomatic 18) src/scripts/codex-native-hook.ts:4865— codex-native-hook.classifyRalplanBeadsMetadataCommand has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorMetadataRedirectsHaveBoundedProducers (cyclomatic 18) src/scripts/codex-native-hook.ts:5237— codex-native-hook.conductorMetadataRedirectsHaveBoundedProducers 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandHasPackageInstallIntent (cyclomatic 18) src/scripts/codex-native-hook.ts:5393— codex-native-hook.commandHasPackageInstallIntent 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findPackageInstallSubcommandIndex (cyclomatic 18) src/scripts/codex-native-hook.ts:5410— codex-native-hook.findPackageInstallSubcommandIndex 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolveWrappedCommandExecutionContext (cyclomatic 18) src/scripts/codex-native-hook.ts:5871— codex-native-hook.resolveWrappedCommandExecutionContext 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.sliceShellWordsTailPreservingQuoting (cyclomatic 18) src/scripts/codex-native-hook.ts:7221— codex-native-hook.sliceShellWordsTailPreservingQuoting 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findCaseArmCommandIndex (cyclomatic 18) src/scripts/codex-native-hook.ts:7640— codex-native-hook.findCaseArmCommandIndex 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nodeCommandHasPreloadExecution (cyclomatic 18) src/scripts/codex-native-hook.ts:12707— codex-native-hook.nodeCommandHasPreloadExecution 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorCoprocCompoundBodies (cyclomatic 18) src/scripts/codex-native-hook.ts:12949— codex-native-hook.collectConductorCoprocCompoundBodies 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandMayBeConditionallyExecuted (cyclomatic 18) src/scripts/codex-native-hook.ts:16846— codex-native-hook.commandMayBeConditionallyExecuted 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyPersistentFunctionEffects (cyclomatic 18) src/scripts/codex-native-hook.ts:18390— codex-native-hook.applyPersistentFunctionEffects 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.runCodex::launchDetachedSession::bootstrapLeader (cyclomatic 18) src/cli/index.ts:8418— index.runCodex::launchDetachedSession::bootstrapLeader 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 (index.runCodex) 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.
notify-hook.terminalStateMatchesNotifyTurn (cyclomatic 18) src/scripts/notify-hook.ts:312— notify-hook.terminalStateMatchesNotifyTurn 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.
notify-hook.dispatchTurnCompleteHookEvents (cyclomatic 18) src/scripts/notify-hook.ts:552— notify-hook.dispatchTurnCompleteHookEvents 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.
verify-native-agents.assertTomlStructure (cyclomatic 18) src/scripts/verify-native-agents.ts:70— verify-native-agents.assertTomlStructure 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.
mode-binding-lease-helper.readPinnedRecord (cyclomatic 18) src/state/mode-binding-lease-helper.ts:40— mode-binding-lease-helper.readPinnedRecord 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.
pinned-atomic-file-darwin-helper.main (cyclomatic 18) src/state/pinned-atomic-file-darwin-helper.ts:219— pinned-atomic-file-darwin-helper.main 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.
codex-hooks.classifyManagedCodexNativeHookWindowsShimOwnership (cyclomatic 17) src/config/codex-hooks.ts:315— codex-hooks.classifyManagedCodexNativeHookWindowsShimOwnership 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.
codex-hooks.validateCommandHandler (cyclomatic 17) src/config/codex-hooks.ts:1041— codex-hooks.validateCommandHandler 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.
state-paths.resolveRuntimeStateScope (cyclomatic 17) src/mcp/state-paths.ts:1131— state-paths.resolveRuntimeStateScope 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.
session.classifyParsedSessionPointer (cyclomatic 17) src/hooks/session.ts:1177— session.classifyParsedSessionPointer 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.
session.acquireDirectoryCapability (cyclomatic 17) src/hooks/session.ts:3032— session.acquireDirectoryCapability 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.
worktree.parseWorktreeMode (cyclomatic 17) src/team/worktree.ts:303— worktree.parseWorktreeMode 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.
dispatch.executeBridgeCommand (cyclomatic 17) src/team/state/dispatch.ts:179— dispatch.executeBridgeCommand 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.
state.deriveLeaderStopAttentionState (cyclomatic 17) src/team/state.ts:2954— state.deriveLeaderStopAttentionState has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: state.isStrictLegacyDispatchRequestForRollback (cyclomatic 18) 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.
generator.projectTrustCandidateIsSafe (cyclomatic 17) src/config/generator.ts:1350— generator.projectTrustCandidateIsSafe has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 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.
mode-binding-lease.resolveValidatedCanonicalModeBinding (cyclomatic 17) src/state/mode-binding-lease.ts:74— mode-binding-lease.resolveValidatedCanonicalModeBinding 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.
advisory-evidence.canonicalArtifactPath (cyclomatic 17) src/ralplan/advisory-evidence.ts:205— advisory-evidence.canonicalArtifactPath 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.
advisory-contract.classifyAdvisoryPrompt (cyclomatic 17) src/ralplan/advisory-contract.ts:73— advisory-contract.classifyAdvisoryPrompt 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.
advisory.administrativelyAbandonRalplanAdvisory (cyclomatic 17) src/ralplan/advisory.ts:946— advisory.administrativelyAbandonRalplanAdvisory 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 one function literal inside it that branches (line 954). 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.
tmux.parsePosixHudEnvAssignments.inspect (cyclomatic 17) src/hud/tmux.ts:393— tmux.parsePosixHudEnvAssignments.inspect 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.
session-status.buildDiscordSessionStatusReply (cyclomatic 17) src/notifications/session-status.ts:217— session-status.buildDiscordSessionStatusReply has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong 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.
reconcile.acquireHudReconcileLock (cyclomatic 17) src/hud/reconcile.ts:374— reconcile.acquireHudReconcileLock 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.
tmux-session.requireFrozenWindowTopologySync (cyclomatic 17) src/team/tmux-session.ts:840— tmux-session.requireFrozenWindowTopologySync 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.
tmux-session.sendToWorker (cyclomatic 17) src/team/tmux-session.ts:3852— tmux-session.sendToWorker 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.
tmux-session.teardownWorkerPanes (cyclomatic 17) src/team/tmux-session.ts:4518— tmux-session.teardownWorkerPanes 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.
scaling.recoverCreatedWorktreeAfterEnsureFailure (cyclomatic 17) src/team/scaling.ts:393— scaling.recoverCreatedWorktreeAfterEnsureFailure 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. This is NOT this file's highest cyclomatic complexity: scaling.asScaleDownDebtPanes::validate (cyclomatic 22) 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.
runtime.syncRootTeamModeStateOnTerminalPhase (cyclomatic 17) src/team/runtime.ts:255— runtime.syncRootTeamModeStateOnTerminalPhase has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: runtime.isDetachedSessionDestroyReceipt (cyclomatic 30) 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.
auth.authCommand (cyclomatic 17) src/cli/auth.ts:97— auth.authCommand 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.
autopilot.autopilotCommand (cyclomatic 17) src/cli/autopilot.ts:98— autopilot.autopilotCommand 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.
plugin-marketplace.omxPluginCacheSkillsProvenanceReason (cyclomatic 17) src/cli/plugin-marketplace.ts:2887— plugin-marketplace.omxPluginCacheSkillsProvenanceReason 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.
setup.decideWindowsNativeHookShimReference (cyclomatic 17) src/cli/setup.ts:1180— setup.decideWindowsNativeHookShimReference 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.
setup.ensureProjectGitignore (cyclomatic 17) src/cli/setup.ts:3473— setup.ensureProjectGitignore 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.
setup.syncManagedAgentsContent (cyclomatic 17) src/cli/setup.ts:5948— setup.syncManagedAgentsContent 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.
setup.cleanupLegacyManagedSkills (cyclomatic 17) src/cli/setup.ts:6573— setup.cleanupLegacyManagedSkills 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.
authority.runHudAuthorityTick (cyclomatic 17) src/hud/authority.ts:342— authority.runHudAuthorityTick 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.
followup-planner.pickSpecialistRole (cyclomatic 17) src/team/followup-planner.ts:218— followup-planner.pickSpecialistRole 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.
artifacts.validateArchitectureInvariantGate (cyclomatic 17) src/ultragoal/artifacts.ts:1643— artifacts.validateArchitectureInvariantGate 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.ipv6ToBigInt (cyclomatic 17) src/url-reader/index.ts:380— index.ipv6ToBigInt has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
keyword-detector.collectFencedCodeRanges (cyclomatic 17) src/hooks/keyword-detector.ts:1471— keyword-detector.collectFencedCodeRanges 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.
team-tmux-guard.queuePaneInput (cyclomatic 17) src/scripts/notify-hook/team-tmux-guard.ts:588— team-tmux-guard.queuePaneInput has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong 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.
orchestration-intent.classifyLeaderActionState (cyclomatic 17) src/scripts/notify-hook/orchestration-intent.ts:33— orchestration-intent.classifyLeaderActionState 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.
codex-native-hook.isNativeSubagentHook (cyclomatic 17) src/scripts/codex-native-hook.ts:577— codex-native-hook.isNativeSubagentHook 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.buildPersistedSubagentReopenContext (cyclomatic 17) src/scripts/codex-native-hook.ts:2245— codex-native-hook.buildPersistedSubagentReopenContext has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findWrappedCommandPositionIndex (cyclomatic 17) src/scripts/codex-native-hook.ts:7788— codex-native-hook.findWrappedCommandPositionIndex has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasUnresolvedShellArithmeticExpansion (cyclomatic 17) src/scripts/codex-native-hook.ts:8815— codex-native-hook.hasUnresolvedShellArithmeticExpansion has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractShellHeredocOpeners (cyclomatic 17) src/scripts/codex-native-hook.ts:8992— codex-native-hook.extractShellHeredocOpeners has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedPerlCommand (cyclomatic 17) src/scripts/codex-native-hook.ts:11573— codex-native-hook.isPositivelyClassifiedPerlCommand has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.classifyConductorExecutableRuntime (cyclomatic 17) src/scripts/codex-native-hook.ts:13879— codex-native-hook.classifyConductorExecutableRuntime has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyModeledPythonMetadataWriteSource (cyclomatic 17) src/scripts/codex-native-hook.ts:14007— codex-native-hook.isPositivelyModeledPythonMetadataWriteSource has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorXargsOptionValueWordCount (cyclomatic 17) src/scripts/codex-native-hook.ts:15510— codex-native-hook.conductorXargsOptionValueWordCount has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorExecutableHasTrustedSystemIdentity (cyclomatic 17) src/scripts/codex-native-hook.ts:17620— codex-native-hook.conductorExecutableHasTrustedSystemIdentity has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorPackageCliHasTrustedNodeInterpreter (cyclomatic 17) src/scripts/codex-native-hook.ts:17956— codex-native-hook.conductorPackageCliHasTrustedNodeInterpreter has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyShellFunctionBindingEffect (cyclomatic 17) src/scripts/codex-native-hook.ts:18797— codex-native-hook.applyShellFunctionBindingEffect has cyclomatic complexity 17 (threshold 15). Of this number, 15 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isConductorSafeRsyncMetadataControl (cyclomatic 17) src/scripts/codex-native-hook.ts:19955— codex-native-hook.isConductorSafeRsyncMetadataControl has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.wakeOpenClaw (cyclomatic 17) src/openclaw/index.ts:76— index.wakeOpenClaw 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.resolveSetupAgentsMergePolicyArg (cyclomatic 17) src/cli/index.ts:546— index.resolveSetupAgentsMergePolicyArg has cyclomatic complexity 17 (threshold 15). Of this number, 12 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.
index.persistProjectLaunchRuntimeJsonlArtifact (cyclomatic 17) src/cli/index.ts:1543— index.persistProjectLaunchRuntimeJsonlArtifact 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.completePreLaunchSetup (cyclomatic 17) src/cli/index.ts:8032— index.completePreLaunchSetup 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.
index.assertCompatibleNestedSkillOwners (cyclomatic 17) src/cli/index.ts:10450— index.assertCompatibleNestedSkillOwners 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.
runtime-state.readHudState (cyclomatic 17) src/hooks/extensibility/sdk/runtime-state.ts:42— runtime-state.readHudState 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.
operational-events.buildOperationalContext (cyclomatic 17) src/scripts/notify-hook/operational-events.ts:194— operational-events.buildOperationalContext 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.
hook-derived-watcher.inferDerivedEvent (cyclomatic 17) src/scripts/hook-derived-watcher.ts:182— hook-derived-watcher.inferDerivedEvent 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.
hook-derived-watcher.processLine (cyclomatic 17) src/scripts/hook-derived-watcher.ts:436— hook-derived-watcher.processLine 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.
notify-fallback-delivery.compactNotifyFallbackDeliveries (cyclomatic 17) src/scripts/notify-fallback-delivery.ts:393— notify-fallback-delivery.compactNotifyFallbackDeliveries has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
verify-native-agents.verifyNativeAgents (cyclomatic 17) src/scripts/verify-native-agents.ts:199— verify-native-agents.verifyNativeAgents 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.
codex-native-hook.readJsonStringLiteral (cyclomatic 16) plugins/oh-my-codex/hooks/codex-native-hook.mjs:41— codex-native-hook.readJsonStringLiteral 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.
codex-native-hook.hasPendingSessionRegistration (cyclomatic 16) plugins/oh-my-codex/hooks/codex-native-hook.mjs:906— codex-native-hook.hasPendingSessionRegistration 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.
codex-native-hook.renewPendingSessionPinLease (cyclomatic 16) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1374— codex-native-hook.renewPendingSessionPinLease 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.
codex-hooks.applyCoordinateSafeRemovals (cyclomatic 16) src/config/codex-hooks.ts:2413— codex-hooks.applyCoordinateSafeRemovals 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.
codex-hooks.hasExecutableForeignHandlerInUnknownEvent (cyclomatic 16) src/config/codex-hooks.ts:2630— codex-hooks.hasExecutableForeignHandlerInUnknownEvent 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.
session.classifySessionProcess (cyclomatic 16) src/hooks/session.ts:1135— session.classifySessionProcess 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.
session.updateDetachedSessionMetadata (cyclomatic 16) src/hooks/session.ts:3186— session.updateDetachedSessionMetadata has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong 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.
dispatch.enqueueDispatchRequest (cyclomatic 16) src/team/state/dispatch.ts:264— dispatch.enqueueDispatchRequest has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 274). 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.
state.writeMailbox (cyclomatic 16) src/team/state.ts:2092— state.writeMailbox has cyclomatic complexity 16 (threshold 15). Of this number, 14 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. This is NOT this file's highest cyclomatic complexity: state.isStrictLegacyDispatchRequestForRollback (cyclomatic 18) 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.
generator.projectTrustEqual (cyclomatic 16) src/config/generator.ts:1407— generator.projectTrustEqual 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.
generator.upsertPluginModeRuntimeFeatureFlags (cyclomatic 16) src/config/generator.ts:3063— generator.upsertPluginModeRuntimeFeatureFlags 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.
exact-pane.parseExactPaneProof (cyclomatic 16) src/team/exact-pane.ts:33— exact-pane.parseExactPaneProof 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.
tmux-hook-engine.resolveCodexPane (cyclomatic 16) src/scripts/tmux-hook-engine.ts:205— tmux-hook-engine.resolveCodexPane 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.
documented-leader-preflight.neutralizeOwnedRoutingRalplan (cyclomatic 16) src/ralplan/documented-leader-preflight.ts:221— documented-leader-preflight.neutralizeOwnedRoutingRalplan 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.
skill-active.syncCanonicalSkillStateForModeUnlocked::applyEntriesToState (cyclomatic 16) src/state/skill-active.ts:965— skill-active.syncCanonicalSkillStateForModeUnlocked::applyEntriesToState 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 (skill-active.syncCanonicalSkillStateForModeUnlocked) 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.
tmux.unregisterHudResizeHook (cyclomatic 16) src/hud/tmux.ts:2244— tmux.unregisterHudResizeHook 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.
render.sliceAnsiVisible (cyclomatic 16) src/hud/render.ts:449— render.sliceAnsiVisible 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.
tmux-session.isWorkerAlive (cyclomatic 16) src/team/tmux-session.ts:4009— tmux-session.isWorkerAlive 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.
ultragoal-context.resolveLeaderOwnedUltragoalContextOutcome (cyclomatic 16) src/team/ultragoal-context.ts:125— ultragoal-context.resolveLeaderOwnedUltragoalContextOutcome has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong 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.
team-identity.candidateFromDir (cyclomatic 16) src/team/team-identity.ts:103— team-identity.candidateFromDir 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.
cleanup.cleanupOmxMcpProcesses (cyclomatic 16) src/cli/cleanup.ts:402— cleanup.cleanupOmxMcpProcesses 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.
toml.upsertTopLevelTomlString (cyclomatic 16) src/utils/toml.ts:28— toml.upsertTopLevelTomlString 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 cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
process-identity.parseProcessOwnerToken (cyclomatic 16) src/state/process-identity.ts:17— process-identity.parseProcessOwnerToken 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.
plugin-marketplace.hasManagedSnapshotOwnershipRecord (cyclomatic 16) src/cli/plugin-marketplace.ts:1989— plugin-marketplace.hasManagedSnapshotOwnershipRecord 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.
plugin-marketplace.inspectIncompletePublicationClaim (cyclomatic 16) src/cli/plugin-marketplace.ts:2021— plugin-marketplace.inspectIncompletePublicationClaim 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.
doctor.checkExternalCodexProcessGuards (cyclomatic 16) REDACTED:2194— doctor.checkExternalCodexProcessGuards 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.
artifacts.parseUltragoalSteeringDirective (cyclomatic 16) src/ultragoal/artifacts.ts:1146— artifacts.parseUltragoalSteeringDirective 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.
artifacts.applySteeringMutation (cyclomatic 16) src/ultragoal/artifacts.ts:1397— artifacts.applySteeringMutation 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.
friction.buildRisks (cyclomatic 16) src/session-history/friction.ts:244— friction.buildRisks 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.
index.isSafeIpv6 (cyclomatic 16) src/url-reader/index.ts:336— index.isSafeIpv6 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.
keyword-detector.isActiveImplicitMatch (cyclomatic 16) src/hooks/keyword-detector.ts:3384— keyword-detector.isActiveImplicitMatch 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.
team-worker-posttooluse.handleTeamWorkerPostToolUseSuccess (cyclomatic 16) src/scripts/notify-hook/team-worker-posttooluse.ts:393— team-worker-posttooluse.handleTeamWorkerPostToolUseSuccess 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.
hook-payload-guard.readJsonStringLiteral (cyclomatic 16) src/scripts/hook-payload-guard.ts:27— hook-payload-guard.readJsonStringLiteral 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.
codex-native-hook.resolveSessionOwnerPidFromAncestry (cyclomatic 16) src/scripts/codex-native-hook.ts:1666— codex-native-hook.resolveSessionOwnerPidFromAncestry 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.listRawActiveSkillEntries (cyclomatic 16) src/scripts/codex-native-hook.ts:3174— codex-native-hook.listRawActiveSkillEntries 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 is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.buildModeBasedStopOutput (cyclomatic 16) src/scripts/codex-native-hook.ts:3204— codex-native-hook.buildModeBasedStopOutput 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.decodeStaticRedirectShellWord (cyclomatic 16) src/scripts/codex-native-hook.ts:5117— codex-native-hook.decodeStaticRedirectShellWord 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorHeredocRedirectHasBoundedProducer (cyclomatic 16) src/scripts/codex-native-hook.ts:5209— codex-native-hook.conductorHeredocRedirectHasBoundedProducer 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findStdbufDispatchOperandIndex (cyclomatic 16) src/scripts/codex-native-hook.ts:7587— codex-native-hook.findStdbufDispatchOperandIndex 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractDispatchBuiltinOperand (cyclomatic 16) src/scripts/codex-native-hook.ts:8276— codex-native-hook.extractDispatchBuiltinOperand 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.decodeShellHeredocAnsiEscape (cyclomatic 16) src/scripts/codex-native-hook.ts:8632— codex-native-hook.decodeShellHeredocAnsiEscape 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.packageManagerInvokesScriptRuntime (cyclomatic 16) src/scripts/codex-native-hook.ts:11600— codex-native-hook.packageManagerInvokesScriptRuntime 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyReadOnlyGitCommand (cyclomatic 16) src/scripts/codex-native-hook.ts:12134— codex-native-hook.isPositivelyReadOnlyGitCommand 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandMayPopulateSensitiveRuntimeEnvironment (cyclomatic 16) src/scripts/codex-native-hook.ts:12867— codex-native-hook.commandMayPopulateSensitiveRuntimeEnvironment has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.maskPythonStringsAndComments (cyclomatic 16) src/scripts/codex-native-hook.ts:13789— codex-native-hook.maskPythonStringsAndComments 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractConductorInterpreterWrites (cyclomatic 16) src/scripts/codex-native-hook.ts:13931— codex-native-hook.extractConductorInterpreterWrites has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the 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: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorMutationUsesUnsafeOption (cyclomatic 16) src/scripts/codex-native-hook.ts:14256— codex-native-hook.conductorMutationUsesUnsafeOption 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandHasUnsafeConductorOrchestrationPrefixEnvironment (cyclomatic 16) src/scripts/codex-native-hook.ts:16380— codex-native-hook.commandHasUnsafeConductorOrchestrationPrefixEnvironment 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 one function literal inside it that branches (line 16385). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolveConductorStaticDirectoryChange (cyclomatic 16) src/scripts/codex-native-hook.ts:17189— codex-native-hook.resolveConductorStaticDirectoryChange has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorTrustedScriptInterpreterIsSafe (cyclomatic 16) src/scripts/codex-native-hook.ts:17783— codex-native-hook.conductorTrustedScriptInterpreterIsSafe 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.stripCommandSubstitutionBodiesForConductorScan (cyclomatic 16) src/scripts/codex-native-hook.ts:19401— codex-native-hook.stripCommandSubstitutionBodiesForConductorScan 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.unscopedRootRalplanStateIsNewerTerminalPlanningCompletion (cyclomatic 16) src/scripts/codex-native-hook.ts:20756— codex-native-hook.unscopedRootRalplanStateIsNewerTerminalPlanningCompletion 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. This is NOT this file's highest cyclomatic complexity: codex-native-hook.conductorShellStateNameIsSensitive (cyclomatic 19) 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. This file is where this pass's cyclomatic complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 173 of the 693 methods over the threshold — including the worst — and 3045 of the 11411 points over it (27%), 5.5× the next-largest file (src/team/runtime.ts at 552). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.materializeProjectLaunchRuntimeHistoryEntries (cyclomatic 16) src/cli/index.ts:1758— index.materializeProjectLaunchRuntimeHistoryEntries 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.
index.collectDetachedFailureSegments (cyclomatic 16) src/cli/index.ts:4640— index.collectDetachedFailureSegments 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.
prompt-inventory.buildRepositorySizeInventory (cyclomatic 16) src/scripts/prompt-inventory.ts:150— prompt-inventory.buildRepositorySizeInventory 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, 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.
D10 · Test Quality· Fixed-sleep synchronisation · ×1
Fixed-sleep synchronisation: backs off identical failed detached repair attempts src/hud/__tests__/watch-detached.test.ts:374— This test starts work it did not wait for (`promise`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 1_050))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
codex-native-hook.collectConductorDownloaderOutputTargets (cognitive 476) src/scripts/codex-native-hook.ts:14853— codex-native-hook.collectConductorDownloaderOutputTargets has cognitive complexity 476 (threshold 15). Drivers by points: if/else 146 (363 pts), boolean chains 87, ternaries 16 (45 pts), loops 9 (21 pts) (nesting depth added 258). 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. This shape REPEATS in the file: one other method here (codex-native-hook.collectConductorDownloaderOutputTargets::finalizeCurlTransfer) 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.dispatchCodexNativeHook (cognitive 441) src/scripts/codex-native-hook.ts:21948— codex-native-hook.dispatchCodexNativeHook has cognitive complexity 441 (threshold 15). Drivers by points: if/else 102 (221 pts), boolean chains 108, ternaries 35 (82 pts), error handling 8 (27 pts), loops 1 (3 pts) (nesting depth added 187). Of this number, 439 points are the body's own statements and 2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
setup.setup (cognitive 394) src/cli/setup.ts:4449— setup.setup has cognitive complexity 394 (threshold 15). Drivers by points: if/else 118 (186 pts), ternaries 57 (147 pts), boolean chains 46, loops 8 (12 pts), error handling 2 (3 pts) (nesting depth added 163). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.shutdownTeam (cognitive 385) src/team/runtime.ts:5068— runtime.shutdownTeam has cognitive complexity 385 (threshold 15). Drivers by points: if/else 84 (198 pts), ternaries 39 (91 pts), boolean chains 62, loops 12 (21 pts), error handling 8 (13 pts) (nesting depth added 180). Of this number, 284 points are the body's own statements and 101 belong to 18 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.
codex-native-hook.inspectConductorRuntimeExecutions (cognitive 337) src/scripts/codex-native-hook.ts:13056— codex-native-hook.inspectConductorRuntimeExecutions has cognitive complexity 337 (threshold 15). Drivers by points: if/else 78 (239 pts), boolean chains 50, loops 11 (32 pts), ternaries 4 (16 pts) (nesting depth added 194). Of this number, 324 points are the body's own statements and 13 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
api-interop.executeTeamApiOperation (cognitive 304) src/team/api-interop.ts:612— api-interop.executeTeamApiOperation has cognitive complexity 304 (threshold 15). Drivers by points: boolean chains 124, if/else 58 (118 pts), ternaries 30 (57 pts), error handling 2 (4 pts), match/switch 1 (nesting depth added 89). Of this number, 300 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.
notify-hook.main (cognitive 303) src/scripts/notify-hook.ts:612— notify-hook.main has cognitive complexity 303 (threshold 15). Drivers by points: if/else 68 (152 pts), boolean chains 77, error handling 19 (39 pts), ternaries 14 (30 pts), loops 2 (5 pts) (nesting depth added 123). Of this number, 298 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
runtime.startTeam (cognitive 282) src/team/runtime.ts:3562— runtime.startTeam has cognitive complexity 282 (threshold 15). Drivers by points: if/else 88 (206 pts), ternaries 32 (59 pts), boolean chains 34, error handling 9 (30 pts), loops 14 (27 pts) (nesting depth added 179). 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. This shape REPEATS in the file: one other method here (runtime.startTeam::runWorkerStartupAttempt) 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.
codex-native-hook.scanConductorShellSegment (cognitive 277) src/scripts/codex-native-hook.ts:18826— codex-native-hook.scanConductorShellSegment has cognitive complexity 277 (threshold 15). Drivers by points: if/else 56 (143 pts), boolean chains 64, ternaries 21 (50 pts), loops 6 (20 pts) (nesting depth added 130). Of this number, 273 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
scaling.scaleUp (cognitive 257) src/team/scaling.ts:580— scaling.scaleUp has cognitive complexity 257 (threshold 15). Drivers by points: if/else 63 (124 pts), ternaries 39 (71 pts), boolean chains 33, error handling 13 (19 pts), loops 10 (nesting depth added 99). Most of this is not in the body itself: 3 of the 257 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 602, 784, 908, …). 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.
codex-native-hook.applyShellPosixStateEffect (cognitive 236) src/scripts/codex-native-hook.ts:18083— codex-native-hook.applyShellPosixStateEffect has cognitive complexity 236 (threshold 15). Drivers by points: if/else 71 (163 pts), boolean chains 36, loops 11 (21 pts), ternaries 7 (16 pts) (nesting depth added 111). Of this number, 231 points are the body's own statements and 5 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
tmux-session.createTeamSession (cognitive 232) src/team/tmux-session.ts:2403— tmux-session.createTeamSession has cognitive complexity 232 (threshold 15). Drivers by points: if/else 68 (142 pts), ternaries 13 (30 pts), boolean chains 27, loops 9 (23 pts), error handling 5 (10 pts) (nesting depth added 110). Of this number, 210 points are the body's own statements and 22 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.
timeline.buildSessionTimeline (cognitive 230) src/session-history/timeline.ts:191— timeline.buildSessionTimeline has cognitive complexity 230 (threshold 15). Drivers by points: if/else 54 (144 pts), ternaries 11 (46 pts), boolean chains 39, loops 1 (nesting depth added 125). Of this number, 211 points are the body's own statements and 19 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.
team-leader-nudge.maybeNudgeTeamLeader (cognitive 230) src/scripts/notify-hook/team-leader-nudge.ts:652— team-leader-nudge.maybeNudgeTeamLeader has cognitive complexity 230 (threshold 15). Drivers by points: if/else 58 (121 pts), boolean chains 65, ternaries 28 (60 pts), error handling 11 (25 pts), loops 3 (nesting depth added 109). To reduce it, split the body into named stages: move each independent 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 (team-leader-nudge.maybeNudgeTeamLeader::persistLeaderNudgeBookkeeping) 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.
smoke-packed-install.smokeInstalledNativeHookDist (cognitive 215) src/scripts/smoke-packed-install.ts:2449— smoke-packed-install.smokeInstalledNativeHookDist has cognitive complexity 215 (threshold 15). Drivers by points: loops 87 (111 pts), if/else 65 (98 pts), boolean chains 27, ternaries 6 (10 pts) (nesting depth added 61). 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. This shape REPEATS in the file: one other method here (smoke-packed-install.smokeInstalledNativeHookDist::runPackedTransportRegressions) 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.
codex-native-hook.extractNodeFsSemanticMutations (cognitive 194) src/scripts/codex-native-hook.ts:13472— codex-native-hook.extractNodeFsSemanticMutations has cognitive complexity 194 (threshold 15). Drivers by points: if/else 48 (120 pts), loops 18 (38 pts), boolean chains 25, ternaries 4 (11 pts) (nesting depth added 99). Of this number, 156 points are the body's own statements and 38 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
operations.executeStateOperation (cognitive 178) src/state/operations.ts:743— operations.executeStateOperation has cognitive complexity 178 (threshold 15). Drivers by points: if/else 42 (103 pts), ternaries 15 (41 pts), boolean chains 22, error handling 4 (8 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 93). Of this number, 19 points are the body's own statements and 159 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.
codex-native-hook.commandHasUnsafeDynamicLoaderEnvironment (cognitive 177) src/scripts/codex-native-hook.ts:11828— codex-native-hook.commandHasUnsafeDynamicLoaderEnvironment has cognitive complexity 177 (threshold 15). Drivers by points: if/else 46 (129 pts), loops 12 (28 pts), boolean chains 19, ternaries 1 (nesting depth added 99). Of this number, 171 points are the body's own statements and 6 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
plugin-marketplace.materializePackagedOmxPluginCacheImpl (cognitive 176) src/cli/plugin-marketplace.ts:3876— plugin-marketplace.materializePackagedOmxPluginCacheImpl has cognitive complexity 176 (threshold 15). Drivers by points: if/else 47 (98 pts), error handling 14 (35 pts), ternaries 12 (30 pts), boolean chains 13 (nesting depth added 90). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
doctor.collectTeamDoctorIssues (cognitive 170) REDACTED:1017— doctor.collectTeamDoctorIssues has cognitive complexity 170 (threshold 15). Drivers by points: if/else 32 (86 pts), ternaries 8 (33 pts), error handling 6 (20 pts), loops 7 (16 pts), boolean chains 15 (nesting depth added 102). 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.
plugin-marketplace.removeChildIfIdentity (cognitive 164) src/cli/plugin-marketplace.ts:2349— plugin-marketplace.removeChildIfIdentity has cognitive complexity 164 (threshold 15). Drivers by points: if/else 33 (87 pts), ternaries 11 (35 pts), boolean chains 22, error handling 8 (20 pts) (nesting depth added 90). Of this number, 105 points are the body's own statements and 59 belong to 7 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.
keyword-detector.recordSkillActivation (cognitive 163) src/hooks/keyword-detector.ts:3883— keyword-detector.recordSkillActivation has cognitive complexity 163 (threshold 15). Drivers by points: ternaries 35 (62 pts), boolean chains 51, if/else 19 (33 pts), error handling 6 (13 pts), loops 2 (4 pts) (nesting depth added 50). Of this number, 154 points are the body's own statements and 9 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.
codex-native-hook.commandHasUnsafeConductorShellState (cognitive 148) src/scripts/codex-native-hook.ts:11668— codex-native-hook.commandHasUnsafeConductorShellState has cognitive complexity 148 (threshold 15). Drivers by points: if/else 37 (114 pts), boolean chains 17, loops 6 (17 pts) (nesting depth added 88). Of this number, 147 points are the body's own statements and 1 belongs 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorMutationCommandTargets (cognitive 148) src/scripts/codex-native-hook.ts:15724— codex-native-hook.collectConductorMutationCommandTargets has cognitive complexity 148 (threshold 15). Drivers by points: if/else 49 (111 pts), boolean chains 25, ternaries 5 (11 pts), loops 1 (nesting depth added 68). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
team.teamCommand (cognitive 135) REDACTED:1424— team.teamCommand has cognitive complexity 135 (threshold 15). Drivers by points: if/else 37 (73 pts), ternaries 19 (45 pts), boolean chains 13, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 64). Of this number, 123 points are the body's own statements and 12 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.
doctor.formatStateRootSessionBindingDiagnostic (cognitive 123) REDACTED:440— doctor.formatStateRootSessionBindingDiagnostic has cognitive complexity 123 (threshold 15). Drivers by points: ternaries 49 (104 pts), boolean chains 12, if/else 6 (7 pts) (nesting depth added 56). Of this number, 118 points are the body's own statements and 5 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.
artifacts.checkpointUltragoal (cognitive 122) src/ultragoal/artifacts.ts:1796— artifacts.checkpointUltragoal has cognitive complexity 122 (threshold 15). Drivers by points: if/else 34 (63 pts), ternaries 17 (38 pts), boolean chains 21 (nesting depth added 50). None of this is in the body itself: all 122 points belong to one function literal inside it that branches (line 1797). 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.
codex-native-hook.collectConductorStaticReadOnlyDownloadUrls (cognitive 117) src/scripts/codex-native-hook.ts:14629— codex-native-hook.collectConductorStaticReadOnlyDownloadUrls has cognitive complexity 117 (threshold 15). Drivers by points: if/else 28 (87 pts), boolean chains 17, ternaries 3 (9 pts), loops 2 (4 pts) (nesting depth added 67). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity· main (cognitive 113) · ×1
main (cognitive 113) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1609— main has cognitive complexity 113 (threshold 15). Drivers by points: if/else 49 (72 pts), boolean chains 22, other 8, error handling 3 (5 pts), ternaries 5, loops 1 (nesting depth added 25). Of this number, 53 points are the body's own statements and 60 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.
state.retireTeamMailboxMessages (cognitive 112) src/team/state.ts:2547— state.retireTeamMailboxMessages has cognitive complexity 112 (threshold 15). Drivers by points: if/else 23 (70 pts), boolean chains 16, loops 6 (13 pts), ternaries 3 (9 pts), error handling 2 (4 pts) (nesting depth added 62). Of this number, 28 points are the body's own statements and 84 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.
ralplan.ralplanCommand (cognitive 109) src/cli/ralplan.ts:112— ralplan.ralplanCommand has cognitive complexity 109 (threshold 15). Drivers by points: if/else 24 (44 pts), ternaries 16 (41 pts), boolean chains 24 (nesting depth added 45). Of this number, 102 points are the body's own statements and 7 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.
index.cleanupPostLaunchModeStateFiles (cognitive 109) src/cli/index.ts:7776— index.cleanupPostLaunchModeStateFiles has cognitive complexity 109 (threshold 15). Drivers by points: if/else 16 (48 pts), ternaries 10 (41 pts), error handling 3 (10 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 71). Of this number, 107 points are the body's own statements and 2 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.
codex-native-hook.firstInterpreterScriptOperands (cognitive 106) src/scripts/codex-native-hook.ts:6378— codex-native-hook.firstInterpreterScriptOperands has cognitive complexity 106 (threshold 15). Drivers by points: if/else 31 (87 pts), boolean chains 18, loops 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
ultragoal.ultragoalCommand (cognitive 104) src/cli/ultragoal.ts:364— ultragoal.ultragoalCommand has cognitive complexity 104 (threshold 15). Drivers by points: if/else 44 (76 pts), ternaries 6 (15 pts), boolean chains 12, error handling 1 (nesting depth added 41). Of this number, 103 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.
codex-native-hook.sourcesFileWrittenEarlierInSameCommand::scanCommand (cognitive 102) src/scripts/codex-native-hook.ts:6537— codex-native-hook.sourcesFileWrittenEarlierInSameCommand::scanCommand has cognitive complexity 102 (threshold 15). Drivers by points: if/else 14 (54 pts), loops 9 (23 pts), ternaries 5 (17 pts), boolean chains 8 (nesting depth added 66). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
notify-fallback-delivery.deliverNotifyFallback (cognitive 101) src/scripts/notify-fallback-delivery.ts:244— notify-fallback-delivery.deliverNotifyFallback has cognitive complexity 101 (threshold 15). Drivers by points: if/else 37 (51 pts), ternaries 8 (31 pts), boolean chains 18, error handling 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reconcile.reconcileHudForPromptSubmit (cognitive 100) src/hud/reconcile.ts:474— reconcile.reconcileHudForPromptSubmit has cognitive complexity 100 (threshold 15). Drivers by points: if/else 36 (45 pts), ternaries 17 (26 pts), boolean chains 24, loops 3 (5 pts) (nesting depth added 20). Of this number, 82 points are the body's own statements and 18 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.
team-dispatch.injectDispatchRequest (cognitive 99) src/scripts/notify-hook/team-dispatch.ts:759— team-dispatch.injectDispatchRequest has cognitive complexity 99 (threshold 15). Drivers by points: if/else 23 (49 pts), boolean chains 38, error handling 3 (7 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 31). Of this number, 96 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
model-contract.parseTeamWorkerLaunchArgs (cognitive 97) REDACTED:373— model-contract.parseTeamWorkerLaunchArgs has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (68 pts), ternaries 7 (20 pts), boolean chains 8, loops 1 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.teamWorkerMutationTargetsProtectedWorkflowState (cognitive 96) src/scripts/codex-native-hook.ts:10697— codex-native-hook.teamWorkerMutationTargetsProtectedWorkflowState has cognitive complexity 96 (threshold 15). Drivers by points: if/else 22 (64 pts), boolean chains 12, ternaries 3 (11 pts), loops 2 (5 pts), error handling 1 (4 pts) (nesting depth added 56). Of this number, 94 points are the body's own statements and 2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
code-intel-server.handleCodeIntelToolCall (cognitive 93) src/mcp/code-intel-server.ts:459— code-intel-server.handleCodeIntelToolCall has cognitive complexity 93 (threshold 15). Drivers by points: if/else 22 (51 pts), loops 8 (16 pts), boolean chains 15, error handling 3 (6 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 42). Of this number, 88 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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.
memory-server.handleMemoryToolCall (cognitive 91) src/mcp/memory-server.ts:171— memory-server.handleMemoryToolCall has cognitive complexity 91 (threshold 15). Drivers by points: if/else 25 (54 pts), error handling 8 (18 pts), ternaries 4 (8 pts), boolean chains 5, loops 2 (5 pts), match/switch 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.runWatchMode::renderTick (cognitive 91) src/hud/index.ts:322— index.runWatchMode::renderTick has cognitive complexity 91 (threshold 15). Drivers by points: if/else 31 (51 pts), boolean chains 24, ternaries 9 (13 pts), error handling 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.maskJavaScriptStringsAndComments (cognitive 91) src/scripts/codex-native-hook.ts:11278— codex-native-hook.maskJavaScriptStringsAndComments has cognitive complexity 91 (threshold 15). Drivers by points: if/else 34 (71 pts), boolean chains 15, loops 2 (5 pts) (nesting depth added 40). Of this number, 89 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
uninstall.uninstall (cognitive 90) src/cli/uninstall.ts:1837— uninstall.uninstall has cognitive complexity 90 (threshold 15). Drivers by points: ternaries 22 (42 pts), if/else 23 (35 pts), loops 4 (8 pts), boolean chains 5 (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.
codex-native-hook.buildStopHookOutput (cognitive 90) src/scripts/codex-native-hook.ts:21527— codex-native-hook.buildStopHookOutput has cognitive complexity 90 (threshold 15). Drivers by points: if/else 36 (72 pts), error handling 2 (6 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
runtime.monitorTeam (cognitive 88) src/team/runtime.ts:4609— runtime.monitorTeam has cognitive complexity 88 (threshold 15). Drivers by points: if/else 21 (36 pts), ternaries 13 (20 pts), boolean chains 14, loops 9 (13 pts), error handling 2 (5 pts) (nesting depth added 29). Of this number, 86 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.
setup.installSkills (cognitive 88) src/cli/setup.ts:6363— setup.installSkills has cognitive complexity 88 (threshold 15). Drivers by points: if/else 21 (49 pts), ternaries 5 (19 pts), boolean chains 11, loops 6 (9 pts) (nesting depth added 45). Of this number, 87 points are the body's own statements and 1 belongs 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.
index.runDetachedSessionLeader (cognitive 88) src/cli/index.ts:8999— index.runDetachedSessionLeader has cognitive complexity 88 (threshold 15). Drivers by points: if/else 30 (52 pts), error handling 6 (11 pts), ternaries 7 (11 pts), boolean chains 9, loops 3 (5 pts) (nesting depth added 33). Of this number, 67 points are the body's own statements and 21 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.
codex-native-hook.unwrapOmxStateTransportCommandOnce (cognitive 86) src/scripts/codex-native-hook.ts:7054— codex-native-hook.unwrapOmxStateTransportCommandOnce has cognitive complexity 86 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 14, ternaries 3 (10 pts), loops 3 (5 pts) (nesting depth added 35). Of this number, 78 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.cancelModes (cognitive 85) src/cli/index.ts:10503— index.cancelModes has cognitive complexity 85 (threshold 15). Drivers by points: if/else 81 (210 pts), ternaries 25 (68 pts), boolean chains 52, loops 12 (28 pts), error handling 7 (20 pts) (nesting depth added 201). 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. This shape REPEATS in the file: one other method here (index.cancelModes::loadStates) 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.
scaling.scaleDown (cognitive 83) src/team/scaling.ts:1927— scaling.scaleDown has cognitive complexity 83 (threshold 15). Drivers by points: if/else 30 (44 pts), boolean chains 18, loops 8 (11 pts), ternaries 5 (6 pts), error handling 3 (4 pts) (nesting depth added 19). None of this is in the body itself: all 83 points belong to 13 function literals inside it that branch (lines 1940, 2087, 2017, …). 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.
pane-status.readTeamPaneStatus (cognitive 83) src/team/pane-status.ts:9— pane-status.readTeamPaneStatus has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 61 (73 pts), boolean chains 7, if/else 2, loops 1 (nesting depth added 12). Of this number, 33 points are the body's own statements and 50 belong to 46 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.
runtime.runRalplanConsensus (cognitive 83) src/ralplan/runtime.ts:308— runtime.runRalplanConsensus has cognitive complexity 83 (threshold 15). Drivers by points: if/else 19 (50 pts), ternaries 7 (18 pts), boolean chains 6, error handling 2 (5 pts), loops 2 (4 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.tokenizeShellWords (cognitive 83) src/scripts/codex-native-hook.ts:6802— codex-native-hook.tokenizeShellWords has cognitive complexity 83 (threshold 15). Drivers by points: if/else 28 (53 pts), boolean chains 24, ternaries 2 (5 pts), loops 1 (nesting depth added 28). Of this number, 79 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
team-dispatch.drainPendingTeamDispatch (cognitive 83) src/scripts/notify-hook/team-dispatch.ts:1153— team-dispatch.drainPendingTeamDispatch has cognitive complexity 83 (threshold 15). Drivers by points: if/else 21 (58 pts), boolean chains 16, loops 4 (7 pts), ternaries 1 (2 pts) (nesting depth added 41). Most of this is not in the body itself: 14 of the 83 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1191, 1204). 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.
codex-native-hook.applyConductorTrackedVariableWriter (cognitive 81) src/scripts/codex-native-hook.ts:17372— codex-native-hook.applyConductorTrackedVariableWriter has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (61 pts), boolean chains 8, loops 3 (7 pts), ternaries 2 (5 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
tracker.recordSubagentTurn (cognitive 80) src/subagents/tracker.ts:937— tracker.recordSubagentTurn has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 44 (63 pts), boolean chains 14, if/else 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.
tracker.parseStrictSubagentTrackingState (cognitive 79) src/subagents/tracker.ts:391— tracker.parseStrictSubagentTrackingState has cognitive complexity 79 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 23, loops 3 (6 pts), error handling 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plugin-marketplace.readOmxPluginCacheFileNoFollow (cognitive 79) src/cli/plugin-marketplace.ts:682— plugin-marketplace.readOmxPluginCacheFileNoFollow has cognitive complexity 79 (threshold 15). Drivers by points: if/else 30 (42 pts), boolean chains 23, ternaries 6 (9 pts), loops 3 (4 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.
team-tmux-guard.evaluatePaneInjectionReadiness (cognitive 79) src/scripts/notify-hook/team-tmux-guard.ts:196— team-tmux-guard.evaluatePaneInjectionReadiness has cognitive complexity 79 (threshold 15). Drivers by points: if/else 33 (53 pts), boolean chains 16, ternaries 7 (9 pts), error handling 1 (nesting depth added 22). Of this number, 70 points are the body's own statements and 9 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.
codex-native-hook.resolveWrappedCommandExecutionContext (cognitive 78) src/scripts/codex-native-hook.ts:5871— codex-native-hook.resolveWrappedCommandExecutionContext has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 10 (65 pts), if/else 5 (11 pts), boolean chains 1, loops 1 (nesting depth added 61). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
session.recoverDeadSessionPointer (cognitive 77) src/hooks/session.ts:2043— session.recoverDeadSessionPointer has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 13 (35 pts), if/else 18 (23 pts), boolean chains 11, error handling 7 (8 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.
runtime.integrateWorkerCommitsIntoLeader (cognitive 77) src/team/runtime.ts:1290— runtime.integrateWorkerCommitsIntoLeader has cognitive complexity 77 (threshold 15). Drivers by points: if/else 23 (52 pts), boolean chains 15, loops 4 (7 pts), ternaries 1 (3 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.
keyword-detector.persistStatefulSkillSeedState (cognitive 76) src/hooks/keyword-detector.ts:703— keyword-detector.persistStatefulSkillSeedState has cognitive complexity 76 (threshold 15). Drivers by points: boolean chains 28, ternaries 16 (25 pts), if/else 15 (23 pts) (nesting depth added 17). Of this number, 66 points are the body's own statements and 10 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.
codex-native-hook.wgetInvocationHasUnsafeFiniteTransferMode (cognitive 75) src/scripts/codex-native-hook.ts:14390— codex-native-hook.wgetInvocationHasUnsafeFiniteTransferMode has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (58 pts), ternaries 3 (11 pts), boolean chains 3, loops 2 (3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasSafeConductorOrchestrationRuntimeEnvironment (cognitive 75) src/scripts/codex-native-hook.ts:16285— codex-native-hook.hasSafeConductorOrchestrationRuntimeEnvironment has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (41 pts), ternaries 4 (14 pts), loops 6 (11 pts), boolean chains 8, error handling 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.scanConductorShellSource (cognitive 75) src/scripts/codex-native-hook.ts:19624— codex-native-hook.scanConductorShellSource has cognitive complexity 75 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 7 (16 pts), ternaries 5 (15 pts), boolean chains 9 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.rsyncInvocationHasUnsafeRuntimeEnvironment (cognitive 75) src/scripts/codex-native-hook.ts:19799— codex-native-hook.rsyncInvocationHasUnsafeRuntimeEnvironment has cognitive complexity 75 (threshold 15). Drivers by points: if/else 14 (33 pts), ternaries 4 (17 pts), loops 7 (14 pts), boolean chains 11 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.mergeProjectLaunchRuntimeHistoryEntries (cognitive 75) src/cli/index.ts:1936— index.mergeProjectLaunchRuntimeHistoryEntries has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (51 pts), error handling 5 (15 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 44). Of this number, 70 points are the body's own statements and 5 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.
codex-native-hook.findWrappedCommandPositionIndex (cognitive 74) src/scripts/codex-native-hook.ts:7788— codex-native-hook.findWrappedCommandPositionIndex has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 10 (65 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 58). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandExecutesUninspectedScript (cognitive 73) src/scripts/codex-native-hook.ts:5447— codex-native-hook.commandExecutesUninspectedScript has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (59 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.executeDetachedLaunchStateMachine (cognitive 73) src/cli/index.ts:4857— index.executeDetachedLaunchStateMachine has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 9 (45 pts), if/else 8 (14 pts), error handling 6 (12 pts), boolean chains 2 (nesting depth added 48). 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.
index.runCodex (cognitive 72) src/cli/index.ts:8119— index.runCodex has cognitive complexity 72 (threshold 15). Drivers by points: if/else 51 (125 pts), ternaries 23 (35 pts), error handling 8 (21 pts), boolean chains 20, loops 7 (16 pts) (nesting depth added 108). 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. This shape REPEATS in the file: one other method here (index.runCodex::launchDetachedSession::bootstrapLeader) 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.
codex-hooks.validateCodexHooksDocument (cognitive 70) src/config/codex-hooks.ts:1114— codex-hooks.validateCodexHooksDocument has cognitive complexity 70 (threshold 15). Drivers by points: if/else 20 (50 pts), boolean chains 8, loops 3 (6 pts), ternaries 3 (6 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.
generator.reconcileProjectTrustPayload (cognitive 70) src/config/generator.ts:1199— generator.reconcileProjectTrustPayload has cognitive complexity 70 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 13, loops 7 (11 pts), ternaries 3 (nesting depth added 25). Of this number, 66 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.
team-worker.maybeNotifyLeaderWorkerIdle (cognitive 70) src/scripts/notify-hook/team-worker.ts:541— team-worker.maybeNotifyLeaderWorkerIdle has cognitive complexity 70 (threshold 15). Drivers by points: if/else 27 (34 pts), boolean chains 19, error handling 9 (12 pts), ternaries 3 (5 pts) (nesting depth added 12). 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.
plugin-marketplace.isLivePinnedSnapshot (cognitive 69) src/cli/plugin-marketplace.ts:1503— plugin-marketplace.isLivePinnedSnapshot has cognitive complexity 69 (threshold 15). Drivers by points: if/else 23 (49 pts), boolean chains 11, error handling 5 (8 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
friction.inspectRolloutFile (cognitive 69) src/session-history/friction.ts:281— friction.inspectRolloutFile has cognitive complexity 69 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 11, ternaries 9, loops 1 (nesting depth added 28). Of this number, 68 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.
plugin-marketplace.hasLivePinIntent (cognitive 68) src/cli/plugin-marketplace.ts:1293— plugin-marketplace.hasLivePinIntent has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (48 pts), error handling 5 (11 pts), boolean chains 8, loops 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.
update.executeUpdate (cognitive 68) REDACTED:776— update.executeUpdate has cognitive complexity 68 (threshold 15). Drivers by points: if/else 24 (38 pts), ternaries 13 (19 pts), boolean chains 10, error handling 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.
codex-native-hook.evaluateConductorBashWrite (cognitive 68) src/scripts/codex-native-hook.ts:20192— codex-native-hook.evaluateConductorBashWrite has cognitive complexity 68 (threshold 15). Drivers by points: if/else 34 (43 pts), boolean chains 18, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 12). Of this number, 58 points are the body's own statements and 10 belong to 4 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.cancelModes::loadStates (cognitive 68) src/cli/index.ts:10526— index.cancelModes::loadStates has cognitive complexity 68 (threshold 15). Drivers by points: if/else 13 (34 pts), ternaries 6 (12 pts), boolean chains 11, error handling 2 (6 pts), 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. This shape REPEATS in the file: one other method here (index.cancelModes) 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.
codex-native-pre-post.tokenizeShellCommandWithBoundaries (cognitive 67) src/scripts/codex-native-pre-post.ts:325— codex-native-pre-post.tokenizeShellCommandWithBoundaries has cognitive complexity 67 (threshold 15). Drivers by points: if/else 27 (55 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 28). Of this number, 65 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.
codex-native-hook.buildSessionStartContext (cognitive 67) src/scripts/codex-native-hook.ts:2353— codex-native-hook.buildSessionStartContext has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (42 pts), ternaries 6 (11 pts), boolean chains 9, error handling 2 (4 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.pythonInvocationHasUnsafeRuntimeEnvironment::applyRange (cognitive 67) src/scripts/codex-native-hook.ts:6299— codex-native-hook.pythonInvocationHasUnsafeRuntimeEnvironment::applyRange has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (56 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 43). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-hooks.inspectOwnership (cognitive 66) src/config/codex-hooks.ts:1942— codex-hooks.inspectOwnership has cognitive complexity 66 (threshold 15). Drivers by points: if/else 11 (41 pts), ternaries 4 (12 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 41). Of this number, 63 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.
codex-native-hook.parseConductorTimeInvocation (cognitive 66) src/scripts/codex-native-hook.ts:7475— codex-native-hook.parseConductorTimeInvocation has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (54 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
runtime.terminateTrackedProcessTree (cognitive 65) src/team/runtime.ts:2768— runtime.terminateTrackedProcessTree has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (37 pts), error handling 6 (14 pts), loops 6 (10 pts), boolean chains 4 (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.
codex-native-hook.isPositivelyReadOnlyNodeInlineEval (cognitive 65) src/scripts/codex-native-hook.ts:13726— codex-native-hook.isPositivelyReadOnlyNodeInlineEval has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 14, loops 3, ternaries 1 (3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
team.formatInspectItemLine (cognitive 64) REDACTED:705— team.formatInspectItemLine has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 64. 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.
keyword-detector.collectMarkdownReferenceIndex (cognitive 64) src/hooks/keyword-detector.ts:2256— keyword-detector.collectMarkdownReferenceIndex has cognitive complexity 64 (threshold 15). Drivers by points: if/else 12 (52 pts), boolean chains 6, ternaries 1 (5 pts), loops 1 (nesting depth added 44). 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.
tmux-injection.handleTmuxInjection (cognitive 64) src/scripts/notify-hook/tmux-injection.ts:419— tmux-injection.handleTmuxInjection has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 28, ternaries 12 (18 pts), error handling 4 (5 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (tmux-injection.handleTmuxInjection::scanActiveModeStateDirs) 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.
index.acquireHistoryPersistenceLock (cognitive 63) src/cli/index.ts:1384— index.acquireHistoryPersistenceLock has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (39 pts), ternaries 3 (12 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (nesting depth added 35). Of this number, 48 points are the body's own statements and 15 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.
plugin-marketplace.claimPublicationLock (cognitive 62) src/cli/plugin-marketplace.ts:2690— plugin-marketplace.claimPublicationLock has cognitive complexity 62 (threshold 15). Drivers by points: if/else 11 (32 pts), error handling 8 (23 pts), boolean chains 6, loops 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.
setup.applyNativeHookTransactionArtifact (cognitive 62) src/cli/setup.ts:1587— setup.applyNativeHookTransactionArtifact has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 7 (25 pts), if/else 13 (21 pts), error handling 6 (14 pts), boolean chains 2 (nesting depth added 34). Of this number, 60 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.
generator.hasUnprovenManagedMarkerHooksStateSyntax (cognitive 61) src/config/generator.ts:1803— generator.hasUnprovenManagedMarkerHooksStateSyntax has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 7 (10 pts), boolean chains 8, ternaries 1 (2 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.
plugin-marketplace.registerOmxPluginCacheLivePin (cognitive 61) src/cli/plugin-marketplace.ts:1674— plugin-marketplace.registerOmxPluginCacheLivePin has cognitive complexity 61 (threshold 15). Drivers by points: if/else 24 (32 pts), error handling 8 (14 pts), boolean chains 13, loops 1, ternaries 1 (nesting depth added 14). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tracker.normalizeSubagentTrackingState (cognitive 60) src/subagents/tracker.ts:287— tracker.normalizeSubagentTrackingState has cognitive complexity 60 (threshold 15). Drivers by points: boolean chains 28, ternaries 7 (20 pts), if/else 4 (9 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
team-tmux-guard.sendPaneInput (cognitive 60) src/scripts/notify-hook/team-tmux-guard.ts:388— team-tmux-guard.sendPaneInput has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 8 (17 pts), error handling 6 (10 pts), boolean chains 6, loops 1 (nesting depth added 20). Of this number, 55 points are the body's own statements and 5 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.
codex-native-hook.nestedExecEnvironmentClearBoundary (cognitive 60) src/scripts/codex-native-hook.ts:18709— codex-native-hook.nestedExecEnvironmentClearBoundary has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (48 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 38). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
toml-source.analyzeTomlSource (cognitive 59) src/utils/toml-source.ts:23— toml-source.analyzeTomlSource has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tmux.lexPosixWords (cognitive 59) src/hud/tmux.ts:307— tmux.lexPosixWords has cognitive complexity 59 (threshold 15). Drivers by points: if/else 12 (41 pts), loops 5 (13 pts), boolean chains 5 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.atomicWriteNativeHookTransactionArtifact (cognitive 59) src/cli/setup.ts:1279— setup.atomicWriteNativeHookTransactionArtifact has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 11 (24 pts), error handling 3 (7 pts), boolean chains 3 (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.
setup.refreshNativeAgentConfigs (cognitive 59) src/cli/setup.ts:6176— setup.refreshNativeAgentConfigs has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (40 pts), ternaries 4 (10 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
export.exportSessionHistory (cognitive 59) src/session-history/export.ts:68— export.exportSessionHistory has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (35 pts), ternaries 4 (13 pts), boolean chains 10, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mission.parseMissionArgs (cognitive 59) src/cli/mission.ts:138— mission.parseMissionArgs has cognitive complexity 59 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 9, ternaries 2, loops 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.
tmux-injection.resolvePaneTarget (cognitive 59) src/scripts/notify-hook/tmux-injection.ts:304— tmux-injection.resolvePaneTarget has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 5 (15 pts), boolean chains 9, error handling 4 (7 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.
plugin-marketplace.retireUnpinnedManagedSnapshots (cognitive 58) src/cli/plugin-marketplace.ts:3665— plugin-marketplace.retireUnpinnedManagedSnapshots has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (33 pts), error handling 5 (12 pts), boolean chains 10, loops 3 (nesting depth added 20). Of this number, 57 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.
advisory.readProjectionForGeneration (cognitive 57) src/ralplan/advisory.ts:229— advisory.readProjectionForGeneration has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 17, error handling 6 (8 pts), ternaries 6 (8 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.
codex-native-hook.buildAdditionalContextMessage (cognitive 56) src/scripts/codex-native-hook.ts:2770— codex-native-hook.buildAdditionalContextMessage has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 18 (31 pts), if/else 12 (13 pts), boolean chains 12 (nesting depth added 14). Of this number, 51 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.stateReadTrailingArgsAreSafe (cognitive 56) src/scripts/codex-native-hook.ts:9806— codex-native-hook.stateReadTrailingArgsAreSafe has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (45 pts), boolean chains 10, loops 1 (nesting depth added 27). Of this number, 55 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isStaticallyValidatedOmxStateWriteInvocation (cognitive 56) src/scripts/codex-native-hook.ts:16433— codex-native-hook.isStaticallyValidatedOmxStateWriteInvocation has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 8, error handling 1, loops 1, ternaries 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.persistProjectLaunchRuntimeHistoryArtifacts (cognitive 56) src/cli/index.ts:1620— index.persistProjectLaunchRuntimeHistoryArtifacts has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (39 pts), error handling 3 (9 pts), boolean chains 7, loops 1 (nesting depth added 28). Most of this is not in the body itself: 3 of the 56 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1631, 1661, 1665). 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.
index.selectAuthorizedHookVisibleRunDirState (cognitive 56) src/cli/index.ts:10217— index.selectAuthorizedHookVisibleRunDirState has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (32 pts), error handling 4 (8 pts), loops 4 (7 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
notify-hook.isOmxManagedCwd (cognitive 56) src/scripts/notify-hook.ts:160— notify-hook.isOmxManagedCwd has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 18, error handling 3 (8 pts), loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 19). Of this number, 55 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.
skill-active.syncCanonicalSkillStateForModeUnlocked (cognitive 55) src/state/skill-active.ts:923— skill-active.syncCanonicalSkillStateForModeUnlocked has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 26, if/else 11 (17 pts), ternaries 8 (11 pts), loops 1 (nesting depth added 9). Of this number, 38 points are the body's own statements and 17 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.
setup.installPrompts (cognitive 55) src/cli/setup.ts:6025— setup.installPrompts has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (37 pts), ternaries 3 (9 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.conductorStateWriteTransportIsBoundToActiveSession (cognitive 55) src/scripts/codex-native-hook.ts:20109— codex-native-hook.conductorStateWriteTransportIsBoundToActiveSession has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 16, ternaries 3 (9 pts), loops 2 (3 pts) (nesting depth added 21). Of this number, 51 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
smoke-packed-install.resolvePinnedCodexExecutable (cognitive 55) src/scripts/smoke-packed-install.ts:494— smoke-packed-install.resolvePinnedCodexExecutable has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (50 pts), loops 2 (3 pts), boolean chains 2 (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.
mission.missionCommand (cognitive 54) src/cli/mission.ts:361— mission.missionCommand has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (38 pts), loops 3 (7 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 20). Of this number, 53 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.
codex-native-hook.hasDynamicNestedShellExecution (cognitive 54) src/scripts/codex-native-hook.ts:8238— codex-native-hook.hasDynamicNestedShellExecution has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (44 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorStaticGhApiInvocation (cognitive 54) src/scripts/codex-native-hook.ts:12300— codex-native-hook.parseConductorStaticGhApiInvocation has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 24). Of this number, 45 points are the body's own statements and 9 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
plugin-marketplace.openManagedCacheNamespace (cognitive 53) src/cli/plugin-marketplace.ts:3058— plugin-marketplace.openManagedCacheNamespace has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 6 (13 pts), boolean chains 8, loops 3 (8 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.collectExplicitPrefixNegationIndex (cognitive 53) src/hooks/keyword-detector.ts:1773— keyword-detector.collectExplicitPrefixNegationIndex has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 7 (17 pts), boolean chains 6 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plugin-marketplace.sweepExpiredOmxPluginCacheLivePinIntents (cognitive 52) src/cli/plugin-marketplace.ts:1375— plugin-marketplace.sweepExpiredOmxPluginCacheLivePinIntents has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 10, error handling 2 (4 pts), loops 1 (nesting depth added 18). Of this number, 48 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
doctor.doctor (cognitive 52) REDACTED:742— doctor.doctor has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (36 pts), ternaries 5 (12 pts), loops 2 (3 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.
setup.planNativeHookSetupTransaction (cognitive 52) src/cli/setup.ts:4113— setup.planNativeHookSetupTransaction has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 10, ternaries 8 (10 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.
usage.buildSessionUsageReport (cognitive 52) src/session-history/usage.ts:189— usage.buildSessionUsageReport has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 9, loops 3 (6 pts), ternaries 1 (4 pts) (nesting depth added 27). Of this number, 48 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.collectConductorRsyncStaticTransferPaths (cognitive 52) src/scripts/codex-native-hook.ts:19877— codex-native-hook.collectConductorRsyncStaticTransferPaths has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 8, ternaries 3 (7 pts), loops 1 (nesting depth added 26). Of this number, 51 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.listHookVisibleRunDirStateRefs (cognitive 52) src/cli/index.ts:10035— index.listHookVisibleRunDirStateRefs has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 6 (11 pts), error handling 6 (9 pts), loops 5 (8 pts), boolean chains 6 (nesting depth added 20). Of this number, 37 points are the body's own statements and 15 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.
mode-binding-lease-helper.runPinnedClaimMode (cognitive 52) src/state/mode-binding-lease-helper.ts:249— mode-binding-lease-helper.runPinnedClaimMode has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (42 pts), boolean chains 8, error handling 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.
generator.upsertTuiStatusLine (cognitive 51) src/config/generator.ts:3634— generator.upsertTuiStatusLine has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 6 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.readOmxStateCommandFromSegmentWords (cognitive 51) src/scripts/codex-native-hook.ts:7827— codex-native-hook.readOmxStateCommandFromSegmentWords has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 8 (44 pts), if/else 3 (6 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
mode-binding-lease-helper.readPinnedOwner (cognitive 51) src/state/mode-binding-lease-helper.ts:73— mode-binding-lease-helper.readPinnedOwner has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 17, ternaries 11 (13 pts) (nesting depth added 7). Of this number, 47 points are the body's own statements and 4 belong to 2 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.
tmux.parseTmuxPaneSnapshot (cognitive 50) src/hud/tmux.ts:186— tmux.parseTmuxPaneSnapshot has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 13 (29 pts), if/else 8 (12 pts), boolean chains 8, 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.
runtime.dispatchCriticalInboxInstruction (cognitive 50) src/team/runtime.ts:6392— runtime.dispatchCriticalInboxInstruction has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (33 pts), ternaries 5 (9 pts), boolean chains 8 (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.
tmux-session.restoreStandaloneHudPane (cognitive 49) src/team/tmux-session.ts:3050— tmux-session.restoreStandaloneHudPane has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (39 pts), boolean chains 7, loops 3 (nesting depth added 14). Of this number, 42 points are the body's own statements and 7 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.
auto-nudge.maybeAutoNudge (cognitive 49) src/scripts/notify-hook/auto-nudge.ts:637— auto-nudge.maybeAutoNudge has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 18, ternaries 4 (5 pts), error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
team-worker-stop.maybeNudgeLeaderForAllowedWorkerStop (cognitive 49) src/scripts/notify-hook/team-worker-stop.ts:228— team-worker-stop.maybeNudgeLeaderForAllowedWorkerStop has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 13, ternaries 6 (8 pts), error handling 1 (nesting depth added 8). Of this number, 48 points are the body's own statements and 1 belongs to one function item 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.
codex-native-hook.firstPlanningTmpScriptExecutionTarget::scanCommand (cognitive 49) src/scripts/codex-native-hook.ts:6463— codex-native-hook.firstPlanningTmpScriptExecutionTarget::scanCommand has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 5 (10 pts), ternaries 3 (10 pts), boolean chains 7 (nesting depth added 26). To reduce it, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.decodeShellHeredocAnsiEscape (cognitive 49) src/scripts/codex-native-hook.ts:8632— codex-native-hook.decodeShellHeredocAnsiEscape has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 10 (46 pts), boolean chains 2, if/else 1 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isInsideConductorSubstitutionGrouping (cognitive 49) src/scripts/codex-native-hook.ts:19490— codex-native-hook.isInsideConductorSubstitutionGrouping has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 6 (15 pts), boolean chains 12, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
pinned-atomic-file-darwin-janitor.main (cognitive 49) src/state/pinned-atomic-file-darwin-janitor.ts:186— pinned-atomic-file-darwin-janitor.main has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 8, error handling 2 (5 pts), loops 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.
codex-native-hook.writePendingSessionRegistration (cognitive 48) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1014— codex-native-hook.writePendingSessionRegistration has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 15, error handling 5 (6 pts) (nesting depth added 7). Of this number, 44 points are the body's own statements and 4 belong to 2 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.
codex-hooks.tokenizePosixCommand (cognitive 48) src/config/codex-hooks.ts:1317— codex-hooks.tokenizePosixCommand has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 6, loops 1, ternaries 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.
state-paths.readCanonicalSessionBindingSnapshot (cognitive 48) src/mcp/state-paths.ts:448— state-paths.readCanonicalSessionBindingSnapshot has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (20 pts), ternaries 6 (12 pts), error handling 8 (11 pts), boolean chains 5 (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.
mailbox.sendDirectMessage (cognitive 48) src/team/state/mailbox.ts:208— mailbox.sendDirectMessage has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 11, ternaries 4 (7 pts), loops 1 (2 pts), error handling 1 (nesting depth added 16). Most of this is not in the body itself: 2 of the 48 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 218, 265, 241, …). 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.
tracker.consumeDirectChildReopenContext (cognitive 48) src/subagents/tracker.ts:1629— tracker.consumeDirectChildReopenContext has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 11, loops 1 (2 pts), error handling 1 (nesting depth added 11). Most of this is not in the body itself: 2 of the 48 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1637, 1675, 1665, …). 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.
phase-controller.buildTransitionPath (cognitive 48) src/team/phase-controller.ts:55— phase-controller.buildTransitionPath has cognitive complexity 48 (threshold 15). Drivers by points: if/else 27 (48 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-timeline.parseSessionTimelineArgs (cognitive 48) src/cli/session-timeline.ts:34— session-timeline.parseSessionTimelineArgs has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (29 pts), ternaries 4 (10 pts), boolean chains 6, match/switch 1 (2 pts), loops 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.
index.launchWithHud (cognitive 48) src/cli/index.ts:5634— index.launchWithHud has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (26 pts), error handling 7 (10 pts), ternaries 5 (7 pts), boolean chains 5 (nesting depth added 15). Of this number, 45 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.
notify-fallback-watcher.resolveActiveTeamState (cognitive 48) src/scripts/notify-fallback-watcher.ts:655— notify-fallback-watcher.resolveActiveTeamState has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 8 (16 pts), boolean chains 5, loops 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.
state-paths.resolveWritableStateScope (cognitive 47) src/mcp/state-paths.ts:954— state-paths.resolveWritableStateScope has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (38 pts), boolean chains 7, ternaries 2 (nesting depth added 25). Of this number, 42 points are the body's own statements and 5 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.
skill-active.acquireRootSkillActiveStateLock (cognitive 47) src/state/skill-active.ts:529— skill-active.acquireRootSkillActiveStateLock has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (29 pts), error handling 4 (15 pts), boolean chains 2, loops 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
advisory.reconcileRalplanAdvisoryUnlocked (cognitive 47) src/ralplan/advisory.ts:665— advisory.reconcileRalplanAdvisoryUnlocked has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). Of this number, 45 points are the body's own statements and 2 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.
quality-gates.readQualityGatesConfig (cognitive 47) src/config/quality-gates.ts:167— quality-gates.readQualityGatesConfig has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (9 pts), boolean chains 5, error handling 2 (5 pts), ternaries 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.
runtime.startTeam::runWorkerStartupAttempt (cognitive 47) src/team/runtime.ts:4159— runtime.startTeam::runWorkerStartupAttempt has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 4 (7 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (runtime.startTeam) 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.
doctor.checkExistingNativeHooks (cognitive 47) REDACTED:2817— doctor.checkExistingNativeHooks has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 10 (22 pts), if/else 12 (15 pts), error handling 3 (6 pts), boolean chains 4 (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.
codex-native-pre-post.commandInvokesApplyPatch (cognitive 47) src/scripts/codex-native-pre-post.ts:578— codex-native-pre-post.commandInvokesApplyPatch has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 6 (16 pts), boolean chains 6 (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.
codex-native-hook.conductorMetadataWriteSizesStayBounded (cognitive 47) src/scripts/codex-native-hook.ts:5300— codex-native-hook.conductorMetadataWriteSizesStayBounded has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 3 (6 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 24). Of this number, 40 points are the body's own statements and 7 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectOmxStateCommandOperations::scanNestedSubstitutions (cognitive 47) src/scripts/codex-native-hook.ts:7968— codex-native-hook.collectOmxStateCommandOperations::scanNestedSubstitutions has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (13 pts), ternaries 4 (12 pts), boolean chains 6 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nestedShellHasUnsafeStartup (cognitive 47) src/scripts/codex-native-hook.ts:12992— codex-native-hook.nestedShellHasUnsafeStartup has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 4 (12 pts), boolean chains 10, loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyNestedBashShoptOptions (cognitive 47) src/scripts/codex-native-hook.ts:18462— codex-native-hook.applyNestedBashShoptOptions has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 5, loops 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
team-dispatch.finalizeClaimedDispatchRequest (cognitive 47) src/scripts/notify-hook/team-dispatch.ts:502— team-dispatch.finalizeClaimedDispatchRequest has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 17, ternaries 5 (11 pts) (nesting depth added 13). None of this is in the body itself: all 47 points belong to one function literal inside it that branches (line 519). 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.
session.resumeRecoveryCheckpoint (cognitive 46) src/hooks/session.ts:1715— session.resumeRecoveryCheckpoint has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 16, ternaries 5 (7 pts), error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
session.acquirePointerLock (cognitive 46) src/hooks/session.ts:2409— session.acquirePointerLock has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 7 (22 pts), if/else 7 (16 pts), error handling 4 (7 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scaling.reconcileScaleDownCleanupDebt (cognitive 46) src/team/scaling.ts:1757— scaling.reconcileScaleDownCleanupDebt has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 8, ternaries 3 (4 pts), error handling 3, loops 1 (nesting depth added 11). None of this is in the body itself: all 46 points belong to 2 function literals inside it that branch (lines 1764, 1877). 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.
setup.commitNativeHookTransaction (cognitive 46) src/cli/setup.ts:2099— setup.commitNativeHookTransaction has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 5 (17 pts), if/else 7 (12 pts), error handling 4 (10 pts), loops 4 (6 pts), boolean chains 1 (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.
codebase-map.generateCodebaseMap (cognitive 46) src/hooks/codebase-map.ts:185— codebase-map.generateCodebaseMap has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (7 pts), ternaries 3 (6 pts), boolean chains 4, 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.
codex-native-hook.nestedShellEnablesPosix (cognitive 46) src/scripts/codex-native-hook.ts:18618— codex-native-hook.nestedShellEnablesPosix has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 8, ternaries 2 (6 pts), loops 3 (4 pts) (nesting depth added 19). Of this number, 44 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
mode-binding-lease-helper.acquire (cognitive 46) src/state/mode-binding-lease-helper.ts:431— mode-binding-lease-helper.acquire has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (36 pts), error handling 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-hooks.parseJsonSource::parseValue (cognitive 45) src/config/codex-hooks.ts:895— codex-hooks.parseJsonSource::parseValue has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 2 (4 pts), boolean chains 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.
advisory.readCurrentRalplanAdvisory (cognitive 45) src/ralplan/advisory.ts:334— advisory.readCurrentRalplanAdvisory has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 12, error handling 3 (5 pts) (nesting depth added 17). 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.
advisory.terminalizeRalplanAdvisoryUnlocked (cognitive 45) src/ralplan/advisory.ts:481— advisory.terminalizeRalplanAdvisoryUnlocked has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 11, ternaries 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tmux.registerHudResizeHook (cognitive 45) src/hud/tmux.ts:2124— tmux.registerHudResizeHook has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 11, ternaries 5 (7 pts), error handling 3 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-search.parseSessionSearchArgs (cognitive 45) src/cli/session-search.ts:122— session-search.parseSessionSearchArgs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 2, loops 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.
smoke-packed-install.smokePackedHookTrustLifecycle (cognitive 45) src/scripts/smoke-packed-install.ts:5026— smoke-packed-install.smokePackedHookTrustLifecycle has cognitive complexity 45 (threshold 15). Drivers by points: if/else 29 (35 pts), boolean chains 9, error handling 1 (nesting depth added 6). Of this number, 44 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
state-root.resolveVerifiedDetachedTeamContext (cognitive 44) src/team/state-root.ts:90— state-root.resolveVerifiedDetachedTeamContext has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 16, ternaries 2, loops 1 (nesting depth added 7). Of this number, 43 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.
autoresearch-goal.autoresearchGoalCommand (cognitive 44) src/cli/autoresearch-goal.ts:83— autoresearch-goal.autoresearchGoalCommand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 6, ternaries 1 (3 pts), error handling 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.
codex-native-hook.expandShellPositionalParameters (cognitive 44) src/scripts/codex-native-hook.ts:8358— codex-native-hook.expandShellPositionalParameters has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 7, loops 3 (7 pts), ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedDeepInterviewBashWrite (cognitive 44) src/scripts/codex-native-hook.ts:10340— codex-native-hook.isAllowedDeepInterviewBashWrite has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 15, ternaries 4 (5 pts), error handling 1 (nesting depth added 2). Of this number, 34 points are the body's own statements and 10 belong to 3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.joinConductorShellStates (cognitive 44) src/scripts/codex-native-hook.ts:16863— codex-native-hook.joinConductorShellStates has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 21, if/else 8 (14 pts), loops 5, ternaries 2 (4 pts) (nesting depth added 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorPathMayResolveRepositoryExecutable (cognitive 44) src/scripts/codex-native-hook.ts:17825— codex-native-hook.conductorPathMayResolveRepositoryExecutable has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (29 pts), error handling 4 (9 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
worktree.replaySubmoduleRecovery (cognitive 43) src/team/worktree.ts:595— worktree.replaySubmoduleRecovery has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 5, error handling 2 (5 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 21). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generator.collectManagedHookTrustStateSourceRepresentations (cognitive 43) src/config/generator.ts:2305— generator.collectManagedHookTrustStateSourceRepresentations has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 7 (9 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 17). Of this number, 31 points are the body's own statements and 12 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.
tmux.containsPowerShellHudOwnerReferenceOutsideQuotes (cognitive 43) src/hud/tmux.ts:438— tmux.containsPowerShellHudOwnerReferenceOutsideQuotes has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 5, 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.
query.queryWiki (cognitive 43) src/wiki/query.ts:79— query.queryWiki has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 4 (8 pts), boolean chains 4 (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.
worker-provenance.resolveAuthoritativeTeamWorkerContext (cognitive 43) src/team/worker-provenance.ts:96— worker-provenance.resolveAuthoritativeTeamWorkerContext has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 10, loops 2, error handling 1, ternaries 1 (nesting depth added 9). Of this number, 40 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.
question.parseQuestionArgs (cognitive 43) src/cli/question.ts:97— question.parseQuestionArgs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 1, loops 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.
search.extractSearchableTexts (cognitive 43) src/session-history/search.ts:219— search.extractSearchableTexts has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 5, ternaries 2 (5 pts) (nesting depth added 19). Of this number, 39 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.
codex-native-hook.hasExactConductorOrchestrationOptionSchema (cognitive 43) src/scripts/codex-native-hook.ts:16495— codex-native-hook.hasExactConductorOrchestrationOptionSchema has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 16, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
native-assets.inspectManagedNativeBinary (cognitive 42) src/cli/native-assets.ts:559— native-assets.inspectManagedNativeBinary has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 6 (10 pts), error handling 7 (8 pts), boolean chains 4 (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.
reply-listener.pollDiscordOnce (cognitive 42) src/notifications/reply-listener.ts:548— reply-listener.pollDiscordOnce has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 4 (8 pts), error handling 3 (7 pts), boolean chains 3, 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.
artifacts.validateUltragoalSteeringProposal (cognitive 42) src/ultragoal/artifacts.ts:1311— artifacts.validateUltragoalSteeringProposal has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 9, ternaries 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 41 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.
codex-native-hook.isPositivelyClassifiedFindCommand (cognitive 42) src/scripts/codex-native-hook.ts:12193— codex-native-hook.isPositivelyClassifiedFindCommand has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 7, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-hooks.removalProof (cognitive 41) src/config/codex-hooks.ts:2192— codex-hooks.removalProof has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 7 (11 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 21). Of this number, 40 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.
state-paths.discoverSessionAuthorityBaseStateDir (cognitive 41) src/mcp/state-paths.ts:315— state-paths.discoverSessionAuthorityBaseStateDir has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 3 (13 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
dispatch-recovery.reconcileRuntimeFinalizations (cognitive 41) src/team/state/dispatch-recovery.ts:69— dispatch-recovery.reconcileRuntimeFinalizations has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 7, ternaries 2 (7 pts), loops 1 (2 pts), error handling 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.
hotswap.runAuthHotswap (cognitive 41) src/auth/hotswap.ts:265— hotswap.runAuthHotswap has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 6, error handling 4 (5 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dispatcher.dispatchHookEvent (cognitive 41) src/hooks/extensibility/dispatcher.ts:347— dispatcher.dispatchHookEvent has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 14, error handling 1 (2 pts), ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
runtime.assignTask (cognitive 41) src/team/runtime.ts:4893— runtime.assignTask has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 8, ternaries 4 (5 pts), error handling 2 (3 pts), loops 1 (nesting depth added 10). None of this is in the body itself: all 41 points belong to one function literal inside it that branches (line 4900). 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.
keyword-detector.directCandidateIndexes::addBlock (cognitive 41) src/hooks/keyword-detector.ts:2849— keyword-detector.directCandidateIndexes::addBlock has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 7, loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (keyword-detector.directCandidateIndexes) 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.
codex-native-hook.extractDeepInterviewCommandWriteTargets (cognitive 41) src/scripts/codex-native-hook.ts:5712— codex-native-hook.extractDeepInterviewCommandWriteTargets has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 7 (10 pts), boolean chains 4 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.splitShellCommandSegments (cognitive 41) src/scripts/codex-native-hook.ts:8436— codex-native-hook.splitShellCommandSegments has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 5, loops 1, ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseShellHeredocDelimiter (cognitive 41) src/scripts/codex-native-hook.ts:8649— codex-native-hook.parseShellHeredocDelimiter has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 14, loops 2, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedRgCommand (cognitive 41) src/scripts/codex-native-hook.ts:12558— codex-native-hook.isPositivelyClassifiedRgCommand has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 8, ternaries 1 (3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
base.updateModeStateUnderCanonicalLock (cognitive 40) src/modes/base.ts:427— base.updateModeStateUnderCanonicalLock has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 6 (12 pts), boolean chains 7 (nesting depth added 12). Of this number, 39 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
triage-heuristic.triagePrompt (cognitive 40) src/hooks/triage-heuristic.ts:236— triage-heuristic.triagePrompt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 14, loops 5 (6 pts), ternaries 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.
setup.decideWindowsNativeHookShimReference (cognitive 40) src/cli/setup.ts:1180— setup.decideWindowsNativeHookShimReference has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 4 (10 pts), boolean chains 2, ternaries 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.
performance-goal.performanceGoalCommand (cognitive 40) src/cli/performance-goal.ts:99— performance-goal.performanceGoalCommand has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 3, 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.
codex-native-hook.terminalizeExactWorkflowSessionForHookCancel (cognitive 40) src/scripts/codex-native-hook.ts:4070— codex-native-hook.terminalizeExactWorkflowSessionForHookCancel has cognitive complexity 40 (threshold 15). Drivers by points: error handling 10 (13 pts), if/else 10 (11 pts), boolean chains 8, loops 3 (5 pts), ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.curlUrlGlobCaptureValues (cognitive 40) src/scripts/codex-native-hook.ts:14578— codex-native-hook.curlUrlGlobCaptureValues has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 9, ternaries 2 (3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorFiniteDestinationLeaves (cognitive 40) src/scripts/codex-native-hook.ts:15598— codex-native-hook.collectConductorFiniteDestinationLeaves has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 8 (12 pts), boolean chains 8, error handling 3 (nesting depth added 7). Of this number, 23 points are the body's own statements and 17 belong to 3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.notifyLifecycle (cognitive 40) src/notifications/index.ts:206— index.notifyLifecycle has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 16, if/else 12 (15 pts), ternaries 3 (4 pts), error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.prepareRuntimeCodexHomeForProjectLaunch (cognitive 40) src/cli/index.ts:2142— index.prepareRuntimeCodexHomeForProjectLaunch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime-cli.main (cognitive 40) src/team/runtime-cli.ts:296— runtime-cli.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (26 pts), error handling 6 (9 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 11). Of this number, 30 points are the body's own statements and 10 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.
openclaw.observeOpenClaw (cognitive 39) src/adapt/openclaw.ts:53— openclaw.observeOpenClaw has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 4 (10 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-hooks.decodedPosixCommandWords (cognitive 39) src/config/codex-hooks.ts:1706— codex-hooks.decodedPosixCommandWords has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 5, loops 1 (nesting depth added 14). Of this number, 38 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
state.readDispatchRequests (cognitive 39) src/team/state.ts:2126— state.readDispatchRequests has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 6 (12 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 10). Of this number, 30 points are the body's own statements and 9 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.
generator.analyzeOmxSeededBehavioralDefaults (cognitive 39) src/config/generator.ts:645— generator.analyzeOmxSeededBehavioralDefaults has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 13, if/else 9 (11 pts), loops 1 (nesting depth added 9). Of this number, 22 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.
state.runGit (cognitive 39) REDACTED:528— state.runGit has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (37 pts), error handling 1 (2 pts) (nesting depth added 27). 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.
runtime.terminateExactPaneProcessTree (cognitive 39) src/team/runtime.ts:2981— runtime.terminateExactPaneProcessTree has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 8, loops 2 (nesting depth added 11). Of this number, 37 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.
plugin-marketplace.discoverOmxPluginCacheDirs (cognitive 39) src/cli/plugin-marketplace.ts:3244— plugin-marketplace.discoverOmxPluginCacheDirs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, error handling 3 (4 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
uninstall.atomicReplaceFile (cognitive 39) src/cli/uninstall.ts:1150— uninstall.atomicReplaceFile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 5 (11 pts), boolean chains 8, error handling 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
state.stateCommand (cognitive 39) src/cli/state.ts:67— state.stateCommand has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 2, error handling 1 (2 pts), loops 1, 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.
codex-native-hook.commandConfiguresNodeOptions (cognitive 39) src/scripts/codex-native-hook.ts:12670— codex-native-hook.commandConfiguresNodeOptions has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 8, loops 4 (7 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorSafeReferenceControlTargets (cognitive 39) src/scripts/codex-native-hook.ts:14203— codex-native-hook.collectConductorSafeReferenceControlTargets has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 9, error handling 1 (2 pts), loops 2, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
suite.validateRunRecords (cognitive 39) src/evals/astra-defaults/suite.ts:80— suite.validateRunRecords has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 9, 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.
RuntimeEngine::load (cognitive 39) crates/omx-runtime-core/src/engine.rs:385— RuntimeEngine::load has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (7 pts), match/switch 4 (6 pts), boolean chains 2 (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.
codex-hooks.tokenizePowerShellCommand (cognitive 38) src/config/codex-hooks.ts:1524— codex-hooks.tokenizePowerShellCommand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 4, loops 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.
policy.validateNativeReleaseManifest (cognitive 38) src/native-assets/policy.ts:131— policy.validateNativeReleaseManifest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 12, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tasks.transitionTaskStatus (cognitive 38) src/team/state/tasks.ts:195— tasks.transitionTaskStatus has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14, ternaries 10 (13 pts), boolean chains 9, error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 6 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 205). 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.
tmux-hook-engine.evaluateInjectionGuards (cognitive 38) src/scripts/tmux-hook-engine.ts:101— tmux-hook-engine.evaluateInjectionGuards has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 9 (11 pts), boolean chains 10 (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.
team.resolveApprovedTeamFollowupContext (cognitive 38) REDACTED:166— team.resolveApprovedTeamFollowupContext has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (18 pts), if/else 11 (17 pts), boolean chains 3 (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.
question.questionCommand (cognitive 38) src/cli/question.ts:244— question.questionCommand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 4 (8 pts), error handling 4 (6 pts), boolean chains 5 (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.
codex-native-pre-post.commandInvokesOmxQuestion (cognitive 38) src/scripts/codex-native-pre-post.ts:1177— codex-native-pre-post.commandInvokesOmxQuestion has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (20 pts), boolean chains 10, loops 4 (8 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.
codex-native-hook.extractEnvSplitStringCommand (cognitive 38) src/scripts/codex-native-hook.ts:6967— codex-native-hook.extractEnvSplitStringCommand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 3 (9 pts), boolean chains 6, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.splitStateScanSegments (cognitive 38) src/scripts/codex-native-hook.ts:7874— codex-native-hook.splitStateScanSegments has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 14). Of this number, 37 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isStructuredUltragoalSteeringShellCommand (cognitive 38) src/scripts/codex-native-hook.ts:8196— codex-native-hook.isStructuredUltragoalSteeringShellCommand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.tokenizeConductorShellWords (cognitive 38) src/scripts/codex-native-hook.ts:16022— codex-native-hook.tokenizeConductorShellWords has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 13, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
session.writeSessionEnd (cognitive 37) src/hooks/session.ts:3808— session.writeSessionEnd has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 11 (12 pts), boolean chains 7, error handling 5 (6 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.
session-search.parseSessionFrictionArgs (cognitive 37) src/cli/session-search.ts:191— session-search.parseSessionFrictionArgs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 2, 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.
codex-native-hook.downloaderHasUnsafeTlsKeyLogEnvironment (cognitive 37) src/scripts/codex-native-hook.ts:14458— codex-native-hook.downloaderHasUnsafeTlsKeyLogEnvironment has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 4 (14 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorResolvedPackageCliCandidateIsTrusted (cognitive 37) src/scripts/codex-native-hook.ts:17994— codex-native-hook.conductorResolvedPackageCliCandidateIsTrusted has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 4 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectProcessSubstitutionExpansionPrefix (cognitive 37) src/scripts/codex-native-hook.ts:19444— codex-native-hook.collectProcessSubstitutionExpansionPrefix has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 11, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
smoke-packed-install.assertInstalledPluginSurface (cognitive 37) src/scripts/smoke-packed-install.ts:1665— smoke-packed-install.assertInstalledPluginSurface has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 6 (9 pts), boolean chains 7 (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.
generator.extractCustomizedTuiSectionsFromOmxBlocks (cognitive 36) src/config/generator.ts:3573— generator.extractCustomizedTuiSectionsFromOmxBlocks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 3 (6 pts), boolean chains 3 (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.
artifacts.validateQualityGate (cognitive 36) src/ultragoal/artifacts.ts:1694— artifacts.validateQualityGate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 12, error handling 1 (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.
sparkshell.parseSparkShellFallbackInvocation (cognitive 36) REDACTED:305— sparkshell.parseSparkShellFallbackInvocation has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 14). Of this number, 35 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.
keyword-detector.directCandidateIndexes (cognitive 36) src/hooks/keyword-detector.ts:2790— keyword-detector.directCandidateIndexes has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 18, loops 8 (12 pts), ternaries 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (keyword-detector.directCandidateIndexes::addBlock) 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.
codex-native-pre-post.tokenizeShellCommand (cognitive 36) src/scripts/codex-native-pre-post.ts:261— codex-native-pre-post.tokenizeShellCommand has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 2, loops 1, 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.
codex-native-pre-post.findGitCommandTokenIndex (cognitive 36) src/scripts/codex-native-pre-post.ts:519— codex-native-pre-post.findGitCommandTokenIndex has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 5 (11 pts), boolean chains 5 (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.
worktree.ensureWorktree (cognitive 35) src/team/worktree.ts:382— worktree.ensureWorktree has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 8, ternaries 3 (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.
worktree.rollbackProvisionedWorktrees (cognitive 35) src/team/worktree.ts:724— worktree.rollbackProvisionedWorktrees has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 3 (8 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 16). Of this number, 34 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.
generator.inventoryProjectTrustPayload (cognitive 35) src/config/generator.ts:1081— generator.inventoryProjectTrustPayload has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 8, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.deliverPendingMailboxMessages (cognitive 35) src/team/runtime.ts:6911— runtime.deliverPendingMailboxMessages has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 7 (10 pts), boolean chains 5 (nesting depth added 13). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 6927, 6959). 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.
plugin-marketplace.removeChild (cognitive 35) src/cli/plugin-marketplace.ts:525— plugin-marketplace.removeChild has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 12). Of this number, 28 points are the body's own statements and 7 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.
plugin-marketplace.getPinnedLauncherIncompatibilityReason (cognitive 35) src/cli/plugin-marketplace.ts:3576— plugin-marketplace.getPinnedLauncherIncompatibilityReason has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 8, error handling 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 34 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.
managed-tmux.resolveManagedSessionContext (cognitive 35) src/scripts/notify-hook/managed-tmux.ts:260— managed-tmux.resolveManagedSessionContext has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 12, ternaries 4 (6 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
auto-nudge.resolveNudgePaneTarget (cognitive 35) src/scripts/notify-hook/auto-nudge.ts:597— auto-nudge.resolveNudgePaneTarget has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (20 pts), ternaries 4 (6 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
team-worker.maybeNotifyLeaderAllWorkersIdle (cognitive 35) src/scripts/notify-hook/team-worker.ts:351— team-worker.maybeNotifyLeaderAllWorkersIdle has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 13, ternaries 4 (5 pts), error handling 2 (nesting depth added 3). Of this number, 33 points are the body's own statements and 2 belong to 2 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.
codex-native-hook.pythonCommandHasOnlySafeOptions (cognitive 35) src/scripts/codex-native-hook.ts:6241— codex-native-hook.pythonCommandHasOnlySafeOptions has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.maskShellNonCommandExpansionsForConductorScan (cognitive 35) src/scripts/codex-native-hook.ts:8933— codex-native-hook.maskShellNonCommandExpansionsForConductorScan has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (13 pts), boolean chains 7, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
report.renderReport (cognitive 35) src/evals/astra-defaults/report.ts:125— report.renderReport has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 9 (12 pts), ternaries 4 (8 pts), boolean chains 2 (nesting depth added 10). Of this number, 34 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.
hasLivePinForDelegate (cognitive 35) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1214— hasLivePinForDelegate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, error handling 4 (6 pts), ternaries 1 (2 pts), loops 1, other 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.
tracker.repairPersistedRootIdentityInState (cognitive 34) src/subagents/tracker.ts:1465— tracker.repairPersistedRootIdentityInState has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderer.launchQuestionRenderer (cognitive 34) src/question/renderer.ts:850— renderer.launchQuestionRenderer has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 10 (13 pts), boolean chains 7 (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.
tmux-session.waitForWorkerReadyDetailedAsync (cognitive 34) src/team/tmux-session.ts:3653— tmux-session.waitForWorkerReadyDetailedAsync has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 1, loops 1 (nesting depth added 9). Of this number, 20 points are the body's own statements and 14 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.
role-router.routeTaskToRole (cognitive 34) src/team/role-router.ts:187— role-router.routeTaskToRole has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 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.
wiki-server.handleWikiToolCallWithOptions (cognitive 34) src/mcp/wiki-server.ts:170— wiki-server.handleWikiToolCallWithOptions has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 8, if/else 4 (8 pts), error handling 1, match/switch 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.
doctor.repairStateProjections (cognitive 34) REDACTED:671— doctor.repairStateProjections has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 4 (9 pts), error handling 3 (6 pts), loops 3 (4 pts), boolean chains 3 (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.
setup.assertManagedDestination (cognitive 34) src/cli/setup.ts:2351— setup.assertManagedDestination has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (4 pts), error handling 1 (3 pts), boolean chains 2, ternaries 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.
setup.findRootTomlKeyRange (cognitive 34) src/cli/setup.ts:3664— setup.findRootTomlKeyRange has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 2 (9 pts), boolean chains 4, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
team.parseTeamApiArgs (cognitive 34) REDACTED:521— team.parseTeamApiArgs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 2 (8 pts), error handling 2 (6 pts), boolean chains 3, loops 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.
keyword-detector.collectQuoteRanges (cognitive 34) src/hooks/keyword-detector.ts:1539— keyword-detector.collectQuoteRanges has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.recoverStaleDeadStopTranscriptSession (cognitive 34) src/scripts/codex-native-hook.ts:4493— codex-native-hook.recoverStaleDeadStopTranscriptSession has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 8, error handling 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractPackageManagerExecCommand (cognitive 34) src/scripts/codex-native-hook.ts:6998— codex-native-hook.extractPackageManagerExecCommand has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 9, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasUnsafeConductorArithmeticCommand (cognitive 34) src/scripts/codex-native-hook.ts:8781— codex-native-hook.hasUnsafeConductorArithmeticCommand has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 8, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyNestedShellEnvironment (cognitive 34) src/scripts/codex-native-hook.ts:18572— codex-native-hook.applyNestedShellEnvironment has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 3 (9 pts), boolean chains 5, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.main (cognitive 34) src/cli/index.ts:5072— index.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 3 (7 pts), boolean chains 5, error handling 2 (3 pts), match/switch 1 (nesting depth added 10). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.showStatus (cognitive 34) src/cli/index.ts:5423— index.showStatus has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, error handling 3 (5 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 11). Of this number, 27 points are the body's own statements and 7 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.
index.runCodex::launchDetachedSession::bootstrapLeader (cognitive 34) src/cli/index.ts:8418— index.runCodex::launchDetachedSession::bootstrapLeader has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 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. This shape REPEATS in the file: one other method here (index.runCodex) 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.
artifacts.readApprovedExecutionLaunchHintOutcome (cognitive 33) src/planning/artifacts.ts:699— artifacts.readApprovedExecutionLaunchHintOutcome has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 5 (9 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-hooks.tokenizeWindowsDirectCommand (cognitive 33) src/config/codex-hooks.ts:1405— codex-hooks.tokenizeWindowsDirectCommand has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 4, loops 2 (4 pts), ternaries 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.
prompt-session-provenance.evaluateResolvedPromptTurn (cognitive 33) src/hooks/prompt-session-provenance.ts:209— prompt-session-provenance.evaluateResolvedPromptTurn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 7, ternaries 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generator.migrateManagedCodexHookTrustStateCoordinates (cognitive 33) src/config/generator.ts:2520— generator.migrateManagedCodexHookTrustStateCoordinates has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 6, loops 3, ternaries 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.
documented-leader-preflight.darwinPinned (cognitive 33) src/ralplan/documented-leader-preflight.ts:96— documented-leader-preflight.darwinPinned has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 10, ternaries 4 (5 pts), error handling 1 (2 pts), loops 2 (nesting depth added 4). None of this is in the body itself: all 33 points belong to 7 function literals inside it that branch (lines 128, 115, 104, …). 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.
session-status.readRelevantSkillState (cognitive 33) src/notifications/session-status.ts:84— session-status.readRelevantSkillState has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 12, if/else 3 (6 pts), loops 1 (nesting depth added 10). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quality-gates.validateAllQualityGates (cognitive 33) src/config/quality-gates.ts:244— quality-gates.validateAllQualityGates has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
leader-activity.tryReadGitValue (cognitive 33) src/team/leader-activity.ts:63— leader-activity.tryReadGitValue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 2 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
team.parseTeamArgs (cognitive 33) REDACTED:845— team.parseTeamArgs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 9 (12 pts), boolean chains 9 (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.
codex-native-hook.sliceShellWordsTailPreservingQuoting (cognitive 33) src/scripts/codex-native-hook.ts:7221— codex-native-hook.sliceShellWordsTailPreservingQuoting has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedUniqCommand (cognitive 33) src/scripts/codex-native-hook.ts:12529— codex-native-hook.isPositivelyClassifiedUniqCommand has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 7, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedSedCommand (cognitive 33) src/scripts/codex-native-hook.ts:12632— codex-native-hook.isPositivelyClassifiedSedCommand has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 8, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandMayPopulateSensitiveRuntimeEnvironment (cognitive 33) src/scripts/codex-native-hook.ts:12867— codex-native-hook.commandMayPopulateSensitiveRuntimeEnvironment has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). Of this number, 31 points are the body's own statements and 2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorBoundedDdTargets (cognitive 33) src/scripts/codex-native-hook.ts:15656— codex-native-hook.collectConductorBoundedDdTargets has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, loops 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
native-assets.validateDescendant (cognitive 32) src/cli/native-assets.ts:425— native-assets.validateDescendant has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 6, error handling 3 (6 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mailbox.readLegacyMailboxMessageIds (cognitive 32) src/team/state/mailbox.ts:24— mailbox.readLegacyMailboxMessageIds has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (7 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 12). Of this number, 31 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.
dispatch.normalizeDispatchRequest (cognitive 32) src/team/state/dispatch.ts:95— dispatch.normalizeDispatchRequest has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 16, boolean chains 13, if/else 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.
state.commitTeamMembershipTaskTransaction (cognitive 32) src/team/state.ts:1017— state.commitTeamMembershipTaskTransaction has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (9 pts), error handling 3 (6 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
contract.validateAndNormalizeRalphState (cognitive 32) src/ralph/contract.ts:78— contract.validateAndNormalizeRalphState has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 5 (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.
tmux.createHudWatchPane (cognitive 32) src/hud/tmux.ts:1801— tmux.createHudWatchPane has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 7, boolean chains 6, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
state.validateAnswerAgainstQuestion (cognitive 32) src/question/state.ts:357— state.validateAnswerAgainstQuestion has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 5, 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.
bootstrap.autoStartStdioMcpServer (cognitive 32) src/mcp/bootstrap.ts:495— bootstrap.autoStartStdioMcpServer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 6 (8 pts), boolean chains 2, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 6 function items inside it that branch (runDuplicateSiblingWatchdog, stopDuplicateSiblingWatchdog, logLifecycle, …). 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.
model-contract.tokenizeWorkerLaunchArgs (cognitive 32) REDACTED:198— model-contract.tokenizeWorkerLaunchArgs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render.renderTeamWorkers (cognitive 32) src/hud/render.ts:214— render.renderTeamWorkers has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, ternaries 7 (8 pts), loops 2 (5 pts) (nesting depth added 8). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 215, 252, 253, …). 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.
agents-init.agentsInit (cognitive 32) src/cli/agents-init.ts:279— agents-init.agentsInit has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (21 pts), boolean chains 5, if/else 4 (5 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
doctor.checkSparkRouting (cognitive 32) REDACTED:4030— doctor.checkSparkRouting has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 3 (9 pts), boolean chains 2, 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.
ralplan.parseRoleIntentWriteArgs (cognitive 32) src/cli/ralplan.ts:323— ralplan.parseRoleIntentWriteArgs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 2, ternaries 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.classifyKeywordInput (cognitive 32) src/hooks/keyword-detector.ts:3474— keyword-detector.classifyKeywordInput has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 6 (10 pts), boolean chains 3, loops 3 (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.
codex-native-hook.resolveTeamWorkerStopDecision (cognitive 32) src/scripts/codex-native-hook.ts:2963— codex-native-hook.resolveTeamWorkerStopDecision has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 3 (4 pts), boolean chains 3, ternaries 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.maskQuotedRedirectMetacharsForCommandScan (cognitive 32) src/scripts/codex-native-hook.ts:5064— codex-native-hook.maskQuotedRedirectMetacharsForCommandScan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 6, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolveStateWriteInputFileCwd (cognitive 32) src/scripts/codex-native-hook.ts:5917— codex-native-hook.resolveStateWriteInputFileCwd has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 9, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findCaseArmCommandIndex (cognitive 32) src/scripts/codex-native-hook.ts:7640— codex-native-hook.findCaseArmCommandIndex has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (5 pts), boolean chains 3 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedOmxSessionLockInspectCommand (cognitive 32) src/scripts/codex-native-hook.ts:10059— codex-native-hook.isAllowedOmxSessionLockInspectCommand has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.gitConfigTextHasExecutableStatusSurface (cognitive 32) src/scripts/codex-native-hook.ts:12015— codex-native-hook.gitConfigTextHasExecutableStatusSurface has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorCommandPrefixPreservesInheritedResolution (cognitive 32) src/scripts/codex-native-hook.ts:17702— codex-native-hook.conductorCommandPrefixPreservesInheritedResolution has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 3 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findConductorIsolatedFunctionDefinitionRegion (cognitive 32) src/scripts/codex-native-hook.ts:19266— codex-native-hook.findConductorIsolatedFunctionDefinitionRegion has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, ternaries 2 (5 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectLexicalProcessSubstitutions (cognitive 32) src/scripts/codex-native-hook.ts:19549— codex-native-hook.collectLexicalProcessSubstitutions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 7, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
artifacts.selectLaunchHintMatch (cognitive 31) src/planning/artifacts.ts:462— artifacts.selectLaunchHintMatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 10). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 503, 471, 488). 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.
codex-hooks.pruneRemovedManagedEventProperties (cognitive 31) src/config/codex-hooks.ts:2382— codex-hooks.pruneRemovedManagedEventProperties has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 3 (10 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-hooks.planManagedCodexHooksMerge (cognitive 31) src/config/codex-hooks.ts:2713— codex-hooks.planManagedCodexHooksMerge has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, loops 3 (4 pts), error handling 2, ternaries 1 (2 pts) (nesting depth added 6). Of this number, 28 points are the body's own statements and 3 belong to 3 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.
operations.listStateStatuses (cognitive 31) src/state/operations.ts:619— operations.listStateStatuses has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 7, error handling 1 (3 pts), loops 2 (3 pts), ternaries 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.
lifecycle.feedProjectMemory (cognitive 31) src/wiki/lifecycle.ts:193— lifecycle.feedProjectMemory has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (7 pts), boolean chains 6, loops 3 (5 pts), error handling 1 (nesting depth added 11). Of this number, 30 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.
session-export.parseSessionExportArgs (cognitive 31) src/cli/session-export.ts:27— session-export.parseSessionExportArgs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.commandHasDestructiveGitSubcommand (cognitive 31) src/scripts/codex-native-hook.ts:5359— codex-native-hook.commandHasDestructiveGitSubcommand has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 2 (3 pts), boolean chains 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findShellFunctionBodyEnd (cognitive 31) src/scripts/codex-native-hook.ts:6004— codex-native-hook.findShellFunctionBodyEnd has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 6, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorCoprocCompoundBodies (cognitive 31) src/scripts/codex-native-hook.ts:12949— codex-native-hook.collectConductorCoprocCompoundBodies has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (9 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorMutationOptionValueWordCount (cognitive 31) src/scripts/codex-native-hook.ts:15539— codex-native-hook.conductorMutationOptionValueWordCount has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 8, boolean chains 7 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorBoundedTruncateTargets (cognitive 31) src/scripts/codex-native-hook.ts:15688— codex-native-hook.collectConductorBoundedTruncateTargets has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 10, loops 1, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorPackageCliHasTrustedNodeInterpreter (cognitive 31) src/scripts/codex-native-hook.ts:17956— codex-native-hook.conductorPackageCliHasTrustedNodeInterpreter has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractConductorEditorWriteTargets (cognitive 31) src/scripts/codex-native-hook.ts:20485— codex-native-hook.extractConductorEditorWriteTargets has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.materializeProjectLaunchRuntimeHistoryEntries (cognitive 31) src/cli/index.ts:1758— index.materializeProjectLaunchRuntimeHistoryEntries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 3 (9 pts), boolean chains 2, error handling 1 (2 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.
index.postLaunch (cognitive 31) src/cli/index.ts:9250— index.postLaunch has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (13 pts), error handling 12, if/else 5, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
notify-fallback-delivery.compactNotifyFallbackDeliveries (cognitive 31) src/scripts/notify-fallback-delivery.ts:393— notify-fallback-delivery.compactNotifyFallbackDeliveries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (7 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). Of this number, 30 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.
codex-hooks.hasExecutableForeignHandlerInUnknownEvent (cognitive 30) src/config/codex-hooks.ts:2630— codex-hooks.hasExecutableForeignHandlerInUnknownEvent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
state.isTeamManifestV2 (cognitive 30) src/team/state.ts:787— state.isTeamManifestV2 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19, boolean chains 11. 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.
generator.advancePastInlineTomlValue (cognitive 30) src/config/generator.ts:1610— generator.advancePastInlineTomlValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, 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.
temp-contract.parseNotifyTempContractFromArgs (cognitive 30) src/notifications/temp-contract.ts:34— temp-contract.parseNotifyTempContractFromArgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 4, 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.
reply-listener.pollTelegramOnce (cognitive 30) src/notifications/reply-listener.ts:712— reply-listener.pollTelegramOnce has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 3 (5 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 9). Of this number, 25 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.
tmux-session.waitForWorkerReady (cognitive 30) src/team/tmux-session.ts:3544— tmux-session.waitForWorkerReady has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 1, loops 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 13 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.
native-hook-claim-journal.recoverNativeHookClaimJournal (cognitive 30) src/cli/native-hook-claim-journal.ts:247— native-hook-claim-journal.recoverNativeHookClaimJournal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 8, 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.
doctor.checkPluginScopedNativeHooks (cognitive 30) REDACTED:2597— doctor.checkPluginScopedNativeHooks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), ternaries 2, boolean chains 1, 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.
team.renderTeamPaneStatus (cognitive 30) REDACTED:787— team.renderTeamPaneStatus has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 7 (8 pts), boolean chains 4, loops 3 (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.
continuation.parseImagegenContinuationArgs (cognitive 30) src/imagegen/continuation.ts:145— continuation.parseImagegenContinuationArgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 5, loops 1 (nesting depth added 2). Of this number, 28 points are the body's own statements and 2 belong to one function item 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.
keyword-detector.collectPostposedExplicitNegationIndex (cognitive 30) src/hooks/keyword-detector.ts:2050— keyword-detector.collectPostposedExplicitNegationIndex has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 6 (12 pts), boolean chains 3 (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.
keyword-detector.markdownDocumentationRange (cognitive 30) src/hooks/keyword-detector.ts:2369— keyword-detector.markdownDocumentationRange has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.collectImplicitDocumentationLineRanges (cognitive 30) src/hooks/keyword-detector.ts:2737— keyword-detector.collectImplicitDocumentationLineRanges has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (16 pts), ternaries 2 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.collectImplicitClauseIndex (cognitive 30) src/hooks/keyword-detector.ts:3088— keyword-detector.collectImplicitClauseIndex has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.isPositivelyModeledPythonSource (cognitive 30) src/scripts/codex-native-hook.ts:13820— codex-native-hook.isPositivelyModeledPythonSource has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (6 pts), boolean chains 2, ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.stripShellCommentsForConductorScan (cognitive 30) src/scripts/codex-native-hook.ts:19316— codex-native-hook.stripShellCommentsForConductorScan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 10, loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectLexicalCommandSubstitutions (cognitive 30) src/scripts/codex-native-hook.ts:19587— codex-native-hook.collectLexicalCommandSubstitutions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 8, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.runCodexNativeHookCli (cognitive 30) src/scripts/codex-native-hook.ts:23189— codex-native-hook.runCodexNativeHookCli has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
notify-fallback-delivery.terminalGraph (cognitive 30) src/scripts/notify-fallback-delivery.ts:360— notify-fallback-delivery.terminalGraph has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 10 (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.
smoke-packed-install.assertNativeHookAdvisoryPreToolUse (cognitive 30) src/scripts/smoke-packed-install.ts:2367— smoke-packed-install.assertNativeHookAdvisoryPreToolUse has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8, ternaries 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.acquireLivePinMutationLock (cognitive 29) plugins/oh-my-codex/hooks/codex-native-hook.mjs:777— codex-native-hook.acquireLivePinMutationLock has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 2 (4 pts), boolean chains 2, 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.
state-root.resolveWorkerTeamStateRootWithOptions (cognitive 29) src/team/state-root.ts:446— state-root.resolveWorkerTeamStateRootWithOptions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 7 (8 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prompt-session-provenance.preflightSelectedTargetOwner (cognitive 29) src/hooks/prompt-session-provenance.ts:245— prompt-session-provenance.preflightSelectedTargetOwner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, ternaries 3 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generator.reconcileProjectScopeTrustState (cognitive 29) src/config/generator.ts:1450— generator.reconcileProjectScopeTrustState has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 8, ternaries 3, loops 1 (nesting depth added 3). Of this number, 28 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.
advisory.observeRalplanAdvisoryPrompt (cognitive 29) src/ralplan/advisory.ts:856— advisory.observeRalplanAdvisoryPrompt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 9, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tmux-session.buildWorkerProcessLaunchSpecForMode (cognitive 29) src/team/tmux-session.ts:2254— tmux-session.buildWorkerProcessLaunchSpecForMode has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 8, if/else 3 (5 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
trace-server.handleTraceToolCall (cognitive 29) src/mcp/trace-server.ts:244— trace-server.handleTraceToolCall has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 4 (8 pts), boolean chains 6, loops 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 12). Of this number, 27 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.
setup.ensureSnapshotBackup (cognitive 29) src/cli/setup.ts:2042— setup.ensureSnapshotBackup has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, error handling 1 (3 pts), loops 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.
search.searchRolloutFile (cognitive 29) src/session-history/search.ts:318— search.searchRolloutFile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), ternaries 2 (4 pts), loops 2 (3 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.
package-manager-ownership.validatePackageManagerOwnership (cognitive 29) src/cli/package-manager-ownership.ts:74— package-manager-ownership.validatePackageManagerOwnership has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (12 pts), ternaries 3 (4 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.
codex-native-hook.readActiveRalphState (cognitive 29) src/scripts/codex-native-hook.ts:1391— codex-native-hook.readActiveRalphState has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, ternaries 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectShellCasePhases (cognitive 29) src/scripts/codex-native-hook.ts:7678— codex-native-hook.collectShellCasePhases has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 7, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractNestedShellCommandStringsForStateScan (cognitive 29) src/scripts/codex-native-hook.ts:8091— codex-native-hook.extractNestedShellCommandStringsForStateScan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractNestedCommandSubstitutionStringsForStateScan (cognitive 29) src/scripts/codex-native-hook.ts:8127— codex-native-hook.extractNestedCommandSubstitutionStringsForStateScan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isConductorFinalPipelineMember (cognitive 29) src/scripts/codex-native-hook.ts:16150— codex-native-hook.isConductorFinalPipelineMember has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 9, loops 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readBlockingSkillForStop (cognitive 29) src/scripts/codex-native-hook.ts:20621— codex-native-hook.readBlockingSkillForStop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 10, ternaries 2, loops 1 (nesting depth added 8). Of this number, 28 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.readPostLaunchModeStateFile (cognitive 29) src/cli/index.ts:7605— index.readPostLaunchModeStateFile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 2 (6 pts), error handling 2 (4 pts), boolean chains 1, 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.
collector.collectRecord (cognitive 29) src/evals/astra-defaults/collector.ts:40— collector.collectRecord has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 4 (5 pts), boolean chains 4, loops 2, ternaries 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.
team-dispatch.updateMailboxNotified (cognitive 29) src/scripts/notify-hook/team-dispatch.ts:1040— team-dispatch.updateMailboxNotified has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 11, ternaries 2 (5 pts) (nesting depth added 7). None of this is in the body itself: all 29 points belong to 4 function literals inside it that branch (lines 1043, 1049, 1046, …). 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.
session.createSessionState (cognitive 28) src/hooks/session.ts:1262— session.createSessionState has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 18 (22 pts), boolean chains 6 (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.
state.removeDispatchRequestsForWorkers (cognitive 28) src/team/state.ts:2272— state.removeDispatchRequestsForWorkers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, ternaries 3 (6 pts) (nesting depth added 10). None of this is in the body itself: all 28 points belong to 2 function literals inside it that branch (lines 2278, 2309). 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.
generator.parseTomlSourceTableHeader (cognitive 28) src/config/generator.ts:2050— generator.parseTomlSourceTableHeader has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, ternaries 1 (2 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.
generator.extractSharedMcpRegistryServersFromConfig (cognitive 28) src/config/generator.ts:3956— generator.extractSharedMcpRegistryServersFromConfig has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 2 (5 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
completion-gate.validateAutopilotCompletionTransition (cognitive 28) src/autopilot/completion-gate.ts:367— completion-gate.validateAutopilotCompletionTransition has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, if/else 12, ternaries 2 (4 pts) (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.
codex-goal-snapshot.unwrapNativeGoalResponse (cognitive 28) src/goal-workflows/codex-goal-snapshot.ts:126— codex-goal-snapshot.unwrapNativeGoalResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 2 (5 pts), boolean chains 2, loops 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.
tracker.recordNativeSubagentAuthorityObservation (cognitive 28) src/subagents/tracker.ts:1115— tracker.recordNativeSubagentAuthorityObservation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 9). None of this is in the body itself: all 28 points belong to 2 function literals inside it that branch (lines 1127, 1132). 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.
state.readAllState (cognitive 28) REDACTED:932— state.readAllState has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 19 (27 pts), if/else 1 (nesting depth added 8). Of this number, 22 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.
tmux-hook.detectInitialTarget (cognitive 28) src/cli/tmux-hook.ts:272— tmux-hook.detectInitialTarget has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (9 pts), boolean chains 8 (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.
formatter.parseTmuxTail (cognitive 28) src/notifications/formatter.ts:59— formatter.parseTmuxTail has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.prepareShutdownMergeReport (cognitive 28) src/team/runtime.ts:1792— runtime.prepareShutdownMergeReport has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, ternaries 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.
keyword-detector.persistDeepInterviewModeState (cognitive 28) src/hooks/keyword-detector.ts:587— keyword-detector.persistDeepInterviewModeState has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 12 (18 pts), boolean chains 8, if/else 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.
codex-native-hook.resolveEnvWrappedCommandCwd (cognitive 28) src/scripts/codex-native-hook.ts:5834— codex-native-hook.resolveEnvWrappedCommandCwd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, error handling 1 (3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorXargsOptionValueWordCount (cognitive 28) src/scripts/codex-native-hook.ts:15510— codex-native-hook.conductorXargsOptionValueWordCount has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyShellCwdStateEffect (cognitive 28) src/scripts/codex-native-hook.ts:17223— codex-native-hook.applyShellCwdStateEffect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9 (nesting depth added 6). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyPersistentFunctionEffects (cognitive 28) src/scripts/codex-native-hook.ts:18390— codex-native-hook.applyPersistentFunctionEffects has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 3, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectInPlaceEditorWriteTargets (cognitive 28) src/scripts/codex-native-hook.ts:20438— codex-native-hook.collectInPlaceEditorWriteTargets has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
hook-derived-watcher.processLine (cognitive 28) src/scripts/hook-derived-watcher.ts:436— hook-derived-watcher.processLine has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (9 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-hooks.prepareLegacyState (cognitive 27) src/config/codex-hooks.ts:2512— codex-hooks.prepareLegacyState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 2 (3 pts), 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.
session.parseProcessIdentityOutput (cognitive 27) src/hooks/session.ts:780— session.parseProcessIdentityOutput has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, error handling 1, 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.
session.reconcileNativeTransition.<returned closure> (cognitive 27) src/hooks/session.ts:3646— session.reconcileNativeTransition.<returned closure> has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, ternaries 7 (8 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
generator.findLauncherTimeoutRepairTargets (cognitive 27) src/config/generator.ts:4041— generator.findLauncherTimeoutRepairTargets has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 7, loops 3 (5 pts), ternaries 2 (4 pts), 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.
tmux-hook.parseConfig (cognitive 27) src/cli/tmux-hook.ts:109— tmux-hook.parseConfig has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 13, 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.
tmux-session.requireFrozenWindowTopologySync (cognitive 27) src/team/tmux-session.ts:840— tmux-session.requireFrozenWindowTopologySync has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3, loops 2 (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.
runtime.waitForExactPaneTrackedPidsExit (cognitive 27) src/team/runtime.ts:2950— runtime.waitForExactPaneTrackedPidsExit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.emitMonitorDerivedEvents (cognitive 27) src/team/runtime.ts:6097— runtime.emitMonitorDerivedEvents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 11, loops 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.authCommand (cognitive 27) src/cli/auth.ts:97— auth.authCommand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (10 pts), loops 1 (2 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.
doctor.referencedWindowsNativeHookShimPaths (cognitive 27) REDACTED:2386— doctor.referencedWindowsNativeHookShimPaths has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.syncManagedAgentsContent (cognitive 27) src/cli/setup.ts:5948— setup.syncManagedAgentsContent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 3 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usage.inspectTranscript (cognitive 27) src/session-history/usage.ts:97— usage.inspectTranscript has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 11). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
managed-tmux.verifyManagedPaneTarget (cognitive 27) src/scripts/notify-hook/managed-tmux.ts:492— managed-tmux.verifyManagedPaneTarget has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, ternaries 3 (5 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
codex-native-pre-post.readInlineEnvironmentAssignments (cognitive 27) src/scripts/codex-native-pre-post.ts:666— codex-native-pre-post.readInlineEnvironmentAssignments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 12). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.collectSloppyFallbackFindingsFromUntracked (cognitive 27) src/scripts/codex-native-hook.ts:1973— codex-native-hook.collectSloppyFallbackFindingsFromUntracked has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 3 (9 pts), boolean chains 3, loops 1 (nesting depth added 14). Of this number, 22 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findActiveGoalWorkflowReconciliationRequirement (cognitive 27) src/scripts/codex-native-hook.ts:3410— codex-native-hook.findActiveGoalWorkflowReconciliationRequirement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 9, loops 2, ternaries 2 (nesting depth added 6). 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 into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.staticExpansionAssignmentMarker (cognitive 27) src/scripts/codex-native-hook.ts:8901— codex-native-hook.staticExpansionAssignmentMarker has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (7 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.evaluateDeepInterviewRalplanHandoffCommand (cognitive 27) src/scripts/codex-native-hook.ts:9396— codex-native-hook.evaluateDeepInterviewRalplanHandoffCommand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (21 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.gitStatusInvocationHasSafeEnvironment (cognitive 27) src/scripts/codex-native-hook.ts:12760— codex-native-hook.gitStatusInvocationHasSafeEnvironment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, loops 5 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nodeCommandHasUnsafeRuntimeOutput (cognitive 27) src/scripts/codex-native-hook.ts:12901— codex-native-hook.nodeCommandHasUnsafeRuntimeOutput has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, loops 2, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyModeledPythonMetadataWriteSource (cognitive 27) src/scripts/codex-native-hook.ts:14007— codex-native-hook.isPositivelyModeledPythonMetadataWriteSource has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.withTmuxExtendedKeysLeaseLock (cognitive 27) src/cli/index.ts:6550— index.withTmuxExtendedKeysLeaseLock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (14 pts), error handling 2 (6 pts), boolean chains 3, ternaries 1 (3 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.
collect-astra-defaults.main (cognitive 27) src/scripts/eval/collect-astra-defaults.ts:41— collect-astra-defaults.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 5 (8 pts), boolean chains 3, 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.
smoke-packed-install.smokeInstalledLaunchArgumentBoundary (cognitive 27) src/scripts/smoke-packed-install.ts:1899— smoke-packed-install.smokeInstalledLaunchArgumentBoundary has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 3, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-native-agents.verifyNativeAgents (cognitive 27) src/scripts/verify-native-agents.ts:199— verify-native-agents.verifyNativeAgents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (6 pts), ternaries 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pinned-atomic-file-darwin-helper.main (cognitive 27) src/state/pinned-atomic-file-darwin-helper.ts:219— pinned-atomic-file-darwin-helper.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, 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.
native-assets.hydrateNativeBinary (cognitive 26) src/cli/native-assets.ts:728— native-assets.hydrateNativeBinary has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, error handling 2 (3 pts), loops 2, 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.
session.parseLockOwner (cognitive 26) src/hooks/session.ts:1444— session.parseLockOwner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 10, 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.
session.recoverSessionPointerLock (cognitive 26) src/hooks/session.ts:1789— session.recoverSessionPointerLock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 7, ternaries 4 (5 pts), boolean chains 3 (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.
tasks.claimTask (cognitive 26) src/team/state/tasks.ts:59— tasks.claimTask has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5 (nesting depth added 6). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 72). 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.
mailbox.executeBridgeCommand (cognitive 26) src/team/state/mailbox.ts:132— mailbox.executeBridgeCommand has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (11 pts), error handling 1 (nesting depth added 4). 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.
state.validateMembershipTransactionFiles (cognitive 26) src/team/state.ts:920— state.validateMembershipTransactionFiles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 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.
generator.removeManagedHookTrustStateFences (cognitive 26) src/config/generator.ts:2711— generator.removeManagedHookTrustStateFences has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 12). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mode-binding-lease.pinCanonicalNamespaceMarker (cognitive 26) src/state/mode-binding-lease.ts:345— mode-binding-lease.pinCanonicalNamespaceMarker has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operations.completeRalplanSession (cognitive 26) src/state/operations.ts:531— operations.completeRalplanSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 6). Of this number, 24 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.
tmux-session.teardownWorkerPanes (cognitive 26) src/team/tmux-session.ts:4518— tmux-session.teardownWorkerPanes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 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.
scaling.validateScaleDownCleanupResources (cognitive 26) src/team/scaling.ts:1562— scaling.validateScaleDownCleanupResources has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (12 pts), loops 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.
cleanup.cleanupOmxMcpProcesses (cognitive 26) src/cli/cleanup.ts:402— cleanup.cleanupOmxMcpProcesses has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (5 pts), loops 3 (5 pts), ternaries 2 (3 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.
runtime.reconcileStartupCleanupPanes (cognitive 26) src/team/runtime.ts:387— runtime.reconcileStartupCleanupPanes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). Of this number, 23 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.
runtime.removeGeneratedShutdownReport (cognitive 26) src/team/runtime.ts:1715— runtime.removeGeneratedShutdownReport has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, error handling 1 (3 pts), ternaries 2 (nesting depth added 7). Of this number, 20 points are the body's own statements and 6 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.
team.splitTaskString (cognitive 26) REDACTED:1160— team.splitTaskString has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 7 (10 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). Of this number, 23 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.
artifacts.applySteeringMutation (cognitive 26) src/ultragoal/artifacts.ts:1397— artifacts.applySteeringMutation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.conductorMetadataRedirectsHaveBoundedProducers (cognitive 26) src/scripts/codex-native-hook.ts:5237— codex-native-hook.conductorMetadataRedirectsHaveBoundedProducers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasUnresolvedShellArithmeticExpansion (cognitive 26) src/scripts/codex-native-hook.ts:8815— codex-native-hook.hasUnresolvedShellArithmeticExpansion has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractShellHeredocOpeners (cognitive 26) src/scripts/codex-native-hook.ts:8992— codex-native-hook.extractShellHeredocOpeners has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 2 (4 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readActiveRalplanStateForPreToolUse (cognitive 26) src/scripts/codex-native-hook.ts:10489— codex-native-hook.readActiveRalplanStateForPreToolUse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, ternaries 4 (nesting depth added 3). Of this number, 23 points are the body's own statements and 3 belong to 3 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isInvocationIsolated (cognitive 26) src/scripts/codex-native-hook.ts:16114— codex-native-hook.isInvocationIsolated has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, loops 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.execWithOverlay (cognitive 26) src/cli/index.ts:5855— index.execWithOverlay has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6 (7 pts), error handling 4, boolean chains 1 (nesting depth added 7). Of this number, 24 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.
update-worker.main (cognitive 26) src/cli/update-worker.ts:81— update-worker.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8, ternaries 2 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
team-dispatch.resolveDispatchTarget (cognitive 26) src/scripts/notify-hook/team-dispatch.ts:421— team-dispatch.resolveDispatchTarget has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (26 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.
livePinDirectory (cognitive 26) plugins/oh-my-codex/hooks/codex-native-hook.mjs:486— livePinDirectory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 4, ternaries 2, loops 1 (nesting depth added 3). Of this number, 24 points are the body's own statements and 2 belong to one function item 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.
codex-native-hook.writePendingSessionPin (cognitive 25) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1267— codex-native-hook.writePendingSessionPin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 5 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
state-root.validateWorkerNotifyStateRoot (cognitive 25) src/team/state-root.ts:360— state-root.validateWorkerNotifyStateRoot has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, loops 2 (nesting depth added 5). Of this number, 24 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.
monitor.readTeamPhase (cognitive 25) src/team/state/monitor.ts:295— monitor.readTeamPhase has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 2, if/else 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.
tmux-hook-engine.normalizeTmuxHookConfig (cognitive 25) src/scripts/tmux-hook-engine.ts:19— tmux-hook-engine.normalizeTmuxHookConfig has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13 (15 pts), boolean chains 9, if/else 1 (nesting depth added 2). Of this number, 24 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.
tracker.selectReusableSubagentEntry (cognitive 25) src/subagents/tracker.ts:1874— tracker.selectReusableSubagentEntry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, boolean chains 8. None of this is in the body itself: all 25 points belong to 3 function literals inside it that branch (lines 1898, 1888, 1914). 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.
session-registry.acquireRegistryLock (cognitive 25) src/notifications/session-registry.ts:129— session-registry.acquireRegistryLock has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (18 pts), error handling 2 (5 pts), boolean chains 1, 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.
config.getNotificationConfig (cognitive 25) src/notifications/config.ts:422— config.getNotificationConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 2 (7 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ask.parseAskArgs (cognitive 25) src/cli/ask.ts:91— ask.parseAskArgs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, loops 1, 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.
doctor.checkAgentsMd (cognitive 25) REDACTED:4186— doctor.checkAgentsMd has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 1 (nesting depth added 13). 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.
setup.cleanupLegacyManagedSkills (cognitive 25) src/cli/setup.ts:6573— setup.cleanupLegacyManagedSkills has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
uninstall.stageAndRemoveFile (cognitive 25) src/cli/uninstall.ts:1300— uninstall.stageAndRemoveFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (6 pts), error handling 3 (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.
team.buildTeamExecutionPlan (cognitive 25) REDACTED:1034— team.buildTeamExecutionPlan has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 11, if/else 2 (nesting depth added 4). Of this number, 18 points are the body's own statements and 7 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.
AdvisoryLifecycleHandler.activate (cognitive 25) src/ralplan/runtime-advisory-lifecycle.ts:249— AdvisoryLifecycleHandler.activate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 7). Of this number, 23 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.
auto-nudge.syncSkillStateFromTurn (cognitive 25) src/scripts/notify-hook/auto-nudge.ts:220— auto-nudge.syncSkillStateFromTurn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, ternaries 2 (3 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.
codex-native-hook.shellTokenizeLiteralCommand (cognitive 25) src/scripts/codex-native-hook.ts:4794— codex-native-hook.shellTokenizeLiteralCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandHasPackageInstallIntent (cognitive 25) src/scripts/codex-native-hook.ts:5393— codex-native-hook.commandHasPackageInstallIntent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractStateWriteOperationPayload (cognitive 25) src/scripts/codex-native-hook.ts:6645— codex-native-hook.extractStateWriteOperationPayload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8, ternaries 6 (8 pts), boolean chains 6, error handling 2 (3 pts) (nesting depth added 3). Of this number, 19 points are the body's own statements and 6 belong to 2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedOmxReadOnlyCommand (cognitive 25) src/scripts/codex-native-hook.ts:10098— codex-native-hook.isAllowedOmxReadOnlyCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedRalplanBashWrite (cognitive 25) src/scripts/codex-native-hook.ts:10536— codex-native-hook.isAllowedRalplanBashWrite has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, boolean chains 10. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readActiveConductorStateForPreToolUse (cognitive 25) src/scripts/codex-native-hook.ts:10937— codex-native-hook.readActiveConductorStateForPreToolUse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 8). Of this number, 24 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyClassifiedPerlCommand (cognitive 25) src/scripts/codex-native-hook.ts:11573— codex-native-hook.isPositivelyClassifiedPerlCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.gitStatusTrackedSurfaceIsSafe (cognitive 25) src/scripts/codex-native-hook.ts:12069— codex-native-hook.gitStatusTrackedSurfaceIsSafe has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (5 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.maskPythonStringsAndComments (cognitive 25) src/scripts/codex-native-hook.ts:13789— codex-native-hook.maskPythonStringsAndComments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorWgetShortOptionCluster (cognitive 25) src/scripts/codex-native-hook.ts:14517— codex-native-hook.parseConductorWgetShortOptionCluster has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 4 (7 pts), boolean chains 3, loops 1 (nesting depth added 13). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.copyProjectLaunchRuntimeHistoryDirectory (cognitive 25) src/cli/index.ts:1823— index.copyProjectLaunchRuntimeHistoryDirectory has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 9, ternaries 2, loops 1 (nesting depth added 4). Of this number, 22 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.
notify-fallback-watcher.resolveActiveModeState (cognitive 25) src/scripts/notify-fallback-watcher.ts:587— notify-fallback-watcher.resolveActiveModeState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, ternaries 1 (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.
smoke-packed-install.smokeInstalledNativeHookDist::runPackedTransportRegressions (cognitive 25) src/scripts/smoke-packed-install.ts:2450— smoke-packed-install.smokeInstalledNativeHookDist::runPackedTransportRegressions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (smoke-packed-install.smokeInstalledNativeHookDist) 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.
NudgeTracker.checkAndNudge (cognitive 25) src/team/idle-nudge.ts:163— NudgeTracker.checkAndNudge has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DispatchLog::recover_pending_hook_attempts (cognitive 25) crates/omx-runtime-core/src/dispatch.rs:183— DispatchLog::recover_pending_hook_attempts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hasKnownLiveSessionPin (cognitive 25) plugins/oh-my-codex/hooks/codex-native-hook.mjs:1169— hasKnownLiveSessionPin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, error handling 3 (4 pts), ternaries 1 (2 pts), loops 1, other 1 (nesting depth added 6). Of this number, 24 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.
codex-hooks.foreignHookCoordinateMoves (cognitive 24) src/config/codex-hooks.ts:2321— codex-hooks.foreignHookCoordinateMoves has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (7 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.malformedRecoveryPointerReason (cognitive 24) src/hooks/session.ts:1953— session.malformedRecoveryPointerReason has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 11, 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.
session.writePointerTransaction (cognitive 24) src/hooks/session.ts:2695— session.writePointerTransaction has cognitive complexity 24 (threshold 15). Drivers by points: error handling 9 (10 pts), if/else 7 (10 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.readNativeSessionOwnerEvidence (cognitive 24) src/hooks/session.ts:3556— session.readNativeSessionOwnerEvidence has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, error handling 2, loops 2, 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.
base.startModeUnderCanonicalLock (cognitive 24) src/modes/base.ts:201— base.startModeUnderCanonicalLock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render.sliceAnsiVisible (cognitive 24) src/hud/render.ts:449— render.sliceAnsiVisible has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 1, 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.
autopilot.autopilotCommand (cognitive 24) src/cli/autopilot.ts:98— autopilot.autopilotCommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (21 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.
setup.ensureProjectGitignore (cognitive 24) src/cli/setup.ts:3473— setup.ensureProjectGitignore has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 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.
index.isSafeIpv4 (cognitive 24) src/url-reader/index.ts:319— index.isSafeIpv4 has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 11. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
keyword-detector.collectFencedCodeRanges (cognitive 24) src/hooks/keyword-detector.ts:1471— keyword-detector.collectFencedCodeRanges has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, ternaries 1 (3 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.
codex-native-hook.findTimeoutDispatchOperandIndex (cognitive 24) src/scripts/codex-native-hook.ts:7525— codex-native-hook.findTimeoutDispatchOperandIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isPositivelyReadOnlyGitCommand (cognitive 24) src/scripts/codex-native-hook.ts:12134— codex-native-hook.isPositivelyReadOnlyGitCommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.classifyConductorExecutableRuntime (cognitive 24) src/scripts/codex-native-hook.ts:13879— codex-native-hook.classifyConductorExecutableRuntime has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.buildDetachedLaunchControlPlane (cognitive 24) src/cli/index.ts:7088— index.buildDetachedLaunchControlPlane has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.assertCompatibleNestedSkillOwners (cognitive 24) src/cli/index.ts:10450— index.assertCompatibleNestedSkillOwners has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
suite.validateConfigs (cognitive 24) src/evals/astra-defaults/suite.ts:190— suite.validateConfigs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bridge.resolveRuntimeBinaryPath (cognitive 23) src/runtime/bridge.ts:168— bridge.resolveRuntimeBinaryPath has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (6 pts), error handling 2 (4 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.inspectSessionPointerLockAtContext (cognitive 23) src/hooks/session.ts:1542— session.inspectSessionPointerLockAtContext has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7, ternaries 5 (7 pts), boolean chains 6, error handling 3 (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.
state.normalizeTeamLeaderAttentionState (cognitive 23) src/team/state.ts:2848— state.normalizeTeamLeaderAttentionState has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 10, if/else 1 (nesting depth added 1). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
generator.stripProofManagedCodexHookTrustStateTables (cognitive 23) src/config/generator.ts:2758— generator.stripProofManagedCodexHookTrustStateTables has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (7 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 6). Of this number, 19 points are the body's own statements and 4 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.
generator.upsertPluginModeRuntimeFeatureFlags (cognitive 23) src/config/generator.ts:3063— generator.upsertPluginModeRuntimeFeatureFlags has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, ternaries 2 (3 pts), boolean chains 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.
native-config.installNativeAgentConfigs (cognitive 23) src/agents/native-config.ts:462— native-config.installNativeAgentConfigs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, loops 1, ternaries 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.
contract.supportEvidenceFromBlocker (cognitive 23) src/leader/contract.ts:254— contract.supportEvidenceFromBlocker has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 6 (8 pts), boolean chains 4 (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.
state.readUltragoalState (cognitive 23) REDACTED:335— state.readUltragoalState has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 14, ternaries 6 (7 pts), if/else 2 (nesting depth added 1). Of this number, 17 points are the body's own statements and 6 belong to 6 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.
mode-binding-lease.withModeBindingOwnerTransaction (cognitive 23) src/state/mode-binding-lease.ts:175— mode-binding-lease.withModeBindingOwnerTransaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, error handling 1 (nesting depth added 4). Of this number, 15 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.
events.normalizeSubmittedAnswers (cognitive 23) src/question/events.ts:201— events.normalizeSubmittedAnswers has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 4 (7 pts) (nesting depth added 3). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 215). 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.
cleanup.cleanupStaleTmpDirectories (cognitive 23) src/cli/cleanup.ts:516— cleanup.cleanupStaleTmpDirectories has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (4 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 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.
runtime.applyCreatedInteractiveSessionToConfig (cognitive 23) src/team/runtime.ts:528— runtime.applyCreatedInteractiveSessionToConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
code-intel-server.searchWorkspaceSymbols::walk (cognitive 23) src/mcp/code-intel-server.ts:296— code-intel-server.searchWorkspaceSymbols::walk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 3, 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.
lint.lintWiki (cognitive 23) src/wiki/lint.ts:38— lint.lintWiki has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts), boolean chains 2 (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.
lint.detectStructuralContradictions (cognitive 23) src/wiki/lint.ts:153— lint.detectStructuralContradictions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
autoresearch-guided.parseInitArgs (cognitive 23) src/cli/autoresearch-guided.ts:254— autoresearch-guided.parseInitArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 6, 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.
autoresearch-guided.runAutoresearchNoviceBridge (cognitive 23) src/cli/autoresearch-guided.ts:303— autoresearch-guided.runAutoresearchNoviceBridge has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 2 (5 pts), error handling 1, loops 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 9 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.
plugin-marketplace.acquireOmxPluginCacheLivePinMutationLock (cognitive 23) src/cli/plugin-marketplace.ts:985— plugin-marketplace.acquireOmxPluginCacheLivePinMutationLock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 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.
doctor.checkExternalCodexProcessGuards (cognitive 23) REDACTED:2194— doctor.checkExternalCodexProcessGuards has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), boolean chains 1, 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.
doctor.checkPluginMarketplaceRegistration (cognitive 23) REDACTED:3606— doctor.checkPluginMarketplaceRegistration has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2 (5 pts), boolean chains 4, error handling 1 (nesting depth added 4). 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: 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.
setup.cleanupNativeHookTransactionStagedDeletions (cognitive 23) src/cli/setup.ts:1933— setup.cleanupNativeHookTransactionStagedDeletions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (8 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.cleanupGeneratedNonInstallableNativeAgents (cognitive 23) src/cli/setup.ts:6118— setup.cleanupGeneratedNonInstallableNativeAgents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.cleanupObsoleteNativeAgents (cognitive 23) src/cli/setup.ts:6307— setup.cleanupObsoleteNativeAgents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
advisory-activation.activateOrResumeRalplanAdvisoryUnderCanonicalLock (cognitive 23) src/ralplan/advisory-activation.ts:202— advisory-activation.activateOrResumeRalplanAdvisoryUnderCanonicalLock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, ternaries 1 (nesting depth added 7). Of this number, 22 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.
artifacts.validateArchitectureInvariantGate (cognitive 23) src/ultragoal/artifacts.ts:1643— artifacts.validateArchitectureInvariantGate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
export.renderSessionMarkdown (cognitive 23) src/session-history/export.ts:149— export.renderSessionMarkdown has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (9 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.
session-usage.parseSessionUsageArgs (cognitive 23) src/cli/session-usage.ts:22— session-usage.parseSessionUsageArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.collectMarkdownTableRanges (cognitive 23) src/hooks/keyword-detector.ts:2180— keyword-detector.collectMarkdownTableRanges has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.implicitClauseRange (cognitive 23) src/hooks/keyword-detector.ts:3180— keyword-detector.implicitClauseRange has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.collectSloppyFallbackFindingsFromPatch (cognitive 23) src/scripts/codex-native-hook.ts:1895— codex-native-hook.collectSloppyFallbackFindingsFromPatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorStaticTruncateSize (cognitive 23) src/scripts/codex-native-hook.ts:5279— codex-native-hook.conductorStaticTruncateSize has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 4 (8 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.classifyPreToolUseMutationTransport (cognitive 23) src/scripts/codex-native-hook.ts:5653— codex-native-hook.classifyPreToolUseMutationTransport has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findEnvDispatchOperandIndex (cognitive 23) src/scripts/codex-native-hook.ts:7413— codex-native-hook.findEnvDispatchOperandIndex has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findShellArithmeticExpansionEnd (cognitive 23) src/scripts/codex-native-hook.ts:8705— codex-native-hook.findShellArithmeticExpansionEnd has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.readActiveDeepInterviewStateForPreToolUse (cognitive 23) src/scripts/codex-native-hook.ts:10433— codex-native-hook.readActiveDeepInterviewStateForPreToolUse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 3 (nesting depth added 1). Of this number, 20 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorWgetStartupOptions (cognitive 23) src/scripts/codex-native-hook.ts:14315— codex-native-hook.parseConductorWgetStartupOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.stripCommandSubstitutionBodiesForConductorScan (cognitive 23) src/scripts/codex-native-hook.ts:19401— codex-native-hook.stripCommandSubstitutionBodiesForConductorScan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.resolveSetupInstallModeArg (cognitive 23) src/cli/index.ts:584— index.resolveSetupInstallModeArg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, loops 1 (nesting depth added 10). Of this number, 21 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.
notify-dispatcher.acquireTurnDispatchGuard (cognitive 23) src/scripts/notify-dispatcher.ts:134— notify-dispatcher.acquireTurnDispatchGuard has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (7 pts), error handling 6, if/else 5 (6 pts), boolean chains 4 (nesting depth added 4). Of this number, 21 points are the body's own statements and 2 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.
verify-native-agents.assertTomlStructure (cognitive 23) src/scripts/verify-native-agents.ts:70— verify-native-agents.assertTomlStructure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hermes.buildHermesCapabilityOverrides (cognitive 22) src/adapt/hermes.ts:319— hermes.buildHermesCapabilityOverrides has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 2 (nesting depth added 12). None of this is in the body itself: all 22 points belong to one function literal inside it that branches (line 323). 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.
session.isAuthorizedBoundPointer (cognitive 22) src/hooks/session.ts:3254— session.isAuthorizedBoundPointer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 9, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
generator.stripOrphanedOmxSections (cognitive 22) src/config/generator.ts:3471— generator.stripOrphanedOmxSections has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (9 pts), boolean chains 2 (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.
config.readAuthConfig (cognitive 22) src/auth/config.ts:45— config.readAuthConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tmux.parsePosixHudEnvAssignments.inspect (cognitive 22) src/hud/tmux.ts:393— tmux.parsePosixHudEnvAssignments.inspect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 8, 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.
scaling.asScaleDownDebtPanes (cognitive 22) src/team/scaling.ts:1687— scaling.asScaleDownDebtPanes has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts), ternaries 3, loops 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 8 belong to one function item 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.
runtime.isValidGonePaneDescendantCleanupDebt (cognitive 22) src/team/runtime.ts:3198— runtime.isValidGonePaneDescendantCleanupDebt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9 (nesting depth added 3). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 3203). 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.
followup.parseExecInjectArgs (cognitive 22) src/exec/followup.ts:357— followup.parseExecInjectArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
toml.upsertTopLevelTomlString (cognitive 22) src/utils/toml.ts:28— toml.upsertTopLevelTomlString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
doctor.collectRepoArtifactOwnershipIssues::visit (cognitive 22) REDACTED:1671— doctor.collectRepoArtifactOwnershipIssues::visit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 3 (4 pts), ternaries 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
doctor.checkWindowsNativeHookShims (cognitive 22) REDACTED:2468— doctor.checkWindowsNativeHookShims has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 pts), boolean chains 3, 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.
doctor.checkNativeHooks (cognitive 22) REDACTED:2965— doctor.checkNativeHooks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.launchTmuxPane (cognitive 22) src/hud/index.ts:714— index.launchTmuxPane has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 4 (5 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-timeline.formatSessionTimeline (cognitive 22) src/cli/session-timeline.ts:104— session-timeline.formatSessionTimeline has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 8 (9 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.envCommandHasCwdChangingOption (cognitive 22) src/scripts/codex-native-hook.ts:6738— codex-native-hook.envCommandHasCwdChangingOption has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findPackageManagerExecSubcommandIndex (cognitive 22) src/scripts/codex-native-hook.ts:7034— codex-native-hook.findPackageManagerExecSubcommandIndex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractDispatchBuiltinOperand (cognitive 22) src/scripts/codex-native-hook.ts:8276— codex-native-hook.extractDispatchBuiltinOperand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findConductorBareArithmeticCommandEnd (cognitive 22) src/scripts/codex-native-hook.ts:8753— codex-native-hook.findConductorBareArithmeticCommandEnd has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findShellParameterExpansionEnd (cognitive 22) src/scripts/codex-native-hook.ts:8872— codex-native-hook.findShellParameterExpansionEnd has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasUnquotedShellSubstitution (cognitive 22) src/scripts/codex-native-hook.ts:9088— codex-native-hook.hasUnquotedShellSubstitution has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedDeepInterviewTerminalStateWriteCommand (cognitive 22) src/scripts/codex-native-hook.ts:9551— codex-native-hook.isAllowedDeepInterviewTerminalStateWriteCommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 7, error handling 1. Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorWrapperLayersAreTrusted (cognitive 22) src/scripts/codex-native-hook.ts:14144— codex-native-hook.conductorWrapperLayersAreTrusted has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, ternaries 1 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorMutationUsesUnsafeOption (cognitive 22) src/scripts/codex-native-hook.ts:14256— codex-native-hook.conductorMutationUsesUnsafeOption has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (6 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorCurlShortOptionCluster (cognitive 22) src/scripts/codex-native-hook.ts:14817— codex-native-hook.parseConductorCurlShortOptionCluster has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.wakeOpenClaw (cognitive 22) src/openclaw/index.ts:76— index.wakeOpenClaw has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6 (7 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.
index.copyFilePreservingTimestamps (cognitive 22) src/cli/index.ts:987— index.copyFilePreservingTimestamps has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3 (4 pts), ternaries 3, 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.
index.normalizeCodexLaunchArgs (cognitive 22) src/cli/index.ts:5991— index.normalizeCodexLaunchArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 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.
tmux-injection.handleTmuxInjection::scanActiveModeStateDirs (cognitive 22) src/scripts/notify-hook/tmux-injection.ts:482— tmux-injection.handleTmuxInjection::scanActiveModeStateDirs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (tmux-injection.handleTmuxInjection) 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.
notify-fallback-watcher.processLine (cognitive 22) src/scripts/notify-fallback-watcher.ts:1679— notify-fallback-watcher.processLine has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 8, boolean chains 4, error handling 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
pinned-atomic-file-darwin-janitor.recover (cognitive 22) src/state/pinned-atomic-file-darwin-janitor.ts:146— pinned-atomic-file-darwin-janitor.recover has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, ternaries 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.
isChildRoutingSessionStart (cognitive 22) plugins/oh-my-codex/hooks/codex-native-hook.mjs:180— isChildRoutingSessionStart has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 5, if/else 3, error handling 2, other 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.
config.normalizeFromCustomAliases (cognitive 21) src/openclaw/config.ts:87— config.normalizeFromCustomAliases has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 3 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.
codex-hooks.discoverCodexHookConfigPaths (cognitive 21) src/config/codex-hooks.ts:3025— codex-hooks.discoverCodexHookConfigPaths has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native-assets.acquireCacheLock (cognitive 21) src/cli/native-assets.ts:605— native-assets.acquireCacheLock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (4 pts), boolean chains 2, error handling 1 (2 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.
session.startPointerTransition.<returned closure> (cognitive 21) src/hooks/session.ts:2866— session.startPointerTransition.<returned closure> has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 4 (5 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.
session.establishLaunchSessionBinding (cognitive 21) src/hooks/session.ts:3099— session.establishLaunchSessionBinding has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 2, ternaries 2 (nesting depth added 6). Of this number, 16 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.
dispatch.executeBridgeCommand (cognitive 21) src/team/state/dispatch.ts:179— dispatch.executeBridgeCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, 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.
hotswap.buildResumeArgsWithPreservedFlags (cognitive 21) src/auth/hotswap.ts:226— hotswap.buildResumeArgsWithPreservedFlags has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), ternaries 2, boolean chains 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.
tmux.hudPaneMatchesOwner (cognitive 21) src/hud/tmux.ts:629— tmux.hudPaneMatchesOwner has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), ternaries 4 (nesting depth added 1). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
notice-ledger.normalizeLedger (cognitive 21) src/team/notice-ledger.ts:121— notice-ledger.normalizeLedger has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, loops 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.
runtime.findActiveTeams (cognitive 21) src/team/runtime.ts:5982— runtime.findActiveTeams has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 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.
runtime.finalizeHookPreferredMailboxDispatch (cognitive 21) src/team/runtime.ts:6737— runtime.finalizeHookPreferredMailboxDispatch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
events.readTeamEvents (cognitive 21) src/team/state/events.ts:88— events.readTeamEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 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.
plugin-marketplace.validateStagedPluginSnapshot (cognitive 21) src/cli/plugin-marketplace.ts:3159— plugin-marketplace.validateStagedPluginSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
doctor.checkNativePostCompactHookRuntime (cognitive 21) REDACTED:3296— doctor.checkNativePostCompactHookRuntime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 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.
uninstall.cleanupStagedDeletions (cognitive 21) src/cli/uninstall.ts:1533— uninstall.cleanupStagedDeletions has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (6 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
uninstall.printSummary (cognitive 21) src/cli/uninstall.ts:1766— uninstall.printSummary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
sparkshell.sparkshellCommand (cognitive 21) REDACTED:406— sparkshell.sparkshellCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, 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.
update.runDeferredGlobalUpdate (cognitive 21) REDACTED:443— update.runDeferredGlobalUpdate has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 6, error handling 4 (6 pts), if/else 5 (6 pts), ternaries 2 (3 pts) (nesting depth added 4). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
enforcer.findFreshLocalPlanningTargets (cognitive 21) src/document-refresh/enforcer.ts:321— enforcer.findFreshLocalPlanningTargets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.decodeStaticRedirectShellWord (cognitive 21) src/scripts/codex-native-hook.ts:5117— codex-native-hook.decodeStaticRedirectShellWord has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractNestedProcessSubstitutionStringsForStateScan (cognitive 21) src/scripts/codex-native-hook.ts:8163— codex-native-hook.extractNestedProcessSubstitutionStringsForStateScan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 1 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findCommandSubstitutionEnd (cognitive 21) src/scripts/codex-native-hook.ts:8530— codex-native-hook.findCommandSubstitutionEnd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isAllowedTrustedAbsoluteOmxReadOnlyCommand (cognitive 21) src/scripts/codex-native-hook.ts:10128— codex-native-hook.isAllowedTrustedAbsoluteOmxReadOnlyCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 10. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolvePreToolUseWriteActor (cognitive 21) src/scripts/codex-native-hook.ts:10893— codex-native-hook.resolvePreToolUseWriteActor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 8, ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandConfiguresRuntimeEnvironment (cognitive 21) src/scripts/codex-native-hook.ts:11783— codex-native-hook.commandConfiguresRuntimeEnvironment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 7). Of this number, 20 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.nodeCommandHasPreloadExecution (cognitive 21) src/scripts/codex-native-hook.ts:12707— codex-native-hook.nodeCommandHasPreloadExecution has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorSedTargets (cognitive 21) src/scripts/codex-native-hook.ts:15397— codex-native-hook.collectConductorSedTargets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1, ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.declarationExportMode (cognitive 21) src/scripts/codex-native-hook.ts:16996— codex-native-hook.declarationExportMode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 1, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.materializeUserGlobalAgentsFile (cognitive 21) src/cli/index.ts:2099— index.materializeUserGlobalAgentsFile has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime-state.readHudState (cognitive 21) src/hooks/extensibility/sdk/runtime-state.ts:42— runtime-state.readHudState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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.
tmux.sendTmuxKeys (cognitive 21) src/hooks/extensibility/sdk/tmux.ts:125— tmux.sendTmuxKeys has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
operational-events.buildOperationalContext (cognitive 21) src/scripts/notify-hook/operational-events.ts:194— operational-events.buildOperationalContext has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (17 pts), error handling 1 (2 pts), boolean chains 1, if/else 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
readLivePinMutationLock (cognitive 21) plugins/oh-my-codex/hooks/codex-native-hook.mjs:677— readLivePinMutationLock has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (8 pts), error handling 2 (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.
codex-hooks.isValidRustRegexEscape (cognitive 20) src/config/codex-hooks.ts:794— codex-hooks.isValidRustRegexEscape has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, 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.
codex-hooks.knownFieldPatches (cognitive 20) src/config/codex-hooks.ts:2084— codex-hooks.knownFieldPatches has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). Of this number, 15 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.
codex-hooks.applyCoordinateSafeRemovals (cognitive 20) src/config/codex-hooks.ts:2413— codex-hooks.applyCoordinateSafeRemovals has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native-assets.publishManagedNativeBinary (cognitive 20) src/cli/native-assets.ts:662— native-assets.publishManagedNativeBinary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (5 pts), error handling 3 (4 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.
dispatch-lock.withDispatchLock (cognitive 20) src/team/state/dispatch-lock.ts:21— dispatch-lock.withDispatchLock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 4 (8 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.
generator.stripOmxFeatureFlags (cognitive 20) src/config/generator.ts:3339— generator.stripOmxFeatureFlags has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 1, 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.
generator.buildMergedConfig (cognitive 20) src/config/generator.ts:4287— generator.buildMergedConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7, boolean chains 4 (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.
exact-pane.parseExactPaneProof (cognitive 20) src/team/exact-pane.ts:33— exact-pane.parseExactPaneProof has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, 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.
tracker.quarantinePersistedRootAuthority (cognitive 20) src/subagents/tracker.ts:1572— tracker.quarantinePersistedRootAuthority has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1580). 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.
config.mergeEnvIntoFileConfig (cognitive 20) src/notifications/config.ts:184— config.mergeEnvIntoFileConfig has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 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.
tmux.detectTmuxSessionByPid (cognitive 20) src/notifications/tmux.ts:104— tmux.detectTmuxSessionByPid has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (tmux.detectTmuxPaneByPid) 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.
tmux.detectTmuxPaneByPid (cognitive 20) src/notifications/tmux.ts:261— tmux.detectTmuxPaneByPid has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (tmux.detectTmuxSessionByPid) 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.
tmux-session.sendToWorker (cognitive 20) src/team/tmux-session.ts:3852— tmux-session.sendToWorker has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 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.
worker-bootstrap.generateInitialInbox (cognitive 20) src/team/worker-bootstrap.ts:788— worker-bootstrap.generateInitialInbox has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 7, boolean chains 4 (nesting depth added 4). Of this number, 11 points are the body's own statements and 9 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.
runtime.collectAuthorizedSharedSessionWorkerPaneIds (cognitive 20) src/team/runtime.ts:617— runtime.collectAuthorizedSharedSessionWorkerPaneIds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, 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.
api-interop.resolveTeamWorkingDirectory (cognitive 20) src/team/api-interop.ts:497— api-interop.resolveTeamWorkingDirectory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 3 (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.
plugin-marketplace.writePendingOmxPluginCacheLivePinRegistration (cognitive 20) src/cli/plugin-marketplace.ts:1061— plugin-marketplace.writePendingOmxPluginCacheLivePinRegistration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plugin-marketplace.omxPluginCacheSkillsProvenanceReason (cognitive 20) src/cli/plugin-marketplace.ts:2887— plugin-marketplace.omxPluginCacheSkillsProvenanceReason has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 4 (6 pts), boolean chains 4, 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.
plugin-marketplace.upsertTomlTableBooleanKey (cognitive 20) src/cli/plugin-marketplace.ts:4587— plugin-marketplace.upsertTomlTableBooleanKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 pts), loops 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.
doctor.selectorEvaluation (cognitive 20) REDACTED:358— doctor.selectorEvaluation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 3 (6 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.
setup.syncNativeAgentToml (cognitive 20) src/cli/setup.ts:5877— setup.syncNativeAgentToml has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
uninstall.removeAgentConfigs (cognitive 20) src/cli/uninstall.ts:783— uninstall.removeAgentConfigs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), error handling 1 (2 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.
update.runDevGlobalUpdate (cognitive 20) REDACTED:202— update.runDevGlobalUpdate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 4, error handling 2, ternaries 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.
keyword-detector.scanExplicitCandidates (cognitive 20) src/hooks/keyword-detector.ts:2505— keyword-detector.scanExplicitCandidates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pre-tool-use-advisory.toAdvisoryOrCancelPreToolUseOutput (cognitive 20) src/hooks/native/pre-tool-use-advisory.ts:56— pre-tool-use-advisory.toAdvisoryOrCancelPreToolUseOutput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 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.
codex-native-hook.shouldRetireShadowedRalphStartingSeed (cognitive 20) src/scripts/codex-native-hook.ts:1249— codex-native-hook.shouldRetireShadowedRalphStartingSeed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.listRawActiveSkillEntries (cognitive 20) src/scripts/codex-native-hook.ts:3174— codex-native-hook.listRawActiveSkillEntries has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), loops 1 (2 pts) (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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorHeredocRedirectHasBoundedProducer (cognitive 20) src/scripts/codex-native-hook.ts:5209— codex-native-hook.conductorHeredocRedirectHasBoundedProducer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findOmxCliWrapperRuntimeScriptIndex (cognitive 20) src/scripts/codex-native-hook.ts:7367— codex-native-hook.findOmxCliWrapperRuntimeScriptIndex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findProcessSubstitutionEnd (cognitive 20) src/scripts/codex-native-hook.ts:8573— codex-native-hook.findProcessSubstitutionEnd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isStandaloneParsedOmxStateWriteTransport (cognitive 20) src/scripts/codex-native-hook.ts:9243— codex-native-hook.isStandaloneParsedOmxStateWriteTransport has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.deepInterviewRalplanHandoffPayloadHasExactSchema (cognitive 20) src/scripts/codex-native-hook.ts:9351— codex-native-hook.deepInterviewRalplanHandoffPayloadHasExactSchema has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.handleDirectOmxCancel (cognitive 20) src/scripts/codex-native-hook.ts:9721— codex-native-hook.handleDirectOmxCancel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 3 (4 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorSingleSubstitutionProgram (cognitive 20) src/scripts/codex-native-hook.ts:11534— codex-native-hook.parseConductorSingleSubstitutionProgram has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.ghReadOnlyCommandHasStaticRemoteArguments (cognitive 20) src/scripts/codex-native-hook.ts:12381— codex-native-hook.ghReadOnlyCommandHasStaticRemoteArguments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, ternaries 1 (2 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyShellFunctionBindingEffect (cognitive 20) src/scripts/codex-native-hook.ts:18797— codex-native-hook.applyShellFunctionBindingEffect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 1 (nesting depth added 5). 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, split the body into named stages: move each independent 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.stripProcessSubstitutionBodiesForConductorScan (cognitive 20) src/scripts/codex-native-hook.ts:19365— codex-native-hook.stripProcessSubstitutionBodiesForConductorScan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.decodeDetachedLeaderPayload (cognitive 20) src/cli/index.ts:8879— index.decodeDetachedLeaderPayload has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 5, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mode-binding-lease-helper.sameOwnerState (cognitive 20) src/state/mode-binding-lease-helper.ts:343— mode-binding-lease-helper.sameOwnerState has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 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.
omx_runtime_core::engine::mailbox_acknowledgement_is_reflected (cognitive 20) crates/omx-runtime-core/src/engine.rs:733— omx_runtime_core::engine::mailbox_acknowledgement_is_reflected has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (3 pts), boolean chains 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.
isTrackedSubagentInSessionTree (cognitive 20) plugins/oh-my-codex/hooks/codex-native-hook.mjs:218— isTrackedSubagentInSessionTree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native-assets.readOpenedFile (cognitive 19) src/cli/native-assets.ts:474— native-assets.readOpenedFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
worktree.parseWorktreeMode (cognitive 19) src/team/worktree.ts:303— worktree.parseWorktreeMode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, 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.
dispatch.transitionDispatchRequest (cognitive 19) src/team/state/dispatch.ts:361— dispatch.transitionDispatchRequest has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 3 (4 pts), boolean chains 3 (nesting depth added 9). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 368). 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.
monitor.getTeamSummary (cognitive 19) src/team/state/monitor.ts:160— monitor.getTeamSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 2 (4 pts), loops 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.
redact.createAuthStderrRedactor.accept (cognitive 19) src/auth/redact.ts:63— redact.createAuthStderrRedactor.accept has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mode-state-context.withModeRuntimeContext (cognitive 19) src/state/mode-state-context.ts:119— mode-state-context.withModeRuntimeContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tracker.withCrossProcessFileLockSync (cognitive 19) src/subagents/tracker.ts:746— tracker.withCrossProcessFileLockSync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, error handling 2, ternaries 2, loops 1 (nesting depth added 5). Of this number, 13 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.
JsonChildClient.consume (cognitive 19) src/state/pinned-atomic-file-darwin-client.ts:45— JsonChildClient.consume has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), ternaries 1 (2 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.
skill-active.listActiveSkills (cognitive 19) src/state/skill-active.ts:221— skill-active.listActiveSkills has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (7 pts), loops 1 (2 pts) (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.
ui.applyInteractiveSelectionKey (cognitive 19) src/question/ui.ts:173— ui.applyInteractiveSelectionKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 1 (3 pts), boolean chains 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.
terminal-normalization.normalizeTerminalWorkflowState (cognitive 19) src/state/terminal-normalization.ts:96— terminal-normalization.normalizeTerminalWorkflowState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render.renderUltragoal (cognitive 19) src/hud/render.ts:267— render.renderUltragoal has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11, boolean chains 5, if/else 3. Of this number, 13 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
reconcile.assessOwnedHudLayout (cognitive 19) src/hud/reconcile.ts:40— reconcile.assessOwnedHudLayout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 7. Of this number, 15 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tmux-session.isWorkerAlive (cognitive 19) src/team/tmux-session.ts:4009— tmux-session.isWorkerAlive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 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.
runtime.persistGonePaneDescendantCleanupDebt (cognitive 19) src/team/runtime.ts:3116— runtime.persistGonePaneDescendantCleanupDebt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 pts), loops 1 (2 pts), boolean chains 1, 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.
runtime.reconcileGonePaneDescendantCleanupDebt (cognitive 19) src/team/runtime.ts:3238— runtime.reconcileGonePaneDescendantCleanupDebt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (7 pts), error handling 1, loops 1 (nesting depth added 9). Of this number, 12 points are the body's own statements and 7 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.
runtime.resolveEffectiveWorkerCliForStartupLog (cognitive 19) src/team/runtime.ts:3432— runtime.resolveEffectiveWorkerCliForStartupLog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1 (nesting depth added 11). Of this number, 12 points are the body's own statements and 7 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.
api-interop.buildStallState (cognitive 19) src/team/api-interop.ts:342— api-interop.buildStallState has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 4 (5 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.
followup.withQueueLock (cognitive 19) src/exec/followup.ts:178— followup.withQueueLock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 2 (5 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.cleanupPluginModeLegacyPrompts (cognitive 19) src/cli/setup.ts:3556— setup.cleanupPluginModeLegacyPrompts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
uninstall.removeAgentsMd (cognitive 19) src/cli/uninstall.ts:822— uninstall.removeAgentsMd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 1 (2 pts), boolean chains 1, 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.
runtime.latestCompatibleRoleLane (cognitive 19) src/ralplan/runtime.ts:249— runtime.latestCompatibleRoleLane has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agents-overlay.readActiveModes (cognitive 19) src/hooks/agents-overlay.ts:195— agents-overlay.readActiveModes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, ternaries 3 (4 pts), 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.
keyword-detector.detectImplicitKeywords (cognitive 19) src/hooks/keyword-detector.ts:3416— keyword-detector.detectImplicitKeywords has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). 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.
codex-native-pre-post.parseGitCommitCommand (cognitive 19) src/scripts/codex-native-pre-post.ts:796— codex-native-pre-post.parseGitCommitCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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.
codex-native-hook.classifyRalplanBeadsMetadataCommand (cognitive 19) src/scripts/codex-native-hook.ts:4865— codex-native-hook.classifyRalplanBeadsMetadataCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (nesting depth added 3). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractCommandLiteralAssignments (cognitive 19) src/scripts/codex-native-hook.ts:4999— codex-native-hook.extractCommandLiteralAssignments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractInvokedShellFunctionBodiesForStateScan (cognitive 19) src/scripts/codex-native-hook.ts:8056— codex-native-hook.extractInvokedShellFunctionBodiesForStateScan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasExistingDurableDeepInterviewHandoffEvidence (cognitive 19) src/scripts/codex-native-hook.ts:9216— codex-native-hook.hasExistingDurableDeepInterviewHandoffEvidence has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), error handling 1 (3 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseConductorWgetExecuteTargets (cognitive 19) src/scripts/codex-native-hook.ts:14499— codex-native-hook.parseConductorWgetExecuteTargets has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 7, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolveConductorCommandIndex (cognitive 19) src/scripts/codex-native-hook.ts:16956— codex-native-hook.resolveConductorCommandIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.createNestedExecChildFunctions (cognitive 19) src/scripts/codex-native-hook.ts:18765— codex-native-hook.createNestedExecChildFunctions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
http-client.noProxyMatches (cognitive 19) REDACTED:89— http-client.noProxyMatches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, 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.
template-engine.computeTemplateVariables (cognitive 19) src/notifications/template-engine.ts:88— template-engine.computeTemplateVariables has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 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.
process-tree.runProcessTreeWithTimeout (cognitive 19) src/runtime/process-tree.ts:112— process-tree.runProcessTreeWithTimeout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 19 points belong to 10 function literals inside it that branch (lines 129, 175, 185, …). 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.
index.resolveSetupAgentsMergePolicyArg (cognitive 19) src/cli/index.ts:546— index.resolveSetupAgentsMergePolicyArg has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 1 (nesting depth added 5). Of this number, 15 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.
index.persistProjectLaunchRuntimeJsonlArtifact (cognitive 19) src/cli/index.ts:1543— index.persistProjectLaunchRuntimeJsonlArtifact has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), ternaries 3 (6 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.
hook-derived-watcher.pollFiles (cognitive 19) src/scripts/hook-derived-watcher.ts:543— hook-derived-watcher.pollFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
team-dispatch.withLockDirectory (cognitive 19) src/scripts/notify-hook/team-dispatch.ts:283— team-dispatch.withLockDirectory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 4 (8 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.
state-paths.normalizeSessionMetadata (cognitive 18) src/mcp/state-paths.ts:776— state-paths.normalizeSessionMetadata has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12, boolean chains 5, if/else 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.
session.classifySessionProcessForRecovery (cognitive 18) src/hooks/session.ts:1986— session.classifySessionProcessForRecovery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 2 (4 pts), 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.
dispatch.normalizeBridgeDispatchRecord (cognitive 18) src/team/state/dispatch.ts:211— dispatch.normalizeBridgeDispatchRecord has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10, boolean chains 7, if/else 1. Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
generator.parseTomlSourceKeySegment (cognitive 18) src/config/generator.ts:1555— generator.parseTomlSourceKeySegment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 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.
generator.managedMarkerTrustStateConflicts (cognitive 18) src/config/generator.ts:2663— generator.managedMarkerTrustStateConflicts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
contracts.parseSimpleYamlFrontmatter (cognitive 18) src/autoresearch/contracts.ts:93— contracts.parseSimpleYamlFrontmatter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, 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.
documented-leader-preflight.neutralizeOwnedRoutingRalplan (cognitive 18) src/ralplan/documented-leader-preflight.ts:221— documented-leader-preflight.neutralizeOwnedRoutingRalplan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 2 (3 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.
mode-binding-lease.resolveValidatedCanonicalModeBinding (cognitive 18) src/state/mode-binding-lease.ts:74— mode-binding-lease.resolveValidatedCanonicalModeBinding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2, 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.
tmux.recoverHudSplitPaneId (cognitive 18) src/hud/tmux.ts:1669— tmux.recoverHudSplitPaneId has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quality-gates.normalizeGateEntry (cognitive 18) src/config/quality-gates.ts:122— quality-gates.normalizeGateEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4 (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.
plugin-marketplace.readOmxPluginCacheLivePinMutationLock (cognitive 18) src/cli/plugin-marketplace.ts:874— plugin-marketplace.readOmxPluginCacheLivePinMutationLock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 2 (nesting depth added 3). Of this number, 15 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.
plugin-marketplace.computeOmxPluginCacheClaimDigest::visit (cognitive 18) src/cli/plugin-marketplace.ts:1891— plugin-marketplace.computeOmxPluginCacheClaimDigest::visit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 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.
doctor.checkProcessIdentityReadiness (cognitive 18) REDACTED:1416— doctor.checkProcessIdentityReadiness has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 2, if/else 2, 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.
doctor.checkPluginVersionDiagnostics (cognitive 18) REDACTED:3784— doctor.checkPluginVersionDiagnostics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (8 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.stripLocalOmxPluginEnablementForDisable (cognitive 18) src/cli/setup.ts:3953— setup.stripLocalOmxPluginEnablementForDisable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 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.
uninstall.assertControlledTopologyCurrent (cognitive 18) src/cli/uninstall.ts:328— uninstall.assertControlledTopologyCurrent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, error handling 1 (2 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.
uninstall.parseNotifyMetadata (cognitive 18) src/cli/uninstall.ts:500— uninstall.parseNotifyMetadata has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
uninstall.restoreFileSnapshot (cognitive 18) src/cli/uninstall.ts:1466— uninstall.restoreFileSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 2 (8 pts), error handling 2 (5 pts), if/else 3 (4 pts), boolean chains 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.
authority.validateAuthorityState (cognitive 18) src/hud/authority.ts:141— authority.validateAuthorityState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.hudCommand (cognitive 18) src/hud/index.ts:600— index.hudCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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.
index.parseSidecarArgs (cognitive 18) src/sidecar/index.ts:34— index.parseSidecarArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
followup-planner.pickSpecialistRole (cognitive 18) src/team/followup-planner.ts:218— followup-planner.pickSpecialistRole has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 2 (4 pts) (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.
artifacts.hasProtectedSteeringPayload (cognitive 18) src/ultragoal/artifacts.ts:1225— artifacts.hasProtectedSteeringPayload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript.resolveSessionTranscript (cognitive 18) src/session-history/transcript.ts:77— transcript.resolveSessionTranscript has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (6 pts), 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.
timeline.summarize (cognitive 18) src/session-history/timeline.ts:148— timeline.summarize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agents-overlay.generateOverlay (cognitive 18) src/hooks/agents-overlay.ts:336— agents-overlay.generateOverlay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
keyword-detector.collectInlineCodeRanges (cognitive 18) src/hooks/keyword-detector.ts:1510— keyword-detector.collectInlineCodeRanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 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.
keyword-detector.balancedMarkdownLinkRange (cognitive 18) src/hooks/keyword-detector.ts:2335— keyword-detector.balancedMarkdownLinkRange has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keyword-detector.boundedPredecessorRanges (cognitive 18) src/hooks/keyword-detector.ts:2456— keyword-detector.boundedPredecessorRanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (nesting depth added 6). Of this number, 15 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.
team-worker.readTeamWorkersForIdleCheck (cognitive 18) src/scripts/notify-hook/team-worker.ts:206— team-worker.readTeamWorkersForIdleCheck has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, 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.
team-worker-stop.ensureDirectoryUnderExistingTeam (cognitive 18) src/scripts/notify-hook/team-worker-stop.ts:78— team-worker-stop.ensureDirectoryUnderExistingTeam has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-native-hook.parseUserPromptUltragoalSteeringDirective (cognitive 18) src/scripts/codex-native-hook.ts:819— codex-native-hook.parseUserPromptUltragoalSteeringDirective has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 3 (7 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.firstShellScriptOperands (cognitive 18) src/scripts/codex-native-hook.ts:6115— codex-native-hook.firstShellScriptOperands has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.pythonInvocationHomeHasLoadableStartupCandidate (cognitive 18) src/scripts/codex-native-hook.ts:6200— codex-native-hook.pythonInvocationHomeHasLoadableStartupCandidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.normalizeShellLineContinuations (cognitive 18) src/scripts/codex-native-hook.ts:7262— codex-native-hook.normalizeShellLineContinuations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.hasConductorPromptParameterTransform (cognitive 18) src/scripts/codex-native-hook.ts:8850— codex-native-hook.hasConductorPromptParameterTransform has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.parseStaticJavaScriptString (cognitive 18) src/scripts/codex-native-hook.ts:11420— codex-native-hook.parseStaticJavaScriptString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, 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 file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorDownloaderOutputTargets::finalizeCurlTransfer (cognitive 18) src/scripts/codex-native-hook.ts:14913— codex-native-hook.collectConductorDownloaderOutputTargets::finalizeCurlTransfer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (codex-native-hook.collectConductorDownloaderOutputTargets) 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.commandHasUnsafeConductorOrchestrationPrefixEnvironment (cognitive 18) src/scripts/codex-native-hook.ts:16380— codex-native-hook.commandHasUnsafeConductorOrchestrationPrefixEnvironment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 1 (nesting depth added 5). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 16385). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findConductorIsolatedInvocationBoundary (cognitive 18) src/scripts/codex-native-hook.ts:16636— codex-native-hook.findConductorIsolatedInvocationBoundary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorExecutableHasTrustedSystemIdentity (cognitive 18) src/scripts/codex-native-hook.ts:17620— codex-native-hook.conductorExecutableHasTrustedSystemIdentity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 2, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.resolveSetupTeamModeArg (cognitive 18) src/cli/index.ts:724— index.resolveSetupTeamModeArg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (nesting depth added 6). Of this number, 15 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.
index.completePreLaunchSetup (cognitive 18) src/cli/index.ts:8032— index.completePreLaunchSetup has cognitive complexity 18 (threshold 15). Drivers by points: error handling 8, if/else 4, loops 2 (4 pts), ternaries 2 (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.
team-dispatch.runtimeExec (cognitive 18) src/scripts/notify-hook/team-dispatch.ts:40— team-dispatch.runtimeExec has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, 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.
notify-fallback-watcher.withRalphSteerLock (cognitive 18) src/scripts/notify-fallback-watcher.ts:869— notify-fallback-watcher.withRalphSteerLock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, ternaries 1 (3 pts), error handling 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.
notify-fallback-watcher.enforceLifecycleGuards (cognitive 18) src/scripts/notify-fallback-watcher.ts:1485— notify-fallback-watcher.enforceLifecycleGuards has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5 (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.
notify-fallback-watcher.pollFiles (cognitive 18) src/scripts/notify-fallback-watcher.ts:1797— notify-fallback-watcher.pollFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processStartHashForPid (cognitive 18) plugins/oh-my-codex/hooks/codex-native-hook.mjs:598— processStartHashForPid has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 1, other 1, ternaries 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.
config.inspectOpenClawConfig (cognitive 17) src/openclaw/config.ts:209— config.inspectOpenClawConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (6 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
codex-hooks.decodeGeneratedWindowsProcessArgument (cognitive 17) src/config/codex-hooks.ts:271— codex-hooks.decodeGeneratedWindowsProcessArgument has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 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.
codex-hooks.containsRustUnsupportedJavaScriptMatcherSyntax (cognitive 17) src/config/codex-hooks.ts:729— codex-hooks.containsRustUnsupportedJavaScriptMatcherSyntax has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, 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.
codex-hooks.exactLegacyState (cognitive 17) src/config/codex-hooks.ts:2453— codex-hooks.exactLegacyState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 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.
archive.zipEntryType (cognitive 17) src/native-assets/archive.ts:85— archive.zipEntryType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native-assets.inspectLock (cognitive 17) src/cli/native-assets.ts:526— native-assets.inspectLock has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 2 (3 pts), boolean chains 2, 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.
session.observeLinuxProcess (cognitive 17) src/hooks/session.ts:748— session.observeLinuxProcess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 3, 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.
session.updateDetachedSessionMetadata (cognitive 17) src/hooks/session.ts:3186— session.updateDetachedSessionMetadata has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 3, error handling 2 (nesting depth added 2). Of this number, 10 points are the body's own statements and 7 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.
completion-evidence.validateCompletionEvidence (cognitive 17) src/team/completion-evidence.ts:12— completion-evidence.validateCompletionEvidence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, 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.
mailbox.needsLegacyMailboxEvidence (cognitive 17) src/team/state/mailbox.ts:83— mailbox.needsLegacyMailboxEvidence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 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.
dispatch.enqueueDispatchRequest (cognitive 17) src/team/state/dispatch.ts:264— dispatch.enqueueDispatchRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 274). 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.
monitor.normalizeWorkerIntegrationState (cognitive 17) src/team/state/monitor.ts:103— monitor.normalizeWorkerIntegrationState has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 8, if/else 1. 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: 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.
locks.withMailboxLock (cognitive 17) src/team/state/locks.ts:213— locks.withMailboxLock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 3 (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.
coordination-protocol.normalizeTeamTaskCoordinationPlanForStorage (cognitive 17) src/team/coordination-protocol.ts:276— coordination-protocol.normalizeTeamTaskCoordinationPlanForStorage has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 5, if/else 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
generator.projectTrustCandidateIsSafe (cognitive 17) src/config/generator.ts:1350— generator.projectTrustCandidateIsSafe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs 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.
tmux-hook-engine.resolveCodexPane (cognitive 17) src/scripts/tmux-hook-engine.ts:205— tmux-hook-engine.resolveCodexPane has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, error handling 2, loops 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.
tracker.readCrossProcessLockState (cognitive 17) src/subagents/tracker.ts:529— tracker.readCrossProcessLockState has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 5, if/else 2 (3 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.
skill-active.inspectLockOwner (cognitive 17) src/state/skill-active.ts:420— skill-active.inspectLockOwner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (nesting depth added 4). Of this number, 15 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.
skill-active.updateSkillActiveStateCopiesForExactSessionTransaction (cognitive 17) src/state/skill-active.ts:742— skill-active.updateSkillActiveStateCopiesForExactSessionTransaction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (5 pts), ternaries 2 (nesting depth added 6). 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 756). 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.
state.normalizeHudConfig (cognitive 17) REDACTED:225— state.normalizeHudConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4 (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.
advisory.commitBoundActivationIntent (cognitive 17) src/ralplan/advisory.ts:130— advisory.commitBoundActivationIntent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 6, boolean chains 4 (nesting depth added 3). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 138). 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.
tmux-hook.showTmuxHookStatus (cognitive 17) src/cli/tmux-hook.ts:383— tmux-hook.showTmuxHookStatus has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 4 (5 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.
scaling.recoverCreatedWorktreeAfterEnsureFailure (cognitive 17) src/team/scaling.ts:393— scaling.recoverCreatedWorktreeAfterEnsureFailure has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 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.
events.normalizeRawTeamEvent (cognitive 17) src/team/state/events.ts:22— events.normalizeRawTeamEvent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 3, if/else 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.
active-team.listNotifyCanonicalActiveTeams (cognitive 17) src/scripts/notify-hook/active-team.ts:17— active-team.listNotifyCanonicalActiveTeams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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.
plugin-marketplace.copyStagedTreeNoReplace (cognitive 17) src/cli/plugin-marketplace.ts:389— plugin-marketplace.copyStagedTreeNoReplace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, 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.
plugin-marketplace.hasLiveSessionPinRecord (cognitive 17) src/cli/plugin-marketplace.ts:1247— plugin-marketplace.hasLiveSessionPinRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 2 (3 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.
plugin-marketplace.readOmxPluginCacheState (cognitive 17) src/cli/plugin-marketplace.ts:3352— plugin-marketplace.readOmxPluginCacheState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 5, boolean chains 4. 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.
doctor.configEnablesPluginScopedHooks (cognitive 17) REDACTED:2272— doctor.configEnablesPluginScopedHooks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.restoreNativeHookTransactionArtifact (cognitive 17) src/cli/setup.ts:1834— setup.restoreNativeHookTransactionArtifact has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (8 pts), error handling 2 (5 pts), if/else 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.
setup.parseSkillFrontmatter (cognitive 17) src/cli/setup.ts:2593— setup.parseSkillFrontmatter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.resolveSetupInstallMode (cognitive 17) src/cli/setup.ts:3370— setup.resolveSetupInstallMode has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 5 (6 pts), boolean chains 4 (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.
setup.stripHookFeatureFlagsForDisable (cognitive 17) src/cli/setup.ts:3984— setup.stripHookFeatureFlagsForDisable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
authority.runHudAuthorityTick (cognitive 17) src/hud/authority.ts:342— authority.runHudAuthorityTick has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3, ternaries 2 (3 pts), boolean chains 2 (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.
index.ipv6ToBigInt (cognitive 17) src/url-reader/index.ts:380— index.ipv6ToBigInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
package-manager-ownership.resolvePackageManagerOwnership (cognitive 17) src/cli/package-manager-ownership.ts:336— package-manager-ownership.resolvePackageManagerOwnership has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (2 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
team-tmux-guard.queuePaneInput (cognitive 17) src/scripts/notify-hook/team-tmux-guard.ts:588— team-tmux-guard.queuePaneInput has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
codex-native-hook.parseWindowsProcessLineage (cognitive 17) src/scripts/codex-native-hook.ts:1568— codex-native-hook.parseWindowsProcessLineage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 2, ternaries 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.resolveSessionOwnerPidFromAncestry (cognitive 17) src/scripts/codex-native-hook.ts:1666— codex-native-hook.resolveSessionOwnerPidFromAncestry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (2 pts) (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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findPackageInstallSubcommandIndex (cognitive 17) src/scripts/codex-native-hook.ts:5410— codex-native-hook.findPackageInstallSubcommandIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isShellFunctionInvokedFromWords (cognitive 17) src/scripts/codex-native-hook.ts:6051— codex-native-hook.isShellFunctionInvokedFromWords has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.containsUnquotedProcessSubstitution (cognitive 17) src/scripts/codex-native-hook.ts:8603— codex-native-hook.containsUnquotedProcessSubstitution has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectShellCliInvocations (cognitive 17) src/scripts/codex-native-hook.ts:12457— codex-native-hook.collectShellCliInvocations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 8). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectConductorPerlTargets (cognitive 17) src/scripts/codex-native-hook.ts:15437— codex-native-hook.collectConductorPerlTargets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.applyStaticExpansionStateEffects (cognitive 17) src/scripts/codex-native-hook.ts:17311— codex-native-hook.applyStaticExpansionStateEffects has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorResolvePathInterpreter (cognitive 17) src/scripts/codex-native-hook.ts:17763— codex-native-hook.conductorResolvePathInterpreter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.conductorTrustedScriptInterpreterIsSafe (cognitive 17) src/scripts/codex-native-hook.ts:17783— codex-native-hook.conductorTrustedScriptInterpreterIsSafe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.collectStaticNestedShellTargetAliases (cognitive 17) src/scripts/codex-native-hook.ts:20083— codex-native-hook.collectStaticNestedShellTargetAliases has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findCanonicalActiveTeamForSession (cognitive 17) src/scripts/codex-native-hook.ts:21281— codex-native-hook.findCanonicalActiveTeamForSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.isResumeCodexLaunch (cognitive 17) src/cli/index.ts:2406— index.isResumeCodexLaunch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.readMadmaxDetachedActiveRecord (cognitive 17) src/cli/index.ts:4243— index.readMadmaxDetachedActiveRecord has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 3, if/else 2, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.startHookDerivedWatcher (cognitive 17) src/cli/index.ts:9843— index.startHookDerivedWatcher has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 5 (6 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 5). Of this number, 15 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.
smoke-packed-install.appendForeignHookGroups (cognitive 17) src/scripts/smoke-packed-install.ts:1141— smoke-packed-install.appendForeignHookGroups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). Of this number, 14 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.
smoke-packed-install.appendDisplayOrderStableForeignHookGroups (cognitive 17) src/scripts/smoke-packed-install.ts:1195— smoke-packed-install.appendDisplayOrderStableForeignHookGroups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sync-prompt-guidance-fragments.main (cognitive 17) src/scripts/sync-prompt-guidance-fragments.ts:14— sync-prompt-guidance-fragments.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transport.ndjsonExchange (cognitive 16) src/adapt/herdr/transport.ts:325— transport.ndjsonExchange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 353, 335, 349). 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.
sanitize.sanitizeMetadata (cognitive 16) src/adapt/herdr/sanitize.ts:47— sanitize.sanitizeMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
seq-store.acquireLock (cognitive 16) src/adapt/herdr/seq-store.ts:78— seq-store.acquireLock has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 2 (6 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.
platform-command.resolveWindowsCommandPath (cognitive 16) src/utils/platform-command.ts:119— platform-command.resolveWindowsCommandPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (8 pts) (nesting depth added 8). Of this number, 12 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.
locks.withScalingLock (cognitive 16) src/team/state/locks.ts:69— locks.withScalingLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (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. This shape REPEATS in the file: one other method here (locks.withTeamLock) 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.
locks.withTeamLock (cognitive 16) src/team/state/locks.ts:119— locks.withTeamLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (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. This shape REPEATS in the file: one other method here (locks.withScalingLock) 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.
coordination-protocol.normalizeTeamTaskCoordinationPlanForRender (cognitive 16) src/team/coordination-protocol.ts:236— coordination-protocol.normalizeTeamTaskCoordinationPlanForRender has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, 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.
state.writeMailbox (cognitive 16) src/team/state.ts:2092— state.writeMailbox has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 5, if/else 2 (3 pts), loops 2 (nesting depth added 3). 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.
generator.stripLegacyOmxTeamRunTable (cognitive 16) src/config/generator.ts:305— generator.stripLegacyOmxTeamRunTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generator.upsertFeatureFlagLineInSection (cognitive 16) src/config/generator.ts:831— generator.upsertFeatureFlagLineInSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 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.
generator.dedupeTuiTables (cognitive 16) src/config/generator.ts:3768— generator.dedupeTuiTables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-outcome.applyRunOutcomeContract (cognitive 16) src/runtime/run-outcome.ts:307— run-outcome.applyRunOutcomeContract has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), 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.
skill-active.normalizeSkillActiveState (cognitive 16) src/state/skill-active.ts:328— skill-active.normalizeSkillActiveState has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, ternaries 3, if/else 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.
advisory-evidence.canonicalArtifactPath (cognitive 16) src/ralplan/advisory-evidence.ts:205— advisory-evidence.canonicalArtifactPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1, ternaries 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.
advisory-evidence.digestAdvisoryArtifacts (cognitive 16) src/ralplan/advisory-evidence.ts:263— advisory-evidence.digestAdvisoryArtifacts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 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.
events.withQuestionEventLock (cognitive 16) src/question/events.ts:55— events.withQuestionEventLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (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.
tmux.reapDeadHudPanes (cognitive 16) src/hud/tmux.ts:705— tmux.reapDeadHudPanes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tmux.readHudResizeHookPaneIncarnations (cognitive 16) src/hud/tmux.ts:953— tmux.readHudResizeHookPaneIncarnations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1, 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.
tmux.unregisterHudResizeHook (cognitive 16) src/hud/tmux.ts:2244— tmux.unregisterHudResizeHook has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), error handling 3 (4 pts), boolean chains 3, ternaries 3, loops 1 (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.
hook-config.getHookConfig (cognitive 16) src/notifications/hook-config.ts:33— hook-config.getHookConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ui.applyQuestionWizardKey (cognitive 16) src/question/ui.ts:276— ui.applyQuestionWizardKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 2 (nesting depth added 3). 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, 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.
renderer.readPersistedQuestionReturnTarget (cognitive 16) src/question/renderer.ts:553— renderer.readPersistedQuestionReturnTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 2 (5 pts), loops 3 (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.
state.withQuestionSubmitLock (cognitive 16) src/question/state.ts:256— state.withQuestionSubmitLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (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.
autopilot-wait.withAutopilotQuestionWaitLock (cognitive 16) src/question/autopilot-wait.ts:91— autopilot-wait.withAutopilotQuestionWaitLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (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.
skill-validation.assessAutoresearchCompletionState (cognitive 16) src/autoresearch/skill-validation.ts:124— skill-validation.assessAutoresearchCompletionState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
render.wrapHudParts (cognitive 16) src/hud/render.ts:489— render.wrapHudParts has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reconcile.acquireHudReconcileLock (cognitive 16) src/hud/reconcile.ts:374— reconcile.acquireHudReconcileLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (5 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tmux-session.captureSourcePaneAuthority (cognitive 16) src/team/tmux-session.ts:291— tmux-session.captureSourcePaneAuthority has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tmux-session.killWorker (cognitive 16) src/team/tmux-session.ts:4087— tmux-session.killWorker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ultragoal-context.resolveLeaderOwnedUltragoalContextOutcome (cognitive 16) src/team/ultragoal-context.ts:125— ultragoal-context.resolveLeaderOwnedUltragoalContextOutcome has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5 (6 pts), boolean chains 2, error handling 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: 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.
hermes-bridge.hermesSendPrompt (cognitive 16) src/mcp/hermes-bridge.ts:428— hermes-bridge.hermesSendPrompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), 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.
api.resolveApiBinaryPathWithHydration (cognitive 16) src/cli/api.ts:136— api.resolveApiBinaryPathWithHydration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
autoresearch-intake.resolveAutoresearchDeepInterviewResult (cognitive 16) src/cli/autoresearch-intake.ts:409— autoresearch-intake.resolveAutoresearchDeepInterviewResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
autoresearch-guided.promptAction (cognitive 16) src/cli/autoresearch-guided.ts:112— autoresearch-guided.promptAction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plugin-marketplace.createLivePinRetirementGate (cognitive 16) src/cli/plugin-marketplace.ts:1621— plugin-marketplace.createLivePinRetirementGate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), boolean chains 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.
plugin-marketplace.reclaimStalePublicationLock (cognitive 16) src/cli/plugin-marketplace.ts:2648— plugin-marketplace.reclaimStalePublicationLock has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 3 (4 pts), ternaries 2 (4 pts), boolean chains 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.
plugin-marketplace.omxPluginCacheManifestProvenanceReason (cognitive 16) src/cli/plugin-marketplace.ts:2804— plugin-marketplace.omxPluginCacheManifestProvenanceReason has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, error handling 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.
plugin-marketplace.inspectCacheRoot (cognitive 16) src/cli/plugin-marketplace.ts:3128— plugin-marketplace.inspectCacheRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 2 (3 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup.canonicalizePathToRealForm (cognitive 16) src/cli/setup.ts:2237— setup.canonicalizePathToRealForm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.resolveHudWatchCwd (cognitive 16) src/hud/index.ts:162— index.resolveHudWatchCwd has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 1 (2 pts) (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.
collector.buildHighlights (cognitive 16) src/sidecar/collector.ts:324— collector.buildHighlights has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
team.persistTeamShutdownModeState (cognitive 16) REDACTED:1316— team.persistTeamShutdownModeState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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.
runtime-advisory-lifecycle.terminalizeAdvisory (cognitive 16) src/ralplan/runtime-advisory-lifecycle.ts:157— runtime-advisory-lifecycle.terminalizeAdvisory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 belong to 2 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.
artifacts.extractArchitectureInvariantsFromArtifact (cognitive 16) src/ultragoal/artifacts.ts:1585— artifacts.extractArchitectureInvariantsFromArtifact has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 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.
sparkshell.resolveSparkShellBinaryPathWithHydration (cognitive 16) REDACTED:140— sparkshell.resolveSparkShellBinaryPathWithHydration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
project-runtime-codex-homes.discoverAssociatedMadmaxRunDirs (cognitive 16) src/cli/project-runtime-codex-homes.ts:76— project-runtime-codex-homes.discoverAssociatedMadmaxRunDirs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 4). Of this number, 11 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.
search.listRolloutFiles (cognitive 16) src/session-history/search.ts:147— search.listRolloutFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). 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.
session-search.parseSessionLockArgs (cognitive 16) src/cli/session-search.ts:86— session-search.parseSessionLockArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
auto-nudge.normalizeAutoNudgeConfig (cognitive 16) src/scripts/notify-hook/auto-nudge.ts:478— auto-nudge.normalizeAutoNudgeConfig has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 6 (7 pts), if/else 1 (nesting depth added 1). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
codex-native-pre-post.skipEnvWrapper (cognitive 16) src/scripts/codex-native-pre-post.ts:1398— codex-native-pre-post.skipEnvWrapper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 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.
team-worker-posttooluse.checkpointIfEligible (cognitive 16) src/scripts/notify-hook/team-worker-posttooluse.ts:338— team-worker-posttooluse.checkpointIfEligible has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, boolean chains 1 (nesting depth added 4). 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.
team-worker-posttooluse.handleTeamWorkerPostToolUseSuccess (cognitive 16) src/scripts/notify-hook/team-worker-posttooluse.ts:393— team-worker-posttooluse.handleTeamWorkerPostToolUseSuccess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 2 (3 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.
codex-native-hook.isNativeSubagentHook (cognitive 16) src/scripts/codex-native-hook.ts:577— codex-native-hook.isNativeSubagentHook has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.extractBalancedJsonObject (cognitive 16) src/scripts/codex-native-hook.ts:779— codex-native-hook.extractBalancedJsonObject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.buildModeBasedStopOutput (cognitive 16) src/scripts/codex-native-hook.ts:3204— codex-native-hook.buildModeBasedStopOutput has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), boolean chains 5, if/else 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.findCompletedGoalWorkflowCleanupNotice (cognitive 16) src/scripts/codex-native-hook.ts:3349— codex-native-hook.findCompletedGoalWorkflowCleanupNotice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 2, 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.omxOrGjcReadOnlyShapeMatches (cognitive 16) src/scripts/codex-native-hook.ts:10041— codex-native-hook.omxOrGjcReadOnlyShapeMatches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isConductorPipelineMember (cognitive 16) src/scripts/codex-native-hook.ts:16136— codex-native-hook.isConductorPipelineMember has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isInsideCertainlySkippedConductorIfBranch (cognitive 16) src/scripts/codex-native-hook.ts:16211— codex-native-hook.isInsideCertainlySkippedConductorIfBranch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). 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. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
codex-native-hook.isConductorSafeRsyncMetadataControl (cognitive 16) src/scripts/codex-native-hook.ts:19955— codex-native-hook.isConductorSafeRsyncMetadataControl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This file is where this pass's cognitive complexity CONCENTRATES: src/scripts/codex-native-hook.ts holds 212 of the 856 methods over the threshold — including the worst — and 6154 of the 20370 points over it (30%), 5.8× the next-largest file (src/team/runtime.ts at 1062). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
index.resolveSetupMcpModeArg (cognitive 16) src/cli/index.ts:648— index.resolveSetupMcpModeArg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). Of this number, 13 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.
index.readDetachedLeaderReport (cognitive 16) src/cli/index.ts:6833— index.readDetachedLeaderReport has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 6, 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.
index.parseDetachedHudAuthorityProof (cognitive 16) src/cli/index.ts:8914— index.parseDetachedHudAuthorityProof has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, 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.
suite.validateFixture (cognitive 16) src/evals/astra-defaults/suite.ts:159— suite.validateFixture has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 2 (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.
generate-release-body.normalizeContributors (cognitive 16) src/scripts/generate-release-body.ts:121— generate-release-body.normalizeContributors has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), boolean chains 5, if/else 2 (4 pts), loops 1 (nesting depth added 6). Of this number, 14 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.
team-leader-nudge.maybeNudgeTeamLeader::persistLeaderNudgeBookkeeping (cognitive 16) src/scripts/notify-hook/team-leader-nudge.ts:914— team-leader-nudge.maybeNudgeTeamLeader::persistLeaderNudgeBookkeeping has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), error handling 2, ternaries 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent 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 (team-leader-nudge.maybeNudgeTeamLeader) 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.
mode-binding-lease-helper.ownerIsDead (cognitive 16) src/state/mode-binding-lease-helper.ts:221— mode-binding-lease-helper.ownerIsDead has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 2 (4 pts), 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.
hasPendingSessionRegistration (cognitive 16) plugins/oh-my-codex/hooks/codex-native-hook.mjs:906— hasPendingSessionRegistration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, error handling 3 (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.
ClassTooLong: setup src/cli/setup.ts:1— ClassTooLong — 933 significant lines (blank, comment-only and punctuation-only lines excluded), 176 methods. The bar is 400 significant lines; this is 533 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: RuntimeEngine.process crates/omx-runtime-core/src/engine.rs:134— MethodTooLong — process runs 114 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×1
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/omx-api/src/lib.rs:1250— crates/omx-api/src/lib.rs:1250-1287 | crates/omx-api/src/lib.rs:1289-1326 | crates/omx-api/src/lib.rs:1332-1383 | crates/omx-api/src/lib.rs:1858-1876 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (19 lines × 2) src/scripts/eval/eval-noisy-bayesopt-highdim.py:13— src/scripts/eval/eval-noisy-bayesopt-highdim.py:13-31 | src/scripts/eval/eval-noisy-latent-subspace-discovery.py:13-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (53–54 lines × 2) crates/omx-api/src/lib.rs:311— crates/omx-api/src/lib.rs:311-364 | crates/omx-sparkshell/src/redaction.rs:75-127 — before extracting anything, compare `crates/omx-api/src/lib.rs` and `crates/omx-sparkshell/src/redaction.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (35 lines × 2) crates/omx-runtime-core/src/dispatch.rs:297— crates/omx-runtime-core/src/dispatch.rs:297-331 | crates/omx-runtime-core/src/mailbox.rs:197-231 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (30 lines × 3) crates/omx-api/src/lib.rs:1255— crates/omx-api/src/lib.rs:1255-1284 | crates/omx-api/src/lib.rs:1294-1323 | crates/omx-api/src/lib.rs:1351-1380 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 2) crates/omx-api/src/lib.rs:368— crates/omx-api/src/lib.rs:368-388 | crates/omx-sparkshell/src/redaction.rs:131-151 — before extracting anything, compare `crates/omx-api/src/lib.rs` and `crates/omx-sparkshell/src/redaction.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–17 lines × 2) crates/omx-runtime-core/src/dispatch.rs:277— crates/omx-runtime-core/src/dispatch.rs:277-293 | crates/omx-runtime-core/src/mailbox.rs:181-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/omx-api/src/lib.rs:406— crates/omx-api/src/lib.rs:406-416 | crates/omx-sparkshell/src/redaction.rs:171-181 — before extracting anything, compare `crates/omx-api/src/lib.rs` and `crates/omx-sparkshell/src/redaction.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 3) crates/omx-runtime/src/main.rs:207— crates/omx-runtime/src/main.rs:207-216 | crates/omx-runtime/src/main.rs:244-253 | crates/omx-runtime/src/main.rs:267-274 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 2) crates/omx-api/src/lib.rs:1451— crates/omx-api/src/lib.rs:1451-1458 | crates/omx-api/src/lib.rs:1508-1515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 4) crates/omx-api/src/lib.rs:1274— crates/omx-api/src/lib.rs:1274-1279 | crates/omx-api/src/lib.rs:1313-1318 | crates/omx-api/src/lib.rs:1370-1375 | crates/omx-api/src/lib.rs:1864-1869 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 2) crates/omx-api/src/lib.rs:1593— crates/omx-api/src/lib.rs:1593-1602 | crates/omx-sparkshell/src/codex_bridge.rs:319-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 3) crates/omx-sparkshell/src/main.rs:236— crates/omx-sparkshell/src/main.rs:236-244 | crates/omx-sparkshell/src/main.rs:289-297 | crates/omx-sparkshell/src/main.rs:309-317 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Near-duplicate member pair (28 shared lines) playground/bayesopt_highdim_demo/optimizer.py:90— playground/bayesopt_highdim_demo/optimizer.py:90-153 | playground/bayesopt_latent_discovery_demo/optimizer.py:141-214 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Duplicated block (20 lines × 2) playground/bayesopt_highdim_demo/optimizer.py:67— playground/bayesopt_highdim_demo/optimizer.py:67-86 | playground/bayesopt_latent_discovery_demo/optimizer.py:72-91 — `playground/bayesopt_highdim_demo/optimizer.py` and `playground/bayesopt_latent_discovery_demo/optimizer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) playground/bayesopt_highdim_demo/optimizer.py:122— playground/bayesopt_highdim_demo/optimizer.py:122-131 | playground/bayesopt_latent_discovery_demo/optimizer.py:182-190 — `playground/bayesopt_highdim_demo/optimizer.py` and `playground/bayesopt_latent_discovery_demo/optimizer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (4–6 lines × 3) playground/bayesopt_highdim_demo/optimizer.py:92— playground/bayesopt_highdim_demo/optimizer.py:92-97 | playground/bayesopt_latent_discovery_demo/optimizer.py:95-98 | playground/bayesopt_latent_discovery_demo/optimizer.py:143-148 — `playground/bayesopt_highdim_demo/optimizer.py` and `playground/bayesopt_latent_discovery_demo/optimizer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `playground/bayesopt_latent_discovery_demo/optimizer.py:149` calls `get` and `playground/bayesopt_highdim_demo/optimizer.py:98` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) playground/bayesopt_highdim_demo/run_search.py:10— playground/bayesopt_highdim_demo/run_search.py:10-16 | playground/bayesopt_latent_discovery_demo/run_search.py:10-16 — `playground/bayesopt_highdim_demo/run_search.py` and `playground/bayesopt_latent_discovery_demo/run_search.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 7 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the node:test suite in packages/vscode-extension/ ran and not one test passed (> oh-my-codex-vscode@0.5.7 test), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
Hollow method — returns a constant without doing the work src/scripts/codex-native-hook.ts:23079— `buildOversizedStopInactiveWorkflowOutput` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Duplication concentrated across 34 sibling directories (117 clone groups) src/autoresearch/goal.ts:109— 117 duplicated blocks under src/ have copies in at least two of the sibling directories adapt, agents, auth, autopilot, autoresearch, catalog (+28 more sibling(s) not listed) — 73 of them are reported below, and 44 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 117 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 117 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 117 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 3 sibling directories (5 clone groups) plugins/oh-my-codex/hooks/codex-native-hook.mjs:41— 5 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, plugins, src — 2 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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 (262 matched lines × 2 locations) · ×1
Duplicated block with local edits (262 matched lines × 2 locations) src/team/state.ts:84— src/team/state.ts:84 · src/team/state/types.ts:6 — the two spans are one implementation copied and then locally edited — 1176 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 (142 matched lines × 2 locations) · ×1
Duplicated block with local edits (142 matched lines × 2 locations) src/cli/api.ts:34— src/cli/api.ts:34 · REDACTED:34 — the two spans are one implementation copied and then locally edited — 1134 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 (123 matched lines × 2 locations) · ×1
Duplicated block with local edits (123 matched lines × 2 locations) src/cli/autoresearch-goal.ts:39— src/cli/autoresearch-goal.ts:39 · src/cli/performance-goal.ts:43 — the two spans are one implementation copied and then locally edited — 905 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 (120 matched lines × 2 locations) · ×1
Duplicated block with local edits (120 matched lines × 2 locations) src/state/pinned-atomic-file-darwin-helper.ts:28— src/state/pinned-atomic-file-darwin-helper.ts:28 · src/state/pinned-atomic-file-darwin-janitor.ts:29 — the two spans are one implementation copied and then locally edited — 1048 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 (106 matched lines × 2 locations) · ×1
Duplicated block with local edits (106 matched lines × 2 locations) src/autoresearch/goal.ts:109— src/autoresearch/goal.ts:109 · src/performance-goal/artifacts.ts:109 — the two spans are one implementation copied and then locally edited — 863 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 (86 matched lines × 2 locations) · ×1
Duplicated block with local edits (86 matched lines × 2 locations) src/scripts/notify-hook/team-worker.ts:352— src/scripts/notify-hook/team-worker.ts:352 · src/scripts/notify-hook/team-worker.ts:544 — the two spans are one implementation copied and then locally edited — 567 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 (49 lines × 2 locations) src/team/state/locks.ts:69— src/team/state/locks.ts:69 · src/team/state/locks.ts:119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) plugins/oh-my-codex/hooks/codex-native-hook.mjs:41— plugins/oh-my-codex/hooks/codex-native-hook.mjs:41 · src/scripts/hook-payload-guard.ts:27 — the two spans are one implementation copied and then locally edited — 417 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 (47 lines × 2 locations) src/notifications/tmux.ts:86— src/notifications/tmux.ts:86 · src/notifications/tmux.ts:246 — 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 (45 lines × 2 locations) src/team/state.ts:2764— src/team/state.ts:2764 · src/team/state/monitor.ts:33 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication· Duplicated block with local edits (41 matched lines × 2 locations) · ×1
Duplicated block with local edits (41 matched lines × 2 locations) src/config/generator.ts:500— src/config/generator.ts:500 · src/scripts/notify-dispatcher.ts:307 — the two spans are one implementation copied and then locally edited — 268 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 (40 lines × 2 locations) src/team/state.ts:436— src/team/state.ts:436 · src/team/state/types.ts:297 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (39 lines × 2 locations) src/question/events.ts:55— src/question/events.ts:55 · src/question/state.ts:256 — 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 (35 lines × 2 locations) src/config/generator.ts:458— src/config/generator.ts:458 · src/scripts/notify-dispatcher.ts:269 — 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 (34 lines × 2 locations) REDACTED:3679— REDACTED:3679 · REDACTED:3804 — 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 (33 matched lines × 2 locations) · ×1
Duplicated block with local edits (33 matched lines × 2 locations) src/hooks/agents-overlay.ts:60— src/hooks/agents-overlay.ts:60 · src/team/worker-bootstrap.ts:611 — the two spans are one implementation copied and then locally edited — 218 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 (32 lines × 2 locations) src/cli/setup.ts:708— src/cli/setup.ts:708 · src/cli/uninstall.ts:919 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (31 lines × 2 locations) src/scripts/notify-hook/team-leader-nudge.ts:302— src/scripts/notify-hook/team-leader-nudge.ts:302 · src/scripts/notify-hook/team-worker.ts:119 — 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 (29 matched lines × 2 locations) · ×1
Duplicated block with local edits (29 matched lines × 2 locations) REDACTED:496— REDACTED:496 · REDACTED:561 — the two spans are one implementation copied and then locally edited — 158 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 (29 lines × 2 locations) src/scripts/hook-derived-watcher.ts:513— src/scripts/hook-derived-watcher.ts:513 · src/scripts/notify-fallback-watcher.ts:1767 — 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.
Complex function dispatchCodexNativeHook (cyclomatic 326, cognitive 520) src/scripts/codex-native-hook.ts:21948— dispatchCodexNativeHook has cyclomatic complexity 326 and cognitive complexity 520; 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 executeTeamApiOperation (cyclomatic 284, cognitive 321) src/team/api-interop.ts:612— executeTeamApiOperation has cyclomatic complexity 284 and cognitive complexity 321; 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 collectConductorDownloaderOutputTargets (cyclomatic 263, cognitive 492) src/scripts/codex-native-hook.ts:14853— collectConductorDownloaderOutputTargets has cyclomatic complexity 263 and cognitive complexity 492; 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 setup (cyclomatic 239, cognitive 415) src/cli/setup.ts:4449— setup has cyclomatic complexity 239 and cognitive complexity 415; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 205, cognitive 324) · ×1
Complex function main (cyclomatic 205, cognitive 324) src/scripts/notify-hook.ts:612— main has cyclomatic complexity 205 and cognitive complexity 324; 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 scanConductorShellSegment (cyclomatic 190, cognitive 310) src/scripts/codex-native-hook.ts:18826— scanConductorShellSegment has cyclomatic complexity 190 and cognitive complexity 310; 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 inspectConductorRuntimeExecutions (cyclomatic 176, cognitive 343) src/scripts/codex-native-hook.ts:13056— inspectConductorRuntimeExecutions has cyclomatic complexity 176 and cognitive complexity 343; 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 shutdownTeam (cyclomatic 167, cognitive 290) src/team/runtime.ts:5068— shutdownTeam has cyclomatic complexity 167 and cognitive complexity 290; 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 maybeNudgeTeamLeader (cyclomatic 164, cognitive 279) src/scripts/notify-hook/team-leader-nudge.ts:652— maybeNudgeTeamLeader has cyclomatic complexity 164 and cognitive complexity 279; 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 smokeInstalledNativeHookDist (cyclomatic 160, cognitive 217) src/scripts/smoke-packed-install.ts:2449— smokeInstalledNativeHookDist has cyclomatic complexity 160 and cognitive complexity 217; 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 startTeam (cyclomatic 155, cognitive 308) src/team/runtime.ts:3562— startTeam has cyclomatic complexity 155 and cognitive complexity 308; 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 recordSkillActivation (cyclomatic 149, cognitive 214) src/hooks/keyword-detector.ts:3883— recordSkillActivation has cyclomatic complexity 149 and cognitive complexity 214; 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 applyShellPosixStateEffect (cyclomatic 133, cognitive 240) src/scripts/codex-native-hook.ts:18083— applyShellPosixStateEffect has cyclomatic complexity 133 and cognitive complexity 240; 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 122, cognitive 225) src/team/scaling.ts:602— (anonymous) has cyclomatic complexity 122 and cognitive complexity 225; 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 createTeamSession (cyclomatic 116, cognitive 220) src/team/tmux-session.ts:2403— createTeamSession has cyclomatic complexity 116 and cognitive complexity 220; 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 extractNodeFsSemanticMutations (cyclomatic 101, cognitive 174) src/scripts/codex-native-hook.ts:13472— extractNodeFsSemanticMutations has cyclomatic complexity 101 and cognitive complexity 174; 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 renderTick (cyclomatic 99, cognitive 101) src/hud/index.ts:322— renderTick has cyclomatic complexity 99 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function collectConductorMutationCommandTargets (cyclomatic 94, cognitive 154) src/scripts/codex-native-hook.ts:15724— collectConductorMutationCommandTargets has cyclomatic complexity 94 and cognitive complexity 154; 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 materializePackagedOmxPluginCacheImpl (cyclomatic 93, cognitive 184) src/cli/plugin-marketplace.ts:3876— materializePackagedOmxPluginCacheImpl has cyclomatic complexity 93 and cognitive complexity 184; 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 buildSessionTimeline (cyclomatic 91, cognitive 224) src/session-history/timeline.ts:191— buildSessionTimeline has cyclomatic complexity 91 and cognitive complexity 224; 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/cli/index.ts: 10352 lines of code src/cli/index.ts:1— src/cli/index.ts has 10352 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/team/runtime.ts: 7007 lines of code src/team/runtime.ts:1— src/team/runtime.ts has 7007 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/cli/setup.ts: 6498 lines of code src/cli/setup.ts:1— src/cli/setup.ts has 6498 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/scripts/smoke-packed-install.ts · ×1
src/scripts/smoke-packed-install.ts: 5536 lines of code src/scripts/smoke-packed-install.ts:1— src/scripts/smoke-packed-install.ts has 5536 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/cli/plugin-marketplace.ts · ×1
src/cli/plugin-marketplace.ts: 4472 lines of code src/cli/plugin-marketplace.ts:1— src/cli/plugin-marketplace.ts has 4472 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/team/tmux-session.ts: 4400 lines of code src/team/tmux-session.ts:1— src/team/tmux-session.ts has 4400 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: 4140 lines of code REDACTED:1— REDACTED has 4140 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/config/generator.ts: 4086 lines of code src/config/generator.ts:1— src/config/generator.ts has 4086 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/hooks/keyword-detector.ts · ×1
src/hooks/keyword-detector.ts: 4066 lines of code src/hooks/keyword-detector.ts:1— src/hooks/keyword-detector.ts has 4066 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/hooks/session.ts: 3800 lines of code src/hooks/session.ts:1— src/hooks/session.ts has 3800 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/config/codex-hooks.ts: 2881 lines of code src/config/codex-hooks.ts:1— src/config/codex-hooks.ts has 2881 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/team/state.ts: 2880 lines of code src/team/state.ts:1— src/team/state.ts has 2880 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/team/scaling.ts: 2195 lines of code src/team/scaling.ts:1— src/team/scaling.ts has 2195 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/ultragoal/artifacts.ts: 2133 lines of code src/ultragoal/artifacts.ts:1— src/ultragoal/artifacts.ts has 2133 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/hud/tmux.ts: 2117 lines of code src/hud/tmux.ts:1— src/hud/tmux.ts has 2117 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/cli/uninstall.ts: 1949 lines of code src/cli/uninstall.ts:1— src/cli/uninstall.ts has 1949 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/scripts/notify-fallback-watcher.ts · ×1
src/scripts/notify-fallback-watcher.ts: 1925 lines of code src/scripts/notify-fallback-watcher.ts:1— src/scripts/notify-fallback-watcher.ts has 1925 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· plugins/oh-my-codex/hooks/codex-native-hook.mjs · ×1
plugins/oh-my-codex/hooks/codex-native-hook.mjs: 1799 lines of code plugins/oh-my-codex/hooks/codex-native-hook.mjs:1— plugins/oh-my-codex/hooks/codex-native-hook.mjs has 1799 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/subagents/tracker.ts: 1785 lines of code src/subagents/tracker.ts:1— src/subagents/tracker.ts has 1785 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: 1679 lines of code REDACTED:1— REDACTED has 1679 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/scripts/codex-native-pre-post.ts · ×1
src/scripts/codex-native-pre-post.ts: 1349 lines of code src/scripts/codex-native-pre-post.ts:1— src/scripts/codex-native-pre-post.ts has 1349 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/scripts/notify-hook/team-dispatch.ts · ×1
src/scripts/notify-hook/team-dispatch.ts: 1272 lines of code src/scripts/notify-hook/team-dispatch.ts:1— src/scripts/notify-hook/team-dispatch.ts has 1272 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/scripts/notify-hook/team-leader-nudge.ts · ×1
src/scripts/notify-hook/team-leader-nudge.ts: 1240 lines of code src/scripts/notify-hook/team-leader-nudge.ts:1— src/scripts/notify-hook/team-leader-nudge.ts has 1240 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/mcp/state-paths.ts: 1231 lines of code src/mcp/state-paths.ts:1— src/mcp/state-paths.ts has 1231 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: 1223 lines of code REDACTED:1— REDACTED has 1223 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/team/api-interop.ts: 1188 lines of code src/team/api-interop.ts:1— src/team/api-interop.ts has 1188 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/scripts/notify-hook.ts: 1142 lines of code src/scripts/notify-hook.ts:1— src/scripts/notify-hook.ts has 1142 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/state/operations.ts: 1068 lines of code src/state/operations.ts:1— src/state/operations.ts has 1068 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/team/worker-bootstrap.ts · ×1
src/team/worker-bootstrap.ts: 1030 lines of code src/team/worker-bootstrap.ts:1— src/team/worker-bootstrap.ts has 1030 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/state/skill-active.ts: 1025 lines of code src/state/skill-active.ts:1— src/state/skill-active.ts has 1025 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/question/renderer.ts: 974 lines of code src/question/renderer.ts:1— src/question/renderer.ts has 974 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/notifications/reply-listener.ts · ×1
src/notifications/reply-listener.ts: 973 lines of code src/notifications/reply-listener.ts:1— src/notifications/reply-listener.ts has 973 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/ralplan/advisory.ts: 970 lines of code src/ralplan/advisory.ts:1— src/ralplan/advisory.ts has 970 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: 937 lines of code REDACTED:1— REDACTED has 937 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: 916 lines of code REDACTED:1— REDACTED has 916 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/team/pane-status.ts: 840 lines of code src/team/pane-status.ts:1— src/team/pane-status.ts has 840 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/ralplan/runtime.ts: 798 lines of code src/ralplan/runtime.ts:1— src/ralplan/runtime.ts has 798 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/scripts/notify-hook/auto-nudge.ts · ×1
src/scripts/notify-hook/auto-nudge.ts: 776 lines of code src/scripts/notify-hook/auto-nudge.ts:1— src/scripts/notify-hook/auto-nudge.ts has 776 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/notifications/config.ts · ×1
src/notifications/config.ts: 753 lines of code src/notifications/config.ts:1— src/notifications/config.ts has 753 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/cli/native-assets.ts: 733 lines of code src/cli/native-assets.ts:1— src/cli/native-assets.ts has 733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~258 LoC) src/state/pinned-atomic-file-darwin-helper.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~252 LoC) src/state/pinned-atomic-file-darwin-janitor.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~171 LoC) src/scripts/eval/collect-astra-defaults.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~88 LoC) src/hooks/extensibility/plugin-runner.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~31 LoC) src/scripts/eval/eval-in-action-cat-shellout-demo.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~26 LoC) src/scripts/eval/eval-parity-sweep.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~18 LoC) src/team/state/index.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~17 LoC) src/hooks/native/index.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~11 LoC) src/scripts/eval/eval-help-consistency.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~9 LoC) src/team/state/config.ts— no import path from any entry point (292 application, 27 tooling, 493 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/team/state/index.ts) — 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 (~7 LoC) src/auth/index.ts— no import path from any entry point (292 application, 27 tooling, 493 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 (~3 LoC) src/evals/astra-defaults/index.ts— no import path from any entry point (292 application, 27 tooling, 493 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~1 LoC) src/team/state/summary.ts— no import path from any entry point (292 application, 27 tooling, 493 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/team/state/index.ts) — 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
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: downloadFile src/cli/native-assets.ts:281— `downloadFile` holds an AbortSignal but calls `pipeline(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `pipeline(…, { signal })`.
Silent fallback default in catch plugins/oh-my-codex/hooks/codex-native-hook.mjs:150— `parseHookPayload` 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/adapt/herdr/seq-store.ts:62— `readCounter` 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/planning/artifacts.ts:93— `readMatchingPaths` 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 REDACTED:670— `gitFileStamp` swallows every exception into `return 'missing'` — 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/question/events.ts:102— `parseQuestionEventLines` 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/hud/tmux.ts:1487— `listCurrentWindowPanes` 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/notifications/tmux-detector.ts:34— `capturePaneContent` 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/notifications/session-registry.ts:289— `readAllMappingsUnsafe` 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/notifications/session-registry.ts:350— `pruneStale` swallows every exception into `return false` — 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/notifications/tmux.ts:169— `getTeamTmuxSessions` 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/team/role-router.ts:55— `listAvailableRoles` 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/team/approved-execution.ts:106— `readApprovedHintSourceText` 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/team/runtime.ts:2353— `readStartupEvidenceWorkerStatus` 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/team/api-interop.ts:535— `readLegacyMailboxMessages` 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/wiki/lifecycle.ts:89— `onSessionStart` 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/wiki/lifecycle.ts:169— `onPreCompact` 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/wiki/lifecycle.ts:188— `onPostCompact` 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/cli/plugin-marketplace.ts:3254— `discoverOmxPluginCacheDirs` 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 REDACTED:2152— `readExistingTextFile` 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/sidecar/collector.ts:164— `readTasks` 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/ultragoal/artifacts.ts:1380— `readSteeringLedgerEntries` 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/scripts/postinstall.ts:112— `redactHydrationDiagnosticUrls` swallows every exception into `return "[URL redacted]"` — 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/hooks/codebase-map.ts:120— `getTrackedSourceFiles` 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/hooks/agents-overlay.ts:245— `readNotepadPriority` 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/hooks/agents-overlay.ts:269— `readProjectMemorySummary` 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.
+ 14 more in this group — see findings.md.
P2 · Observability· Console output used as the logging channel · ×32
Console output used as the logging channel src/team/runtime.ts:3422— `src/team/runtime.ts` reports through `console.*` at line 3422 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/team/runtime.ts:3424— `src/team/runtime.ts` reports through `console.*` at line 3424 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/team/runtime.ts:3426— `src/team/runtime.ts` reports through `console.*` at line 3426 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/team/runtime.ts:4181— `src/team/runtime.ts` reports through `console.*` at line 4181 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/team/runtime.ts:5322— `src/team/runtime.ts` reports through `console.*` at line 5322 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/team/runtime.ts:5646— `src/team/runtime.ts` reports through `console.*` at line 5646 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/team/runtime.ts:5683— `src/team/runtime.ts` reports through `console.*` at line 5683 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/team/scaling.ts:1095— `src/team/scaling.ts` reports through `console.*` at line 1095 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/team/scaling.ts:1304— `src/team/scaling.ts` reports through `console.*` at line 1304 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/team/worktree.ts:751— `src/team/worktree.ts` reports through `console.*` at line 751 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/openclaw/config.ts:115— `src/openclaw/config.ts` reports through `console.*` at line 115 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/openclaw/config.ts:475— `src/openclaw/config.ts` reports through `console.*` at line 475 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/notifications/config.ts:328— `src/notifications/config.ts` reports through `console.*` at line 328 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/notifications/config.ts:822— `src/notifications/config.ts` reports through `console.*` at line 822 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/notifications/reply-listener.ts:983— `src/notifications/reply-listener.ts` reports through `console.*` at line 983 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/notifications/session-registry.ts:258— `src/notifications/session-registry.ts` reports through `console.*` at line 258 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/imagegen/continuation.ts:233— `src/imagegen/continuation.ts` reports through `console.*` at line 233 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/imagegen/continuation.ts:249— `src/imagegen/continuation.ts` reports through `console.*` at line 249 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/imagegen/continuation.ts:259— `src/imagegen/continuation.ts` reports through `console.*` at line 259 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/hooks/keyword-detector.ts:4008— `src/hooks/keyword-detector.ts` reports through `console.*` at line 4008 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/hooks/keyword-detector.ts:4302— `src/hooks/keyword-detector.ts` reports through `console.*` at line 4302 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/hooks/keyword-detector.ts:4362— `src/hooks/keyword-detector.ts` reports through `console.*` at line 4362 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/hooks/extensibility/dispatcher.ts:54— `src/hooks/extensibility/dispatcher.ts` reports through `console.*` at line 54 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/hooks/extensibility/logging.ts:19— `src/hooks/extensibility/logging.ts` reports through `console.*` at line 19 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/exec/followup.ts:418— `src/exec/followup.ts` reports through `console.*` at line 418 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Duplicated predicate src/hooks/extensibility/sdk/tmux.ts:54— `!Number.isFinite(seconds) || seconds <= 0` appears character-identically in 2 files — src/hooks/extensibility/sdk/tmux.ts, src/team/tmux-session.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/notify-hook/auto-nudge.ts:778— `!Number.isInteger(readinessPanePid) || readinessPanePid <= 0` appears character-identically in 2 files — src/scripts/notify-hook/auto-nudge.ts, src/scripts/notify-hook/tmux-injection.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/cli/index.ts:2612— `!Number.isSafeInteger(parsedPid) || parsedPid <= 0` appears character-identically in 2 files — src/cli/index.ts, src/team/tmux-session.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/state/pinned-atomic-file-darwin-helper.ts:227— `!Number.isSafeInteger(request.id) || request.id <= 0` appears character-identically in 2 files — src/state/pinned-atomic-file-darwin-helper.ts, src/state/pinned-atomic-file-darwin-janitor.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/cli/index.ts:10190— `!before.isFile() || before.isSymbolicLink()` appears character-identically in 2 files — src/cli/index.ts, src/cli/plugin-marketplace.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/state/pinned-atomic-file-darwin-helper.ts:53— `!before.isFile() || before.nlink !== 1 || !visible.isFile() || visible.isSymbolicLink() || visible.nlink !== 1 || before.dev !== visible.dev…` appears character-identically in 3 files — src/state/pinned-atomic-file-darwin-helper.ts, src/state/pinned-atomic-file-darwin-janitor.ts, src/state/pinned-atomic-file.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/runtime/run-loop.ts:96— `!candidate || typeof candidate !== 'object'` appears character-identically in 2 files — src/runtime/run-loop.ts, src/team/state/monitor.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/cli/native-assets.ts:449— `!created.isDirectory() || created.isSymbolicLink()` appears character-identically in 2 files — src/cli/native-assets.ts, src/state/mode-binding-lease-helper.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/hooks/prompt-session-provenance.ts:92— `!entry || typeof entry !== 'object' || Array.isArray(entry)` appears character-identically in 2 files — src/hooks/prompt-session-provenance.ts, src/question/events.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/question/renderer.ts:814— `!entry.isFile() || !entry.name.endsWith('.json')` appears character-identically in 2 files — src/question/renderer.ts, src/question/state.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/cli/agents.ts:146— `!entry.isFile() || !entry.name.endsWith('.toml')` appears character-identically in 2 files — src/cli/agents.ts, src/subagents/tracker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate plugins/oh-my-codex/hooks/codex-native-hook.mjs:1234— `!entry.isFile() || entry.isSymbolicLink()` appears character-identically in 2 files — plugins/oh-my-codex/hooks/codex-native-hook.mjs, src/cli/plugin-marketplace.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/state/pinned-atomic-file-darwin-helper.ts:16— `!name || basename(name) !== name || !expectedParentDev || !expectedParentIno || !transactionNonce` appears character-identically in 2 files — src/state/pinned-atomic-file-darwin-helper.ts, src/state/pinned-atomic-file-darwin-janitor.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/hook-derived-watcher.ts:170— `!name.startsWith('rollout-') || !name.endsWith('.jsonl')` appears character-identically in 2 files — src/scripts/hook-derived-watcher.ts, src/scripts/notify-fallback-watcher.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/notify-hook/team-leader-nudge.ts:1220— `!noticeRegistration?.queued || !noticeRegistration.prompt` appears character-identically in 3 files — src/scripts/notify-hook/team-leader-nudge.ts, src/scripts/notify-hook/team-worker-stop.ts, src/scripts/notify-hook/team-worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/notify-hook/auto-nudge.ts:673— `!nudgeState || typeof nudgeState !== 'object'` appears character-identically in 2 files — src/scripts/notify-hook/auto-nudge.ts, src/scripts/notify-hook/team-leader-nudge.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/hook-derived-watcher.ts:183— `!parsed || parsed.type !== 'event_msg' || !parsed.payload` appears character-identically in 2 files — src/scripts/hook-derived-watcher.ts, src/scripts/notify-fallback-watcher.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/session-history/friction.ts:124— `!parsed || parsed.type !== 'session_meta'` appears character-identically in 2 files — src/session-history/friction.ts, src/session-history/search.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/hook-derived-watcher.ts:152— `!parsed || parsed.type !== 'session_meta' || !parsed.payload` appears character-identically in 2 files — src/scripts/hook-derived-watcher.ts, src/scripts/notify-fallback-watcher.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/notify-hook/team-leader-nudge.ts:306— `!parsed || safeString(parsed.team_name).trim() !== teamName` appears character-identically in 2 files — src/scripts/notify-hook/team-leader-nudge.ts, src/scripts/notify-hook/team-worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/cli/index.ts:10564— `!parsed || typeof parsed !== "object" || Array.isArray(parsed)` appears character-identically in 3 files — src/cli/index.ts, src/cli/mcp-parity.ts, src/cli/uninstall.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate plugins/oh-my-codex/hooks/codex-native-hook.mjs:1524— `!parsed || typeof parsed !== 'object' || Array.isArray(parsed)` appears character-identically in 9 files — plugins/oh-my-codex/hooks/codex-native-hook.mjs, src/autoresearch/contracts.ts, REDACTED, src/cli/autopilot.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripts/notify-hook/team-leader-nudge.ts:302— `!phaseSnapshot || !phaseSnapshot.terminal` appears character-identically in 2 files — src/scripts/notify-hook/team-leader-nudge.ts, src/scripts/notify-hook/team-worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/ralplan/advisory-contract.ts:104— `!projection || projection.corruption || !projection.fence || !projection.journal` appears character-identically in 2 files — src/ralplan/advisory-contract.ts, src/ralplan/advisory.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/config/models.ts:89— `!raw || typeof raw !== 'object' || Array.isArray(raw)` appears character-identically in 2 files — src/config/models.ts, src/question/types.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
redundant comment src/cli/__tests__/setup-install-mode.test.ts:1738— "Register a live pin" repeats the code it sits on: 3 of its 3 words (register, live, pin) are already in `await registerOmxPluginCacheLivePin(cacheDir, "dry-run-live-session", process.pid);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/cli/__tests__/setup-symlink-destinations.test.ts:260— "Verify config was created in custom CODEX_HOME" repeats the code it sits on: 5 of its 6 words (config, created, custom, codex, home) are already in `assert(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/cli/uninstall.ts:703— "Strip feature flags" repeats the code it sits on: 3 of its 3 words (strip, feature, flags) are already in `config = stripOmxFeatureFlags(config, { preserveMultiAgent: true });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/config/__tests__/quality-gates.test.ts:475— "Code-review (from CODEX_HOME only)" repeats the code it sits on: 4 of its 5 words (code, review, codex, home) are already in `const reviewGates = getGatesForStage('code-review', codexHomeDir, projectDir);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/config/quality-gates.ts:105— "Check reserved names" repeats the code it sits on: 3 of its 3 words (check, reserved, names) are already in `if (RESERVED_SKILL_NAMES.has(normalized))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/config/quality-gates.ts:148— "Validate skill name" repeats the code it sits on: 3 of its 3 words (validate, skill, name) are already in `const validation = validateSkillName(skill);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/notifications/__tests__/verbosity.test.ts:109— "Agent: includes ask-user-question" repeats the code it sits on: 4 of its 5 words (agent, ask, user, question) are already in `it('agent allows ask-user-question', () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/scripts/__tests__/codex-native-hook.test.ts:2876— "Write an active ralplan skill state for this native session" repeats the code it sits on: 6 of its 7 words (write, active, skill, state, native, session) are already in `await writeJson(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/scripts/__tests__/codex-native-hook.test.ts:2957— "Write an active ralplan skill state" repeats the code it sits on: 4 of its 5 words (write, active, skill, state) are already in `await writeJson(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/scripts/__tests__/smoke-packed-install.test.ts:1772— "Documented advisory context with the PreToolUse event name." repeats the code it sits on: 7 of its 8 words (advisory, context, pre, tool, use, event, name) are already in `assertNativeHookAdvisoryPreToolUse('advisory-context', {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/state/__tests__/single-writer-invariant.test.ts:299— "A file handle write through the suffix constant." repeats the code it sits on: 4 of its 5 words (file, handle, write, suffix) are already in `assert.equal(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/team/__tests__/scaling.test.ts:3370— "Write working status for both workers" repeats the code it sits on: 4 of its 4 words (write, working, status, workers) are already in `await writeWorkerStatus('busy-test', 'worker-1', {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/team/__tests__/tmux-claude-workers-demo.test.ts:30— "Verify via resolveTeamWorkerCliPlan" repeats the code it sits on: 5 of its 6 words (resolve, team, worker, cli, plan) are already in `const plan = resolveTeamWorkerCliPlan(workerCount, [], {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/team/__tests__/worker-bootstrap.test.ts:1710— "Call removeWorkerWorktreeRootAgentsFile" repeats the code it sits on: 7 of its 7 words (call, remove, worker, worktree, root, agents, file) are already in `await removeWorkerWorktreeRootAgentsFile(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/team/runtime.ts:6921— "Collect enqueued requests: request ID => { workerName, workerInfo, messageId }" repeats the code it sits on: 8 of its 9 words (enqueued, requests, request, id, worker, name, info, message) are already in `const enqueuedRequests: Array<{ workerName: string; workerInfo: WorkerInfo; messageId: string; requestId: string }> = [] …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/team/state.ts:1597— "Read team config" repeats the code it sits on: 3 of its 3 words (read, team, config) are already in `async function readTeamConfigRaw(teamName: string, cwd: string): Promise<TeamConfig | null>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/wiki/ingest.ts:44— "Merge into existing page" repeats the code it sits on: 3 of its 3 words (merge, existing, page) are already in `const merged = mergePage(existing, input, now);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Blanket warning suppression src/scripts/check-runtime-syntax.ts:2— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/auto-nudge.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/orchestration-intent.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/team-dispatch.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/team-leader-nudge.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/team-worker-stop.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/team-worker.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression src/scripts/notify-hook/tmux-injection.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Orphaned file src/team/dag-schema.ts: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/planning/artifact-names.ts: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/scripts/team-hardening-benchmark.ts: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/team/delegation-policy.ts: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/visual/verdict.ts: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/team/rebalance-policy.ts: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 packages/vscode-extension/src/core.ts: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.
D20 · ADR Quality· ADR has no Context section · ×3
ADR has no Context section docs/adr/3194-codex-01445-documented-leader-proof.md:1— docs/adr/3194-codex-01445-documented-leader-proof.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/adr/3212-same-user-native-child-auth-boundary.md:1— docs/adr/3212-same-user-native-child-auth-boundary.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/adr/3459-team-tmux-argv-separator-boundary.md:1— docs/adr/3459-team-tmux-argv-separator-boundary.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
Classify ADR enforcement: ADR 3194: Documented leader proof for exact reviewed Codex releases docs/adr/3194-codex-01445-documented-leader-proof.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: ADR 3212: Same-user native-child authentication boundary docs/adr/3212-same-user-native-child-auth-boundary.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: ADR 3459: Preserve the Team source-authority tmux argv separator boundary docs/adr/3459-team-tmux-argv-separator-boundary.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
ADR not followed: ADR 3194: Documented leader proof for exact reviewed Codex releases docs/adr/3194-codex-01445-documented-leader-proof.md:7— docs/adr/3194-codex-01445-documented-leader-proof.md:7 rules out `PreToolUse`, but production code uses it: src/scripts/codex-native-hook.ts:23009, src/scripts/smoke-packed-install.ts:4901, src/config/codex-hooks.ts:76, src/config/codex-hooks.ts:449, REDACTED:2538. Remove the use, or supersede the record if the decision changed.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 8 project(s) overshoot their size bounds, lowering Project Cohesion to 7.5/10. The most over is `(repository root)` (195510 LoC, 1525 module-visible types across 58 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.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 7 of 358 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 358 of the 464 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src/team/dag-schema.ts, src/planning/artifact-names.ts, src/scripts/team-hardening-benchmark.ts, src/team/delegation-policy.ts, src/visual/verdict.ts, src/team/rebalance-policy.ts, packages/vscode-extension/src/core.ts. 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.
Disabled test src/hud/__tests__/tmux.test.ts:457— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Logging is not universal — Only 1/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/omx-api`, `crates/omx-explore`, `crates/omx-runtime`, `crates/omx-sparkshell`.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code· Unused export 'clearCoreCache' · ×1
Unused export 'clearCoreCache' packages/vscode-extension/src/core.ts:75— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'createHerdrBridge' · ×1
Unused export 'createHerdrBridge' src/adapt/herdr/bridge.ts:287— Nothing ultimately consumes this binding: its only referrer is the re-export in src/adapt/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/adapt/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'MAX_TOKEN_VALUE_LEN' · ×1
Unused export 'MAX_TOKEN_VALUE_LEN' src/adapt/herdr/sanitize.ts:11— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isCodexHookFeatureFlagName' · ×1
Unused export 'isCodexHookFeatureFlagName' src/config/codex-feature-flags.ts:14— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isModelConfiguredAtRoot' · ×1
Unused export 'isModelConfiguredAtRoot' src/config/models.ts:308— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isModelConfigured' · ×1
Unused export 'isModelConfigured' src/config/models.ts:343— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'goalWorkflowLedgerPath' · ×1
Unused export 'goalWorkflowLedgerPath' src/goal-workflows/artifacts.ts:113— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'HookDispatchSummary' · ×1
Unused export 'HookDispatchSummary' src/hooks/extensibility/types.ts:204— Nothing ultimately consumes this binding: its only referrer is the re-export in src/hooks/extensibility/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/hooks/extensibility/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'HookValidateOptions' · ×1
Unused export 'HookValidateOptions' src/hooks/extensibility/types.ts:219— Nothing ultimately consumes this binding: its only referrer is the re-export in src/hooks/extensibility/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/hooks/extensibility/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'readUltraworkState' · ×1
Unused export 'readUltraworkState' REDACTED:406— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'readAutopilotState' · ×1
Unused export 'readAutopilotState' REDACTED:411— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'LEADER_CONDUCTOR_PHILOSOPHY' · ×1
Unused export 'LEADER_CONDUCTOR_PHILOSOPHY' src/leader/contract.ts:31— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'NATIVE_HYDRATABLE_PRODUCTS' · ×1
Unused export 'NATIVE_HYDRATABLE_PRODUCTS' src/native-assets/policy.ts:35— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ReplyListenerDiscordPollDeps' · ×1
Unused export 'ReplyListenerDiscordPollDeps' src/notifications/reply-listener.ts:387— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ReplyListenerTelegramPollDeps' · ×1
Unused export 'ReplyListenerTelegramPollDeps' src/notifications/reply-listener.ts:397— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'startReplyListener' · ×1
Unused export 'startReplyListener' src/notifications/reply-listener.ts:951— Nothing ultimately consumes this binding: its only referrer is the re-export in src/notifications/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/notifications/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'stopReplyListener' · ×1
Unused export 'stopReplyListener' src/notifications/reply-listener.ts:1034— Nothing ultimately consumes this binding: its only referrer is the re-export in src/notifications/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/notifications/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'getReplyListenerStatus' · ×1
Unused export 'getReplyListenerStatus' src/notifications/reply-listener.ts:1087— Nothing ultimately consumes this binding: its only referrer is the re-export in src/notifications/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/notifications/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'DISCORD_STATUS_STALE_AFTER_MS' · ×1
Unused export 'DISCORD_STATUS_STALE_AFTER_MS' src/notifications/session-status.ts:14— Nothing imports this binding — it is safe to review for removal.
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 3/4 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Null assertions (`!`) reduce the strict null checking score — ~2.1 `!` null assertions per 1k TypeScript source lines — 452 assertion(s) across the 210290 source line(s) of the 424 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: src/cli/index.ts (44), src/team/runtime.ts (40), src/hud/tmux.ts (33). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Subsumed condition operand crates/omx-sparkshell/src/main.rs:723— `text.contains("test failed")` can never decide this `||` — every value satisfying `text.contains("test failed")` also satisfies `text.contains("failed")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Skipped (documented): (unnamed test) src/vscode/__tests__/index.test.ts:32— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): triggers client resize when GNU timeout is absent from PATH src/team/__tests__/tmux-test-fixture.test.ts:177— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): preserves an early attach failure instead of reporting a timeout src/team/__tests__/tmux-test-fixture.test.ts:205— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): (unnamed test) src/sidecar/__tests__/collector.test.ts:193— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): ignores untracked sloppy fallback files last written before the session transcript src/scripts/__tests__/codex-native-hook.test.ts:13911— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): audits untracked files when the transcript birth time is indistinguishable from ctime src/scripts/__tests__/codex-native-hook.test.ts:13960— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): still blocks untracked sloppy fallback files materialized in-session with preserved mtime src/scripts/__tests__/codex-native-hook.test.ts:13996— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): still blocks untracked sloppy fallback files reachable through an in-session symlink to an older target src/scripts/__tests__/codex-native-hook.test.ts:14034— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): still blocks when a pre-session symlink's target is rewritten during the session src/scripts/__tests__/codex-native-hook.test.ts:14072— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): still blocks untracked sloppy fallback files written after the session transcript src/scripts/__tests__/codex-native-hook.test.ts:14114— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): keeps a live 20-worker roster bounded after window shrink and grows it back src/hud/__tests__/roster-height-realtmux.test.ts:10— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): answers attachment from a real detached private tmux session src/hud/__tests__/session-attached.test.ts:83— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): shows a branch switch in a reftable repository and its linked worktree src/hud/__tests__/state.test.ts:557— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): round-trips registered hook health through a real tmux server src/hud/__tests__/tmux.test.ts:453— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): distinguishes a paused live pre-rename owner from the same owner after SIGKILL src/hooks/__tests__/session.test.ts:2980— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): publishes a legacy-like Linux state when process identity capture fails src/hooks/__tests__/session.test.ts:3247— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): preserves process_identity across detached metadata updates src/hooks/__tests__/session.test.ts:4136— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): forwards payload, stdout, stderr, and non-zero exit through the Windows shim when PowerShell is available src/config/__tests__/codex-hooks.test.ts:990— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Linux installed-Codex hooks/list preserves full foreign metadata through uninstall (no macOS claim) src/cli/__tests__/setup-hooks-trust-e2e.test.ts:146— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Linux installed-Codex removes managed-first hooks while preserving foreign coordinate order src/cli/__tests__/setup-hooks-trust-e2e.test.ts:303— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): reads named and inferred team status under an actual read-only filesystem src/cli/__tests__/team-status-readonly.test.ts:20— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): rechecks legacy file identity after acquiring the lock in ${operation.name} src/auth/__tests__/storage.test.ts:25— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): preserves access to an existing distinct Slots account and unrelated accounts src/auth/__tests__/storage.test.ts:93— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): (unnamed test) packages/vscode-extension/src/__tests__/chatStore.test.ts:17— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
doc comments repeat the names src/agents/definitions.ts:355— 0 of 16 documented parameters and 6 of 993 summaries in `oh-my-codex` only repeat the member or parameter name (e.g. "Get all agents in a category" for `getAgentsByCategory`). Delete the restating tags, or add what the name does not say.
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.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 17 file(s) — `REDACTED`, `src/cli/cleanup.ts`, `src/cli/index.ts`, `src/cli/setup.ts`, `src/config/codex-hooks.ts`, … (+12 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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 01a1b731-2cea-772e-977f-d8711135fbc4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 94 · Warnings: 2049 · Recommendations: 164 · Info: 25 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 07-11-2026 @ 18:06 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.