Public report of HirezmingD/Knowe-agent-groupchat, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 20:13 UTC · Survey ID cd_f09f40ff953c4ddaad2143a51718fb89
HirezmingD/Knowe-agent-groupchat
Measured 17 November 2026, 20:12 UTC, at code version 23411a0
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 88,480 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.6 person-years · Weakest lens: Production Readiness, 30.1
Findings by how serious they are
75 critical950 serious88 minor
19 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
17 November 2026, 20:12 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 ▸
67of 67 dimensions measured by tools.
1106of 1113 findings point to an exact file and line, so you can open each one in the code. The other 7 concern the repository as a whole, such as missing documentation.
67dimensions across 7 lenses, read from 88,480 lines of product code in 2 projects.
HirezmingD/Knowe-agent-groupchat is rated At risk because critical security findings are open, most of them in the packages it uses. Its score is held back because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 45.3 out of 100, which the At risk rating leaves unchanged.
Production Readiness, at 30.1, is the weakest lens and counts most in the score. The best first steps are adding an automated build and test pipeline and adding automated security scanning, each worth about 5.5 points. Raising Production Readiness to 70 would lift the score to about 57.6.
Twenty-two known security holes in the packages the code depends on can be used by attackers. One place in the code runs text as code, which an attacker could use, and twenty-five controls can't be used without a mouse. Updating the vulnerable packages, replacing text run as code with direct calls and making the controls work with a keyboard would close these risks. Fixing the weaknesses the scanner points to would fix the security weakness in the code. The eight form fields without a label need a label.
The product code is 88,480 lines, about €93,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 30.1 to 70, the lowest score rated Strong, the score would rise from 45.3 to about 57.6.
Code composition: what the lines of code are
Product code 85%Tests 15%
Rebuild cost: about €93,000 · Estimate
Cost to rebuild
€31,000 to €150,000, for 512 to 1,626 hours of work, about 0.6 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 45. 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
Medium: 88,480 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
Add a CI workflow that builds and runs the test suite on every push/PR.
The repository declares its tests as `npm test` (`package.json`): run that.
Raises the score by about 5.5 points · Medium effort · CI/CD gates
2
Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Raises the score by about 5.5 points · Medium effort · Dependency Hygiene
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €93,000 to build again, about 0.6 person-years of work. Its weakest lens is Production Readiness, at 30.1 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a CI workflow that builds and runs the test suite on every push/PR. Of all the actions in this report, it raises the score most for the work it takes: about 5.5 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 5.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 139,150 lines over the last 90 days, which is about 564,331 lines a year. At that pace, the extra work comes to an estimated 84.6 to 507.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
161 modules, with 120 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 121 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.
backend.agents.knowe_agent uses backend.knowe_core.provider_client, so a change to backend.knowe_core.provider_client can break backend.agents.knowe_agent, while a change to backend.agents.knowe_agent can't break backend.knowe_core.provider_client.
Position
Below the diagonal: backend.agents.knowe_agent uses a module listed above it, which is the healthy direction.
backend.agents.knowe_agent uses backend.knowe_core.tool_registry, so a change to backend.knowe_core.tool_registry can break backend.agents.knowe_agent, while a change to backend.agents.knowe_agent can't break backend.knowe_core.tool_registry.
Position
Below the diagonal: backend.agents.knowe_agent uses a module listed above it, which is the healthy direction.
backend.knowe_core.agent_loop uses backend.knowe_core.provider_client, so a change to backend.knowe_core.provider_client can break backend.knowe_core.agent_loop, while a change to backend.knowe_core.agent_loop can't break backend.knowe_core.provider_client.
Position
Below the diagonal: backend.knowe_core.agent_loop uses a module listed above it, which is the healthy direction.
backend.knowe_core.agent_loop uses backend.knowe_core.tool_registry, so a change to backend.knowe_core.tool_registry can break backend.knowe_core.agent_loop, while a change to backend.knowe_core.agent_loop can't break backend.knowe_core.tool_registry.
Position
Below the diagonal: backend.knowe_core.agent_loop uses a module listed above it, which is the healthy direction.
backend.knowe_harness.completion uses backend.runtime, so a change to backend.runtime can break backend.knowe_harness.completion, while a change to backend.knowe_harness.completion can't break backend.runtime.
Position
Below the diagonal: backend.knowe_harness.completion uses a module listed above it, which is the healthy direction.
backend.knowe_harness.store uses backend.runtime, so a change to backend.runtime can break backend.knowe_harness.store, while a change to backend.knowe_harness.store can't break backend.runtime.
Position
Below the diagonal: backend.knowe_harness.store uses a module listed above it, which is the healthy direction.
src.preview.renderers.CodePreview uses src.preview.renderers.codeSyntax, so a change to src.preview.renderers.codeSyntax can break src.preview.renderers.CodePreview, while a change to src.preview.renderers.CodePreview can't break src.preview.renderers.codeSyntax.
Position
Below the diagonal: src.preview.renderers.CodePreview uses a module listed above it, which is the healthy direction.
src.store.state uses src.store.completionProjection, so a change to src.store.completionProjection can break src.store.state, while a change to src.store.state can't break src.store.completionProjection.
Position
Below the diagonal: src.store.state uses a module listed above it, which is the healthy direction.
src.store.toolActivity uses src.store.toolPhrase, so a change to src.store.toolPhrase can break src.store.toolActivity, while a change to src.store.toolActivity can't break src.store.toolPhrase.
Position
Below the diagonal: src.store.toolActivity uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in backend.agents.base uses a type in backend.gate.
The types involved
backend.agents.base.AgentPort → backend.gate.Gate
Direction
backend.agents.base uses backend.gate, so a change to backend.gate can break backend.agents.base, while a change to backend.agents.base can't break backend.gate.
Position
Below the diagonal: backend.agents.base uses a module listed above it, which is the healthy direction.
backend.engine uses backend.mentions, so a change to backend.mentions can break backend.engine, while a change to backend.engine can't break backend.mentions.
Position
Below the diagonal: backend.engine uses a module listed above it, which is the healthy direction.
backend.engine uses backend.runtime, so a change to backend.runtime can break backend.engine, while a change to backend.engine can't break backend.runtime.
Position
Below the diagonal: backend.engine uses a module listed above it, which is the healthy direction.
backend.engine uses backend.agents.knowe_agent, so a change to backend.agents.knowe_agent can break backend.engine, while a change to backend.engine can't break backend.agents.knowe_agent.
Position
Below the diagonal: backend.engine uses a module listed above it, which is the healthy direction.
backend.engine uses backend.knowe_harness.completion, so a change to backend.knowe_harness.completion can break backend.engine, while a change to backend.engine can't break backend.knowe_harness.completion.
Position
Below the diagonal: backend.engine uses a module listed above it, which is the healthy direction.
backend.engine uses backend.knowe_harness.store, so a change to backend.knowe_harness.store can break backend.engine, while a change to backend.engine can't break backend.knowe_harness.store.
Position
Below the diagonal: backend.engine uses a module listed above it, which is the healthy direction.
backend.knowe_harness uses backend.runtime, so a change to backend.runtime can break backend.knowe_harness, while a change to backend.knowe_harness can't break backend.runtime.
Position
Below the diagonal: backend.knowe_harness uses a module listed above it, which is the healthy direction.
backend.knowe_harness uses backend.knowe_harness.completion, so a change to backend.knowe_harness.completion can break backend.knowe_harness, while a change to backend.knowe_harness can't break backend.knowe_harness.completion.
Position
Below the diagonal: backend.knowe_harness uses a module listed above it, which is the healthy direction.
src.components uses src.components.MessageBubble, so a change to src.components.MessageBubble can break src.components, while a change to src.components can't break src.components.MessageBubble.
Position
Below the diagonal: src.components uses a module listed above it, which is the healthy direction.
src.components uses src.shared.bridge, so a change to src.shared.bridge can break src.components, while a change to src.components can't break src.shared.bridge.
Position
Below the diagonal: src.components uses a module listed above it, which is the healthy direction.
src.components uses src.store.favorites, so a change to src.store.favorites can break src.components, while a change to src.components can't break src.store.favorites.
Position
Below the diagonal: src.components uses a module listed above it, which is the healthy direction.
src.components uses src.store.settings, so a change to src.store.settings can break src.components, while a change to src.components can't break src.store.settings.
Position
Below the diagonal: src.components uses a module listed above it, which is the healthy direction.
src.components uses src.store.state, so a change to src.store.state can break src.components, while a change to src.components can't break src.store.state.
Position
Below the diagonal: src.components uses a module listed above it, which is the healthy direction.
src.preview.renderers uses src.preview.renderers.codeSyntax, so a change to src.preview.renderers.codeSyntax can break src.preview.renderers, while a change to src.preview.renderers can't break src.preview.renderers.codeSyntax.
Position
Below the diagonal: src.preview.renderers uses a module listed above it, which is the healthy direction.
src.preview.renderers uses src.preview.renderers.CodePreview, so a change to src.preview.renderers.CodePreview can break src.preview.renderers, while a change to src.preview.renderers can't break src.preview.renderers.CodePreview.
Position
Below the diagonal: src.preview.renderers uses a module listed above it, which is the healthy direction.
src.store.store uses src.transport.socket, so a change to src.transport.socket can break src.store.store, while a change to src.store.store can't break src.transport.socket.
Position
Below the diagonal: src.store.store uses a module listed above it, which is the healthy direction.
src.store.store uses src.store.state, so a change to src.store.state can break src.store.store, while a change to src.store.store can't break src.store.state.
Position
Below the diagonal: src.store.store uses a module listed above it, which is the healthy direction.
backend uses backend.agent_identity, so a change to backend.agent_identity can break backend, while a change to backend can't break backend.agent_identity.
Position
Below the diagonal: backend uses a module listed above it, which is the healthy direction.
backend uses backend.browser_tools, so a change to backend.browser_tools can break backend, while a change to backend can't break backend.browser_tools.
Position
Below the diagonal: backend uses a module listed above it, which is the healthy direction.
backend uses backend.knowe_core.tool_registry, so a change to backend.knowe_core.tool_registry can break backend, while a change to backend can't break backend.knowe_core.tool_registry.
Position
Below the diagonal: backend uses a module listed above it, which is the healthy direction.
backend uses backend.knowe_storage._sqlite, so a change to backend.knowe_storage._sqlite can break backend, while a change to backend can't break backend.knowe_storage._sqlite.
Position
Below the diagonal: backend uses a module listed above it, which is the healthy direction.
backend.agents.deepseek uses backend.gate, so a change to backend.gate can break backend.agents.deepseek, while a change to backend.agents.deepseek can't break backend.gate.
Position
Below the diagonal: backend.agents.deepseek uses a module listed above it, which is the healthy direction.
backend.agents.deepseek uses backend.agents.base, so a change to backend.agents.base can break backend.agents.deepseek, while a change to backend.agents.deepseek can't break backend.agents.base.
Position
Below the diagonal: backend.agents.deepseek uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in backend.agents.fake uses a type in backend.gate.
The types involved
backend.agents.fake.FakeAgent → backend.gate.Gate
Direction
backend.agents.fake uses backend.gate, so a change to backend.gate can break backend.agents.fake, while a change to backend.agents.fake can't break backend.gate.
Position
Below the diagonal: backend.agents.fake uses a module listed above it, which is the healthy direction.
backend.agents.fake uses backend.agents.base, so a change to backend.agents.base can break backend.agents.fake, while a change to backend.agents.fake can't break backend.agents.base.
Position
Below the diagonal: backend.agents.fake uses a module listed above it, which is the healthy direction.
backend.agents.zinnia uses backend.browser_tools, so a change to backend.browser_tools can break backend.agents.zinnia, while a change to backend.agents.zinnia can't break backend.browser_tools.
Position
Below the diagonal: backend.agents.zinnia uses a module listed above it, which is the healthy direction.
backend.agents.zinnia uses backend.knowe_core.provider_client, so a change to backend.knowe_core.provider_client can break backend.agents.zinnia, while a change to backend.agents.zinnia can't break backend.knowe_core.provider_client.
Position
Below the diagonal: backend.agents.zinnia uses a module listed above it, which is the healthy direction.
backend.agents.zinnia uses backend.gate, so a change to backend.gate can break backend.agents.zinnia, while a change to backend.agents.zinnia can't break backend.gate.
Position
Below the diagonal: backend.agents.zinnia uses a module listed above it, which is the healthy direction.
backend.agents.zinnia uses backend.agents.base, so a change to backend.agents.base can break backend.agents.zinnia, while a change to backend.agents.zinnia can't break backend.agents.base.
Position
Below the diagonal: backend.agents.zinnia uses a module listed above it, which is the healthy direction.
backend.server uses backend.engine, so a change to backend.engine can break backend.server, while a change to backend.server can't break backend.engine.
Position
Below the diagonal: backend.server uses a module listed above it, which is the healthy direction.
src.store uses src.store.completionProjection, so a change to src.store.completionProjection can break src.store, while a change to src.store can't break src.store.completionProjection.
Position
Below the diagonal: src.store uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in src.store uses a type in src.store.favorites.
The types involved
src.store.favorites → src.store.favorites.FavType
Direction
src.store uses src.store.favorites, so a change to src.store.favorites can break src.store, while a change to src.store can't break src.store.favorites.
Position
Below the diagonal: src.store uses a module listed above it, which is the healthy direction.
src.store uses src.store.toolPhrase, so a change to src.store.toolPhrase can break src.store, while a change to src.store can't break src.store.toolPhrase.
Position
Below the diagonal: src.store uses a module listed above it, which is the healthy direction.
src.store uses src.transport.socket, so a change to src.transport.socket can break src.store, while a change to src.store can't break src.transport.socket.
Position
Below the diagonal: src.store uses a module listed above it, which is the healthy direction.
src.store uses src.store.toolActivity, so a change to src.store.toolActivity can break src.store, while a change to src.store can't break src.store.toolActivity.
Position
Below the diagonal: src.store uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2025 — Software Supply Chain Failures
28
High / Critical
A05:2025 — Injection
12
High / Critical
Roadmap
Top priorities: Add a CI workflow that builds and runs the test suite on every push/PR. The repository declares its tests as `npm test` (`package.json`): run that; Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a CI workflow that builds and runs the test suite on every push/PR. The repository declares its tests as `npm test` (`package.json`): run that.
Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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 — 75
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 — 950
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 — 88
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 19
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 67 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, 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 — 67 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1106 of 1113 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.
D5 Coupling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
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 418 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 65 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D12 Dependency Hygiene — 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. Not scored — 8 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
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 package.json, but the licence verdict published here was taken over its Python distribution 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.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — 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. Git history depth insufficient — this repository has 29 commit(s), too few for a reliable trend signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
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-contributor repository — bus factor is not applicable (1 contributor(s) across 29 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D20 ADR Quality — 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 ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository. Read, stating neither a host nor a published package: `package.json`.
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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D24 Comment Value — 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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
D24 Comment Value — 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — 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. Tracing effort is measured over resolved call sites, and all 1472 sampled here came from .py files. This repository's .tsx, .ts source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
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. `src/store/selectors.ts` 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.
D34 Knowledge Freshness — 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. Too few commits to judge knowledge freshness (29 commit(s) sampled).
D35 Change Coupling — measured, with a gap in what it reached — 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. Git history depth insufficient — this repository has 29 commit(s), too few for a reliable change-coupling signal. The clone is complete, so there is no deeper history to fetch: the signal returns as the project accumulates history.
AC1 Text alternatives — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 43 markup element(s) as HTML strings, carrying 3 role/aria/tabindex attribute(s) (e.g. src/components/ContextMenu.tsx, src/components/ModelBindingModule.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 66 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 43 markup element(s) as HTML strings, carrying 3 role/aria/tabindex attribute(s) (e.g. src/components/ContextMenu.tsx, src/components/ModelBindingModule.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 66 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC3 Page structure — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 43 markup element(s) as HTML strings, carrying 3 role/aria/tabindex attribute(s) (e.g. src/components/ContextMenu.tsx, src/components/ModelBindingModule.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 66 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC4 Keyboard semantics — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 43 markup element(s) as HTML strings, carrying 3 role/aria/tabindex attribute(s) (e.g. src/components/ContextMenu.tsx, src/components/ModelBindingModule.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 66 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC5 ARIA correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 43 markup element(s) as HTML strings, carrying 3 role/aria/tabindex attribute(s) (e.g. src/components/ContextMenu.tsx, src/components/ModelBindingModule.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 66 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 2 script file(s) building 43 markup element(s) as HTML strings, carrying 3 role/aria/tabindex attribute(s) (e.g. src/components/ContextMenu.tsx, src/components/ModelBindingModule.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 66 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 38 further occurrence(s) are not listed individually; the score already reflects all 78.
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 REDACTED, 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. A program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. (rule: missing-tool). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> knowe@1.0.39 dev / > vite / sh: 1: vite: not found" 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`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> knowe@1.0.39 dev / > vite / sh: 1: vite: not found" No runtime evidence was gathered.
C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C3 Audit Trail — 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. 'sqlite3' is imported (backend/storage_migrator.py:146), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — 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. 'sqlite3' is imported (backend/storage_migrator.py:146), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — 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. 'sqlite3' is imported (backend/storage_migrator.py:146), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — 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 C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — 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 C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — 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.
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. 83 further occurrence(s) are not listed individually; the score already reflects all 123.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 67 further occurrence(s) are not listed individually; the score already reflects all 107.
R4 Test Coverage — 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. 3 further occurrence(s) are not listed individually; the score already reflects all 43.
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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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. 63 further occurrence(s) are not listed individually; the score already reflects all 103.
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.
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.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
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.
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.
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 Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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.
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.
+ 202 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with state.applyEvent (cyclomatic 232), KnowledgeView.KnowledgeView (cyclomatic 174), Composer.Composer (cyclomatic 130). — 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 9 together lifts Cyclomatic Complexity from 2.0 to about 3.6/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
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.
+ 289 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 24 bodies over 60 down to 60 or less in Cognitive Complexity — start with state.applyEvent (cognitive 412), ChatStream.ChatStream (cognitive 339), KnowledgeView.KnowledgeView (cognitive 259). — 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 24 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.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.4 / 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 33 FunctionTooLong finding(s) in God Classes — start with KnowledgeView.tsx (2), TokenUsagePanel.tsx (2), ContextMenu.tsx (2). — One of this dimension's main actionable groups (33 warning-level).
Resolve the 28 FileTooLong finding(s) in God Classes — start with REDACTED, REDACTED, tools_knowe.py. — One of this dimension's main actionable groups (28 warning-level).
Resolve the 7 TooManyMethods finding(s) in God Classes — start with REDACTED, REDACTED, completion.py. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
64 duplicated block group(s) detected. 2.5 % of the production lines (2,240 of 88,480) are in a reported copy. A further 33 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .tsx, .ts (42% 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.
Edited copy of a member (9 corresponding lines) · ×4backend/knowe_harness/contracts.py:25
Edited copy of a member (5 corresponding lines) · ×3REDACTED:113
+ 60 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 6 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), REDACTED, knowledge_graph.py. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with provider_client.py (3), deepseek.py, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 5 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with tools_knowe.py (2), zinnia.py, knowledge_api.py. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d4_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.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with knowledge_graph.py, memory_manager.py. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 1 serious 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.
0 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 418 tests. Measured on the JavaScript/TypeScript suite only — at least 65 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: 服务器级事件(无 seq 白名单)都过 Zodsrc/contract/parity.test.ts:115
What to do
Resolve the 1 No assertions finding(s) in Test Quality — start with parity.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
0 flaky across 2 measured tier(s). JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in the repository root (456 tests)): measured (0 flaky); Python (repository root, 62 test files): measured (0 flaky).
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 30 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 8 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (22 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 4 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares package.json, 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.
Resolve the 10 Hotspot finding(s) in Churn × Complexity Hotspots — start with ChatStream.tsx, main.ts, state.ts. — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 deducted task-comment markers across 88480 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.
TodoCommentsrc/store/favorites.ts:17
What to do
Resolve the 1 TodoComment finding(s) in Explicit Debt — start with favorites.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 build units (Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2backend/requirements.txt:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with requirements.txt, package.json. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability8.2 / 10Strong✓ Tool-verified
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.
70 % of calls cross a namespace and 0 % go through an interface, but 49 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .py source only — this repository's .tsx, .ts was not sampled for call sites, so this score covers part of the tree, not all of it.
Scattered collaborators
What to do
Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d27_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: 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).
12 finding(s): 0 critical, 2 high, 7 medium, 3 low. semgrep hit a parse error in 5 file(s) — `REDACTED`, `electron/main.ts`, `src/components/ChatStream.tsx`, `src/contract/envelope.ts`, `src/store/selectors.ts` (lines 132–160, line 178, line 180, …) — 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.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 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).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (19). — One of this dimension's main actionable groups (19 issue-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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 0 platform declaration(s) and 32 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives5.4 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — src/preview/renderers/PdfPreview.tsx:237
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels6.7 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×4) — src/components/ApprovalCard.tsx:456, src/components/ContactsView.tsx:874, src/components/ContactsView.tsx:890, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×6) — src/components/ApprovalCard.tsx:642, src/components/ContextMenu.tsx:975, src/components/ContextMenu.tsx:1067, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×2) — src/components/ContactsView.tsx:875, src/components/ContextMenu.tsx:769
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×5) — src/components/AddAgentsPopover.tsx:54, src/components/DevDrawer.tsx:39, src/components/FirstRunModelGate.tsx:128, …
A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×11) — src/components/ContactsView.tsx:529, src/components/ContactsView.tsx:550, src/components/ContactsView.tsx:571, …
The repo's own CSS styles .navrow with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. (×3) — src/components/ContactsView.tsx:560, src/components/ContactsView.tsx:632, src/components/FavoritesView.tsx:332
This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — src/components/ContactsView.tsx:1093
This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×2) — src/components/ContextMenu.tsx:1367, src/components/ContextMenu.tsx:1421
The repo's own CSS styles .cal-day with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — src/components/DateCalendar.tsx:160
The repo's own CSS styles .sec-head with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — src/components/FavoritesView.tsx:328
This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. (×3) — src/components/FavoritesView.tsx:380, src/components/MessageBubble.tsx:535, src/components/RosterPanel.tsx:176
This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×2) — src/components/GlobalSearch.tsx:451, src/components/NewProjectModal.tsx:82
This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — src/components/KnowledgePreview.tsx:167
This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it. (×6) — src/components/MSetSelect.tsx:64, src/components/ModelBindingModule.tsx:273, src/components/ModelBindingModule.tsx:281, …
The repo's own CSS styles .mrow with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — src/components/MessageBubble.tsx:466
The repo's own CSS styles .dm-pressable with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — src/components/RosterPanel.tsx:196
This <div> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — src/components/ZoomPan.tsx:213
This <div> binds wheel, pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — src/preview/renderers/ImagePreview.tsx:85
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator. — src/components/ContextMenu.tsx:1287
`.citem .unread-pill` sets color: #fff on background-color: #ec5d62 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/styles/knowe-components.css:1823
`html.dark .md pre code .ln` sets color: #565771 on background-color: #1e1e28 — 2.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/styles/knowe-components.css:2086
`.frg-enter` sets color: #fff on background-color: #b08752 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/components/first-run.css:164
`.plm-apply` sets color: #fff on background-color: #b08752 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/components/settings-view.css:237
`.set-update-install` sets color: #fff on background-color: #4f7cff — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/components/settings-view.css:270
`.conn-dot.fail` sets color: #a9564e on background-color: #f6ecea — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/components/settings-view.css:327
`.table-card .icon-btn.del:hover` sets color: #a9564e on background-color: #f6ecea — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/components/settings-view.css:349
`.composer .tiptap-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/styles/knowe-components.css:595
`.temp-slider` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/styles/knowe-components.css:1010
`input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/styles/knowe-tokens.css:70
`.grid-list` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/components/role-picker.css:78
`.mset-field input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/components/settings-view.css:73
`.reasoning` moves (`animation: r-rise 0.72s 0.02s var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:13
`.reasoning .chev` moves (`transition: transform 0.52s var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:84
`.reasoning-scroll.live` moves (`transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:172
`.reasoning-stream` moves (`transition: transform 0.56s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:177
`.bubble.agent` moves (`transition: max-width 800ms cubic-bezier(0.77, 0, 0.175, 1),
max-height 800ms cubic-bezier(0.77, 0, 0.175, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:233
`.reasoning-scroll:not(.live) .reasoning-stream` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:274
`.suggestions` moves (`animation: r-drop 0.6s var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:299
`.suggestions` moves (`transition: max-height 0.48s var(--ease-inout),
margin-top 0.48s var(--ease-inout),
opacity 0.3s ease,
transform 0.48s var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:302
`.suggestions .suggestion` moves (`transition: transform 0.42s var(--ease-inout),
box-shadow 0.28s var(--ease-out),
background 0.24s ease,
opacity 0.28s ease,
filter 0.28s ease,
height 0.38s var(--ease-inout),
margin 0.38s var(--ease-inout),
padding 0.38s var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:339
`.bubble.agent.morph-in` moves (`animation: r-bubble-morph 0.6s var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/bubble-reasoning.css:400
`.msgs` moves (`transition: opacity 140ms var(--ease-out),transform 140ms var(--ease-out)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:218
`.banner` moves (`animation: msgIn var(--dur-soft) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:226
`.typing i` moves (`animation: softWave 1.3s var(--ease-inout) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:287
`.approval-slot .approval.enter-soft` moves (`animation: card-unfold 800ms cubic-bezier(0.77, 0, 0.175, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:411
`.ap-task-resize::after` moves (`transition: background var(--dur-soft, .2s) var(--ease-out, ease), width var(--dur-soft, .2s) var(--ease-out, ease), opacity var(--dur-soft, .2s) var(--ease-out, ease)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:445
`.ap-task-md` moves (`transition: max-height 260ms var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:514
`.ap-task-md > .md` moves (`animation: knoweActIn 240ms var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:515
`.ap-adjusting` moves (`animation: knoweActIn 220ms var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:551
`.ap-progress` moves (`transition: transform 1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:559
`.ap-resolved-bar` moves (`animation: msgIn var(--dur-soft) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:564
`.quote-bar` moves (`animation: msgIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:679
`.attach-strip` moves (`animation: msgIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:687
`.attach-chip` moves (`animation: msgIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:692
`.dropzone .dz-card` moves (`animation: modalIn var(--dur-enter) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:714
`.at-pop` moves (`animation: menuIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:723
`.r-av.busy::before` moves (`animation: breatheRing 1.2s var(--ease-inout) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:751
`.hovercard` moves (`animation: menuIn var(--dur-enter) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/styles/knowe-components.css:864
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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.
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.
`SocketAPI` declares 19 required operations: `connect`, `disconnect`, `sendMessage`, `approve`, `reject`, `feedbackInstruction`, `stopWorker`, `createProject`, `addAgents`, `updateAgentProfile`, `setProjectDirectory`, `cancelProjectDirectory`, `requestSnapshot`, `requestHistory`, `sendCommand`, `noteIncremental`, `_debugReadyState`, `_getHandshakeBuffer`, `_getPendingEchoes`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/transport/socket.ts:142
`KnoweStore` declares 60 required operations: `getConv`, `getActiveConv`, `switchProject`, `enterDm`, `exitDm`, `syncAllProjects`, `populateFromCache`, `removeCacheStaleProjects`, `buildSessionDirCache`, `markSessionDirDirty`, `setWindowFocused`, `markRead`, `reportRead`, `registerProject`, `getProjectList`, `syncConversationStates`, `setProjectPinned`, `setProjectMuted`, `setProjectFolded`, `renameProject`, `deleteProjectPermanently`, `deleteAgentPermanently`, `togglePinnedCollapsed`, `toggleFoldedOpen`, `handleEvent`, `applyIncrementalEvents`, `ackTransientFrame`, `setConnStatus`, `sendMessage`, `approve`, `reject`, `feedbackInstruction`, `stopWorker`, `createProject`, `addAgents`, `updateAgentProfile`, `setDraft`, `clearDraft`, `addAttachments`, `removeAttachment`, and 20 more. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/store/store.ts:556
`SettingsState` declares 30 required operations: `setUserName`, `setAvatar`, `saveMainModel`, `editMainModel`, `saveAuxModel`, `editAuxModel`, `clearAuxModel`, `saveAgentModel`, `editAgentModel`, `clearAgentModel`, `addModelProfile`, `updateModelProfile`, `removeModelProfile`, `moveModelProfile`, `toggleProfilePool`, `setConnState`, `clearConnState`, `testAllConnections`, `setNotifyDesktop`, `setCloseToTray`, `setApprovalTimeout`, `setGroupApprovalTimeout`, `setAppearance`, `setFontScale`, `setLanguage`, `markModelBindingStale`, `clearRestartRequired`, `applyModelBinding`, `reconcileFromBackend`, `pushToBackend`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/store/settings.ts:63
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
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.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR. The repository declares its tests as `npm test` (`package.json`): run that.
Do you agree with this assessment?
P2 · Observability8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:31
What to do
Run what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · 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.
`execSync` in `afterPack` 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:25, REDACTED:39
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 Safety9.3 / 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 — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
6 duplicated blocks under src/ have copies in at least two of the sibling directories app, components, preview — 4 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/components/ContextMenu.tsx:734
src/store/messageCache.ts:58 · src/store/sessionDirCache.ts:74 — 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/store/messageCache.ts:58
src/components/ApprovalCard.tsx:379 · src/components/DirectoryRecoveryCard.tsx:152 — the two spans are one implementation copied and then locally edited — 258 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/components/ApprovalCard.tsx:379
src/store/filePreview.ts:115 · src/store/filePreview.ts:155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/store/filePreview.ts:115
src/components/KnowledgeView.tsx:405 · src/components/KnowledgeView.tsx:444 — 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/components/KnowledgeView.tsx:405
src/components/MSetSelect.tsx:48 · src/components/ModelBindingModule.tsx:246 — the two spans are one implementation copied and then locally edited — 161 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/components/MSetSelect.tsx:48
src/components/MessageBubble.tsx:384 · src/components/StreamBubble.tsx:43 — 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/components/MessageBubble.tsx:384
src/store/tokenUsage.ts:200 · src/store/tokenUsage.ts:227 — the two spans are one implementation copied and then locally edited — 201 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/store/tokenUsage.ts:200
src/store/store.ts:1198 · src/store/store.ts:1220 · src/store/store.ts:1247 — all 3 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/store/store.ts:1198
scripts/make-icon-icns.mjs:51 · scripts/make-icon-ico.mjs:32 — the two spans are one implementation copied and then locally edited — 172 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. — scripts/make-icon-icns.mjs:51
src/components/ConvList.tsx:226 · src/components/ConvList.tsx:281 — the two spans are one implementation copied and then locally edited — 132 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/components/ConvList.tsx:226
src/components/KnowledgeView.tsx:600 · src/components/KnowledgeView.tsx:682 — 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/components/KnowledgeView.tsx:600
src/components/KnowledgeView.tsx:1180 · src/components/KnowledgeView.tsx:1199 — 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/components/KnowledgeView.tsx:1180
src/contract/envelope.ts:1026 · src/contract/envelope.ts:1281 — 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/contract/envelope.ts:1026
src/store/state.ts:1233 · src/store/state.ts:1277 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/store/state.ts:1233
electron/main.ts:431 · electron/trayCard.ts:32 — 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. — electron/main.ts:431
scripts/make-avatars.mjs:46 · scripts/make-logo-v4.mjs:31 — 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. — scripts/make-avatars.mjs:46
src/components/ContextMenu.tsx:1174 · src/components/ContextMenu.tsx:1229 — both copies are in the same file, so extract the 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/components/ContextMenu.tsx:1174
src/components/FavoritesView.tsx:309 · src/components/FavoritesView.tsx:337 — the two spans are one implementation copied and then locally edited — 105 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/components/FavoritesView.tsx:309
src/store/knowledge.ts:423 · src/store/knowledge.ts:441 — 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/store/knowledge.ts:423
src/components/ApprovalCard.tsx:486 · src/components/ApprovalCard.tsx:502 — 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/components/ApprovalCard.tsx:486
src/components/FileCard.tsx:36 · src/components/FileCard.tsx:61 — both copies are in the same file, so extract the 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/components/FileCard.tsx:36
src/components/TokenUsagePanel.tsx:735 · src/components/TokenUsagePanel.tsx:756 — both copies are in the same file, so extract the 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/components/TokenUsagePanel.tsx:735
src/preview/renderers/PdfPreview.tsx:82 · src/preview/renderers/PdfPreview.tsx:161 — the two spans are one implementation copied and then locally edited — 77 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/preview/renderers/PdfPreview.tsx:82
src/components/ContactsView.tsx:388 · src/components/FavoritesView.tsx:126 — 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/components/ContactsView.tsx:388
src/components/KnowledgeView.tsx:782 · src/components/KnowledgeView.tsx:796 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/components/KnowledgeView.tsx:782
src/components/RecordsDrawer.tsx:301 · src/components/RecordsDrawer.tsx:387 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/components/RecordsDrawer.tsx:301
src/components/RosterPanel.tsx:134 · src/components/TokenUsagePanel.tsx:654 — 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/components/RosterPanel.tsx:134
src/components/ChatStream.tsx:40 · src/components/ChatStream.tsx:440 — both copies are in the same file, so extract the 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/components/ChatStream.tsx:40
src/components/ContextMenu.tsx:881 · src/components/MSetSelect.tsx:30 — 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/components/ContextMenu.tsx:881
src/components/ContextMenu.tsx:1132 · src/components/ContextMenu.tsx:1186 · src/components/ContextMenu.tsx:1318 — 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. — src/components/ContextMenu.tsx:1132
src/components/ContextMenu.tsx:734 · src/preview/renderers/FallbackPreview.tsx:20 — the two spans are one implementation copied and then locally edited — 70 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/components/ContextMenu.tsx:734
src/components/FileCard.tsx:86 · src/components/FileCard.tsx:235 — both copies are in the same file, so extract the 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/components/FileCard.tsx:86
src/components/KnowledgeView.tsx:528 · src/components/KnowledgeView.tsx:1147 — both copies are in the same file, so extract the 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/components/KnowledgeView.tsx:528
src/components/KnowledgeView.tsx:1126 · src/components/KnowledgeView.tsx:1171 — 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/components/KnowledgeView.tsx:1126
electron/previewNavigation.ts:140 · src/preview/renderers/MarkdownPreview.tsx:82 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — electron/previewNavigation.ts:140
src/components/ChatStream.tsx:538 · src/components/ChatStream.tsx:577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/components/ChatStream.tsx:538
src/components/FileCard.tsx:21 · src/preview/PreviewApp.tsx:176 — the two spans are one implementation copied and then locally edited — 54 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/components/FileCard.tsx:21
src/components/ModelBindingModule.tsx:269 · src/components/ModelBindingModule.tsx:364 — 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/components/ModelBindingModule.tsx:269
src/components/RangeCalendar.tsx:88 · src/components/RosterPanel.tsx:136 · src/components/TokenUsagePanel.tsx:656 — the 3 copies are spread across 3 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/components/RangeCalendar.tsx:88
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
src/preview/renderers/PdfPreview.tsx:10 imports pdfjs-dist/build/pdf.worker.min.mjs?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/preview/renderers/PdfPreview.tsx:10
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
applyEvent has cyclomatic complexity 225 and cognitive complexity 403; 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/store/state.ts:830
KnowledgeView has cyclomatic complexity 66 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/KnowledgeView.tsx:169
(anonymous) has cyclomatic complexity 60 and cognitive complexity 94; 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/store/store.ts:1461
highlightGenericLine has cyclomatic complexity 58 and cognitive complexity 104; 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/preview/renderers/codeSyntax.ts:202
(anonymous) has cyclomatic complexity 58 and cognitive complexity 58; 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/components/MessageBubble.tsx:376
ModelBindingModule has cyclomatic complexity 58 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/ModelBindingModule.tsx:147
(anonymous) has cyclomatic complexity 51 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/ApprovalCard.tsx:150
TokenUsagePanel has cyclomatic complexity 49 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/TokenUsagePanel.tsx:559
KnowledgePreview has cyclomatic complexity 43 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/KnowledgePreview.tsx:55
ChatStream has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/ChatStream.tsx:212
(anonymous) has cyclomatic complexity 38 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/components/ChatStream.tsx:1461
previewTabsReducer has cyclomatic complexity 35 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/preview/PreviewApp.tsx:61
highlightMarkupLine has cyclomatic complexity 33 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/preview/renderers/codeSyntax.ts:150
ConvListItem has cyclomatic complexity 31 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/ConvList.tsx:366
parseTextShape has cyclomatic complexity 30 and cognitive complexity 41; 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/preview/renderers/PptxPreview.tsx:265
markdownToTiptapDoc has cyclomatic complexity 29 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/tiptapMarkdown.ts:140
FirstRunModelGate has cyclomatic complexity 29 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/FirstRunModelGate.tsx:38
(anonymous) has cyclomatic complexity 27 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/components/GlobalSearch.tsx:133
deleteProjectPermanently has cyclomatic complexity 27 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/store/store.ts:1290
reconcileProjectAlias has cyclomatic complexity 26 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/store/projectAlias.ts:49
handleServerControlEvent has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/transport/socket.ts:593
routeEvent has cyclomatic complexity 25 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/transport/socket.ts:475
toCard has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/store/knowledge.ts:169
parseSlide has cyclomatic complexity 24 and cognitive complexity 41; 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/preview/renderers/PptxPreview.tsx:371
(anonymous) has cyclomatic complexity 24 and cognitive complexity 37; 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/components/RecordsDrawer.tsx:421
decodePng has cyclomatic complexity 24 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/make-logo-v4.mjs:59
(anonymous) has cyclomatic complexity 24 and cognitive complexity 24; 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/components/Composer.tsx:591
humanizeCompletionStatus has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/store/state.ts:2197
registerMember has cyclomatic complexity 23 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/store/state.ts:525
applyCompletionStatus has cyclomatic complexity 23 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/store/state.ts:2242
Composer has cyclomatic complexity 23 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/Composer.tsx:141
(anonymous) has cyclomatic complexity 22 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/store/store.ts:996
decorateConversationList has cyclomatic complexity 21 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/components/ContextMenu.tsx:1614
applyCompletionViewV1 has cyclomatic complexity 21 and cognitive complexity 23; 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/store/state.ts:2338
toSkillPack has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/store/knowledge.ts:219
appendToolActivity has cyclomatic complexity 20 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/store/toolActivity.ts:126
App has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/App.tsx:155
kindOf has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/preview/fileKinds.ts:66
(anonymous) has cyclomatic complexity 19 and cognitive complexity 20; 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/store/selectors.ts:187
(anonymous) has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/KnowledgeView.tsx:840
Do you agree with this assessment?
R3 · Large Files1.6 / 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/store/state.ts has 2379 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/store/state.ts:1
src/store/store.ts has 2003 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/store/store.ts:1
electron/main.ts has 1791 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — electron/main.ts:1
src/components/ContextMenu.tsx has 1738 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/components/ContextMenu.tsx:1
src/components/ChatStream.tsx has 1625 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/components/ChatStream.tsx:1
src/contract/envelope.ts has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/contract/envelope.ts:1
src/components/KnowledgeView.tsx has 1209 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/components/KnowledgeView.tsx:1
src/store/settings.ts has 1029 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/store/settings.ts:1
src/components/ContactsView.tsx has 999 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/components/ContactsView.tsx:1
src/components/TokenUsagePanel.tsx has 960 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/components/TokenUsagePanel.tsx:1
src/transport/socket.ts has 924 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/transport/socket.ts:1
src/components/Composer.tsx has 835 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/components/Composer.tsx:1
src/components/SettingsView.tsx has 784 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/components/SettingsView.tsx:1
src/components/ApprovalCard.tsx has 705 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/components/ApprovalCard.tsx:1
src/app/App.tsx has 651 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/app/App.tsx:1
src/preview/renderers/PptxPreview.tsx has 611 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/preview/renderers/PptxPreview.tsx:1
src/components/ConvList.tsx has 583 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/components/ConvList.tsx:1
src/store/knowledge.ts has 569 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/store/knowledge.ts:1
src/components/MessageBubble.tsx has 563 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/components/MessageBubble.tsx:1
src/components/RecordsDrawer.tsx has 518 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/components/RecordsDrawer.tsx:1
src/store/modelCatalog.ts has 491 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/store/modelCatalog.ts:1
src/components/FavoritesView.tsx has 454 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/components/FavoritesView.tsx:1
src/components/GlobalSearch.tsx has 439 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/components/GlobalSearch.tsx:1
src/fakeserver/FakeKnoweServer.ts has 427 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/fakeserver/FakeKnoweServer.ts:1
src/preview/PreviewApp.tsx has 425 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/preview/PreviewApp.tsx:1
src/store/tokenUsage.ts has 425 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/store/tokenUsage.ts:1
src/components/ModelBindingModule.tsx has 423 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/components/ModelBindingModule.tsx: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 Coverage6.3 / 10Adequate✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — electron/main.ts:1, src/components/KnowledgeView.tsx:1, src/components/ContactsView.tsx: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.
38 outdated package(s); JS/npm CVEs scored in D30
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 package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.4 / 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 17 application, 5 tooling and 34 test entry point(s) detected in this repo. Gate removals on `npm run typecheck` — an undetected custom entry would make these reachable.
no import path from any entry point (17 application, 5 tooling, 34 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×4) — src/store/nameGenerator.ts, src/store/agentParams.ts, REDACTED, …
Nothing imports this binding — it is safe to review for removal. (×21) — src/components/Avatar.tsx:121, src/components/KnowledgePreview.tsx:288, src/components/RangeCalendar.tsx:248, …
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×2) — electron/updater.ts:25, src/store/filePreview.ts:236
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.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×6) — src/components/Composer.tsx:45, src/components/Composer.tsx:49, REDACTED:49, …
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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.
The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception. (×6) — backend/browser_tools.py:487, REDACTED:8313, REDACTED:5275, …
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?
X17 · Uncapped recursion over a caller-supplied document2.0 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`sanitize_event` is public and takes `event: dict[str, Any]` from its caller, and it calls itself at line 140 (`sanitize_event`) with a piece of `event` — and nowhere in `sanitize_event` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `sanitize_event` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/privacy.py:140
`redact_secrets` is public and takes `value: Any` from its caller, and it calls itself at line 772 (`redact_secrets`) with a piece of `value` (and at line 774, line 776) — and nowhere in `redact_secrets` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_secrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/runtime_settings.py:772
`canonicalize` is public and takes `value: Any` from its caller, and it calls itself at line 91 (`canonicalize`) with a piece of `value` (and at line 93) — and nowhere in `canonicalize` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/tools/create_wave0_forensic_baseline.py:91
`canonical_json` is public, takes a document from its caller (line 36) and hands it to `_jsonable`, which calls itself at line 28 (`_jsonable`) with a piece of `value` (and at line 30) — and nowhere in `_jsonable` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_jsonable` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/knowe_harness/contracts.py:28
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 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.
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 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 unescaped5.2 / 10Adequate✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:215
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`createSocket` accepts `url` from the caller and keeps it in `url` on line 262, where only it can read the value — but nothing ever reads `url`. Setting `url` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `url` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `url` from the accepted options so callers stop setting a knob that does nothing. — src/transport/socket.ts:262
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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 `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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×27) — src/transport/socket.ts:68, src/transport/socket.ts:449, src/transport/socket.ts:721, …
`.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. — src/components/FileCard.tsx:223
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×12) — backend/attachments.py:84, backend/attachments.py:300, backend/attachments.py:311, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
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.
~0.8 `!` null assertions per 1k TypeScript source lines — 33 assertion(s) across the 39986 source line(s) of the 115 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/components/ChatStream.tsx (12), electron/main.ts (5), src/components/TokenUsagePanel.tsx (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 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 — 37 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 13 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'sqlite3' (backend/storage_migrator.py:146) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and MongoEngine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'sqlite3' (backend/storage_migrator.py:146) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, SQL schemas). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'sqlite3' (backend/storage_migrator.py:146) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 54 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — not 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. 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> knowe@1.0.39 dev / > vite / sh: 1: vite: not found" 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 — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D12 Dependency Hygiene — Not scored — 8 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — single-contributor 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.
D20 ADR Quality — Repository kind not determined
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 3 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — 1914 of 1922 comment blocks were not judged (1741 in a non-Latin script, 173 in a language other than English): redundancy is judged by word overlap with the code's identifiers, which cannot be measured across languages.
D25 ADR Conformance — no ADRs to check
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D34 Knowledge Freshness — too few commits to judge knowledge freshness
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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.
D5 Coupling — D5 reads a .NET project-reference graph only — this repository's production source is .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. 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.
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (59 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — no CI workflow found
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, 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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 42% of this repository's production lines — python (51,685 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — X29 reached only 42% of this repository's production lines — python (51,685 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×10
Click handler on a non-interactive <div> src/components/ContactsView.tsx:529— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContactsView.tsx:550— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContactsView.tsx:571— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContactsView.tsx:659— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContactsView.tsx:1064— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContextMenu.tsx:985— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContextMenu.tsx:1036— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/ContextMenu.tsx:1452— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/MessageBubble.tsx:459— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> src/components/MessageBubble.tsx:513— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×7
Clickable element isn't keyboard-operable src/components/ContactsView.tsx:560— The repo's own CSS styles .navrow with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable src/components/ContactsView.tsx:632— The repo's own CSS styles .navrow with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable src/components/DateCalendar.tsx:160— The repo's own CSS styles .cal-day with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable src/components/FavoritesView.tsx:328— The repo's own CSS styles .sec-head with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable src/components/FavoritesView.tsx:332— The repo's own CSS styles .navrow with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable src/components/MessageBubble.tsx:466— The repo's own CSS styles .mrow with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable src/components/RosterPanel.tsx:196— The repo's own CSS styles .dm-pressable with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Clickable role="option" that no keyboard user can reach · ×6
Clickable role="option" that no keyboard user can reach src/components/MSetSelect.tsx:64— This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
Clickable role="option" that no keyboard user can reach src/components/ModelBindingModule.tsx:273— This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
Clickable role="option" that no keyboard user can reach src/components/ModelBindingModule.tsx:281— This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
Clickable role="option" that no keyboard user can reach src/components/ModelBindingModule.tsx:290— This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
Clickable role="option" that no keyboard user can reach src/components/ModelBindingModule.tsx:368— This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
Clickable role="option" that no keyboard user can reach src/components/ModelBindingModule.tsx:377— This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
AC2 · Forms & labels· <input> without a programmatic label · ×5
<input> without a programmatic label src/components/ContactsView.tsx:875— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/components/ContextMenu.tsx:769— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/components/ContextMenu.tsx:975— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/components/ContextMenu.tsx:1172— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/components/ContextMenu.tsx:1227— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics· Double-click handler on a non-interactive <div> · ×5
Double-click handler on a non-interactive <div> src/components/FavoritesView.tsx:380— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> src/components/MessageBubble.tsx:535— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> src/components/RosterPanel.tsx:176— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> src/components/ZoomPan.tsx:213— This <div> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> src/preview/renderers/ImagePreview.tsx:85— This <div> binds wheel, pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC2 · Forms & labels· <label> that labels no control · ×4
<label> that labels no control src/components/ApprovalCard.tsx:456— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/ContactsView.tsx:874— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/ContactsView.tsx:890— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/DirectoryRecoveryCard.tsx:197— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <textarea> without a programmatic label · ×3
<textarea> without a programmatic label src/components/ApprovalCard.tsx:642— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label src/components/ContextMenu.tsx:1067— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label src/components/ContextMenu.tsx:1287— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×2
Hover-only interaction on <div> src/components/ContextMenu.tsx:1367— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> src/components/ContextMenu.tsx:1421— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Focusable <div> isn't keyboard-operable src/components/ContactsView.tsx:1093— This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×1
Click handler on a non-interactive <span> src/components/ContextMenu.tsx:1014— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics· Clickable role="separator" that no keyboard user can reach · ×1
Clickable role="separator" that no keyboard user can reach src/components/KnowledgePreview.tsx:167— This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
Unlisted import '@tiptap/core' src/components/Composer.tsx:45— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@tiptap/pm' src/components/Composer.tsx:49— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'unist-util-visit' REDACTED:57— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 950 finding(s)
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file electron/main.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/components/KnowledgeView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/ContactsView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/SettingsView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/app/App.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/preview/renderers/PptxPreview.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/RecordsDrawer.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/FavoritesView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/preview/PreviewApp.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/ModelBindingModule.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file electron/trayCard.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/store/nameGenerator.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/shared/bridge.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/preview/renderers/MarkdownPreview.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/KnowledgePreview.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/preview/renderers/codeSyntax.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/preview/renderers/PdfPreview.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/ZoomPan.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/FirstRunModelGate.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file electron/preload.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/components/DateCalendar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/preview/renderers/SheetPreview.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/preview/PreviewTabs.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/observe/DevCorridor.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file electron/updater.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.
FunctionTooLong: ChatStream.ChatStream src/components/ChatStream.tsx:212— FunctionTooLong — ChatStream runs 982 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 882 over it, 9.82× 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: KnowledgeView.KnowledgeView src/components/KnowledgeView.tsx:169— FunctionTooLong — KnowledgeView runs 720 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 620 over it, 7.20× 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: Composer.Composer src/components/Composer.tsx:141— FunctionTooLong — Composer runs 575 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 475 over it, 5.75× 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: socket.createSocket src/transport/socket.ts:262— FunctionTooLong — createSocket runs 460 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 360 over it, 4.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: TokenUsagePanel.TokenUsagePanel src/components/TokenUsagePanel.tsx:559— FunctionTooLong — TokenUsagePanel runs 383 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 283 over it, 3.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: App.App src/app/App.tsx:155— FunctionTooLong — App runs 338 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 238 over it, 3.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RecordsDrawer.RecordsDrawer src/components/RecordsDrawer.tsx:127— FunctionTooLong — RecordsDrawer runs 332 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 232 over it, 3.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ApprovalCard.ApprovalCard src/components/ApprovalCard.tsx:150— FunctionTooLong — ApprovalCard runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ModelBindingModule.ModelBindingModule src/components/ModelBindingModule.tsx:147— FunctionTooLong — ModelBindingModule runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ContextMenu.ForwardModalBody src/components/ContextMenu.tsx:847— FunctionTooLong — ForwardModalBody runs 251 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: FavoritesView.FavoritesView src/components/FavoritesView.tsx:135— FunctionTooLong — FavoritesView 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: PreviewApp.PreviewApp src/preview/PreviewApp.tsx:172— FunctionTooLong — PreviewApp runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ConvList.ConvList src/components/ConvList.tsx:40— FunctionTooLong — ConvList runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: KnowledgeView.KnowledgeModals src/components/KnowledgeView.tsx:1044— FunctionTooLong — KnowledgeModals runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× 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: ContactsView.ContactsView src/components/ContactsView.tsx:397— FunctionTooLong — ContactsView runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.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: TokenUsagePanel.TrendChart src/components/TokenUsagePanel.tsx:214— FunctionTooLong — TrendChart runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.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: KnowledgePreview.KnowledgePreview src/components/KnowledgePreview.tsx:55— FunctionTooLong — KnowledgePreview runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SettingsView.ModelsPane src/components/SettingsView.tsx:296— FunctionTooLong — ModelsPane 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: main.registerIpc electron/main.ts:1433— FunctionTooLong — registerIpc 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: ContactsView.AgentProfile src/components/ContactsView.tsx:744— FunctionTooLong — AgentProfile runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× 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: PdfPreview.PdfPreview src/preview/renderers/PdfPreview.tsx:36— FunctionTooLong — PdfPreview runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: knowledge.useKnowledgeStore src/store/knowledge.ts:366— FunctionTooLong — useKnowledgeStore runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RosterPanel.RosterPanel src/components/RosterPanel.tsx:49— FunctionTooLong — RosterPanel runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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: RangeCalendar.RangeCalendar src/components/RangeCalendar.tsx:48— FunctionTooLong — RangeCalendar runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ConvList.ConvListItem src/components/ConvList.tsx:366— FunctionTooLong — ConvListItem runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: REDACTED REDACTED— FileTooLong — 6525 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6025 over it, 13.05× 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 — 5371 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4871 over it, 10.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: backend/tools_knowe.py backend/tools_knowe.py— FileTooLong — 2673 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2173 over it, 5.35× 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: knowe_harness/completion.py backend/knowe_harness/completion.py— FileTooLong — 2116 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1616 over it, 4.23× 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 — 1806 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1306 over it, 3.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: backend/knowledge_graph.py backend/knowledge_graph.py— FileTooLong — 1786 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1286 over it, 3.57× 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: backend/memory_manager.py backend/memory_manager.py— FileTooLong — 1589 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1089 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: store/state.ts src/store/state.ts— FileTooLong — 1364 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 864 over it, 2.73× 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: components/ContextMenu.tsx src/components/ContextMenu.tsx— FileTooLong — 1355 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 855 over it, 2.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: store/store.ts src/store/store.ts— FileTooLong — 1243 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: useKnoweStore (809-2180). The bar is 500 significant lines; this is 743 over it, 2.49× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: backend/runtime.py backend/runtime.py— FileTooLong — 1232 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 732 over it, 2.46× 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: components/ChatStream.tsx src/components/ChatStream.tsx— FileTooLong — 1122 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: ChatStream (212-1679). The bar is 500 significant lines; this is 622 over it, 2.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: electron/main.ts electron/main.ts— FileTooLong — 1085 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 585 over it, 2.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/KnowledgeView.tsx src/components/KnowledgeView.tsx— FileTooLong — 1007 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: KnowledgeView (169-1037). The bar is 500 significant lines; this is 507 over it, 2.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: agents/zinnia.py backend/agents/zinnia.py— FileTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 399 over it, 1.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: store/settings.ts src/store/settings.ts— FileTooLong — 805 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 305 over it, 1.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: components/TokenUsagePanel.tsx src/components/TokenUsagePanel.tsx— FileTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 297 over it, 1.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: knowe_core/provider_client.py backend/knowe_core/provider_client.py— FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 233 over it, 1.47× 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: backend/runtime_settings.py backend/runtime_settings.py— FileTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 232 over it, 1.46× 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: components/ContactsView.tsx src/components/ContactsView.tsx— FileTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 231 over it, 1.46× 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: contract/envelope.ts src/contract/envelope.ts— FileTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 218 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/Composer.tsx src/components/Composer.tsx— FileTooLong — 649 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 149 over it, 1.30× 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: components/SettingsView.tsx src/components/SettingsView.tsx— FileTooLong — 641 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 141 over it, 1.28× 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: backend/persist.py backend/persist.py— FileTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 106 over it, 1.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: knowe_harness/projections.py backend/knowe_harness/projections.py— FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 105 over it, 1.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Swallowed exception (empty catch) src/transport/socket.ts:68— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/transport/socket.ts:449— 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/transport/socket.ts:721— 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/transport/socket.ts:809— 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/transport/socket.ts:816— 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/store/filePreview.ts:277— 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/store/knowledge.ts:420— 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/store/messageCache.ts:69— 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/store/messageCache.ts:107— 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/store/platform.ts:37— 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/store/platform.ts:90— 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/store/sessionDirCache.ts:85— 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/store/sessionDirCache.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/store/settings.ts:889— 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/store/skeletonCache.ts:75— 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/store/skeletonCache.ts:83— 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/store/skeletonCache.ts:100— 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/shared/featureFlags.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/shared/runtimeFetch.ts:42— 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/preview/renderers/PptxPreview.tsx:469— 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/fakeserver/FakeKnoweServer.ts:158— 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/fakeserver/FakeKnoweServer.ts:400— 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/components/ContactsView.tsx:128— 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/components/ContextMenu.tsx:523— 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/components/DateCalendar.tsx:68— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
+ 3 more in this group — see findings.md.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×27
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:13— `.reasoning` moves (`animation: r-rise 0.72s 0.02s var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:84— `.reasoning .chev` moves (`transition: transform 0.52s var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:172— `.reasoning-scroll.live` moves (`transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:177— `.reasoning-stream` moves (`transition: transform 0.56s cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:233— `.bubble.agent` moves (`transition: max-width 800ms cubic-bezier(0.77, 0, 0.175, 1),
max-height 800ms cubic-bezier(0.77, 0, 0.175, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:274— `.reasoning-scroll:not(.live) .reasoning-stream` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:299— `.suggestions` moves (`animation: r-drop 0.6s var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:302— `.suggestions` moves (`transition: max-height 0.48s var(--ease-inout),
margin-top 0.48s var(--ease-inout),
opacity 0.3s ease,
transform 0.48s var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:339— `.suggestions .suggestion` moves (`transition: transform 0.42s var(--ease-inout),
box-shadow 0.28s var(--ease-out),
background 0.24s ease,
opacity 0.28s ease,
filter 0.28s ease,
height 0.38s var(--ease-inout),
margin 0.38s var(--ease-inout),
padding 0.38s var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/bubble-reasoning.css:400— `.bubble.agent.morph-in` moves (`animation: r-bubble-morph 0.6s var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:218— `.msgs` moves (`transition: opacity 140ms var(--ease-out),transform 140ms var(--ease-out)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:226— `.banner` moves (`animation: msgIn var(--dur-soft) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:287— `.typing i` moves (`animation: softWave 1.3s var(--ease-inout) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:411— `.approval-slot .approval.enter-soft` moves (`animation: card-unfold 800ms cubic-bezier(0.77, 0, 0.175, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:445— `.ap-task-resize::after` moves (`transition: background var(--dur-soft, .2s) var(--ease-out, ease), width var(--dur-soft, .2s) var(--ease-out, ease), opacity var(--dur-soft, .2s) var(--ease-out, ease)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:514— `.ap-task-md` moves (`transition: max-height 260ms var(--ease-inout)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:515— `.ap-task-md > .md` moves (`animation: knoweActIn 240ms var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:551— `.ap-adjusting` moves (`animation: knoweActIn 220ms var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:559— `.ap-progress` moves (`transition: transform 1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:564— `.ap-resolved-bar` moves (`animation: msgIn var(--dur-soft) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:679— `.quote-bar` moves (`animation: msgIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:687— `.attach-strip` moves (`animation: msgIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:692— `.attach-chip` moves (`animation: msgIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:714— `.dropzone .dz-card` moves (`animation: modalIn var(--dur-enter) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/styles/knowe-components.css:723— `.at-pop` moves (`animation: menuIn var(--dur-base) var(--ease-out) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Swallowed exception (caught, then discarded) backend/attachments.py:84— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:300— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:311— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:320— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:327— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:332— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:339— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:353— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:360— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:371— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:379— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) backend/attachments.py:395— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Hotspot: src/components/ChatStream.tsx src/components/ChatStream.tsx:212— src/components/ChatStream.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 307 in ChatStream.ChatStream at line 212. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- src/components/ChatStream.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: electron/main.ts electron/main.ts:1433— electron/main.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in main.registerIpc at line 1433. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- electron/main.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/store/state.ts src/store/state.ts:830— src/store/state.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 232 in state.applyEvent at line 830. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- src/store/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/components/Composer.tsx src/components/Composer.tsx:141— src/components/Composer.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 130 in Composer.Composer at line 141. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- src/components/Composer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:1767— REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in ProjectEngine._persist_token_usage at line 1767. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/app/App.tsx src/app/App.tsx:155— src/app/App.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in App.App at line 155. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- src/app/App.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/components/TokenUsagePanel.tsx src/components/TokenUsagePanel.tsx:559— src/components/TokenUsagePanel.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in TokenUsagePanel.TokenUsagePanel at line 559. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- src/components/TokenUsagePanel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:354— REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in token_usage.aggregate_token_usage at line 354. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: backend/knowe_core/provider_client.py backend/knowe_core/provider_client.py:375— backend/knowe_core/provider_client.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in ProviderClient.chat_stream at line 375. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- backend/knowe_core/provider_client.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: backend/knowe_adapters/model_adapter.py backend/knowe_adapters/model_adapter.py:61— backend/knowe_adapters/model_adapter.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ProviderModelAdapter.from_legacy at line 61. 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-05-28..2026-08-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-28 16:15:30 +08:00' --until='2026-08-26 16:15:30 +08:00' --full-history --no-merges -- backend/knowe_adapters/model_adapter.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×7
Modal dialog does not manage focus src/components/AddAgentsPopover.tsx:54— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus src/components/DevDrawer.tsx:39— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus src/components/FirstRunModelGate.tsx:128— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus src/components/GlobalSearch.tsx:451— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus src/components/NewProjectModal.tsx:82— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus src/components/RangeCalendar.tsx:175— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus src/components/RecordsDrawer.tsx:503— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
TooManyMethods: ProjectEngine REDACTED:1402— TooManyMethods — 204 methods. The bar is 30 methods; this is 174 over it, 6.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: KnoweServer REDACTED:393— TooManyMethods — 178 methods. The bar is 30 methods; this is 148 over it, 5.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SQLiteCompletionStore backend/knowe_harness/completion.py:869— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: KnowledgeAssetManager REDACTED:171— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Store backend/persist.py:166— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: KnowledgeGraphManager backend/knowledge_graph.py:137— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MemoryManager backend/memory_manager.py:98— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (7 lines × 2) REDACTED:1611— REDACTED:1611-1617 | REDACTED:1644-1651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) REDACTED:665— REDACTED:665-671 | REDACTED:851-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) REDACTED:795— REDACTED:795-801 | REDACTED:841-847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `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 (7 lines × 2) REDACTED:1625— REDACTED:1625-1631 | REDACTED:1658-1664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (7 lines × 2) backend/knowledge_graph.py:1462— backend/knowledge_graph.py:1462-1468 | backend/knowledge_graph.py:1719-1725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) REDACTED:2569— REDACTED:2569-2575 | REDACTED:2772-2778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×5
Focus outline removed in CSS without a :focus replacement src/styles/knowe-components.css:595— `.composer .tiptap-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement src/styles/knowe-components.css:1010— `.temp-slider` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement src/styles/knowe-tokens.css:70— `input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement src/components/role-picker.css:78— `.grid-list` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement src/components/settings-view.css:73— `.mset-field input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Duplicated block (11 lines × 2) backend/agents/deepseek.py:528— backend/agents/deepseek.py:528-538 | backend/agents/zinnia.py:1288-1298 — 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) backend/knowe_core/provider_client.py:451— backend/knowe_core/provider_client.py:451-461 | backend/knowe_core/provider_client.py:578-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/knowe_core/provider_client.py:463` calls `_stream_started_error` and `backend/knowe_core/provider_client.py:589` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) backend/knowe_core/provider_client.py:461— backend/knowe_core/provider_client.py:461-471 | backend/knowe_core/provider_client.py:474-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) backend/knowe_core/provider_client.py:464— backend/knowe_core/provider_client.py:464-474 | backend/knowe_core/provider_client.py:589-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) REDACTED:1956— REDACTED:1956-1966 | REDACTED:2322-2332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) backend/agents/zinnia.py:1051— backend/agents/zinnia.py:1051-1055 | backend/agents/zinnia.py:1142-1146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) backend/knowledge_api.py:276— backend/knowledge_api.py:276-280 | backend/knowledge_api.py:284-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) backend/knowe_provenance/build_manifest.py:40— backend/knowe_provenance/build_manifest.py:40-44 | backend/tools/create_wave0_forensic_baseline.py:35-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) backend/tools_knowe.py:582— backend/tools_knowe.py:582-586 | backend/tools_knowe.py:698-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `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 (5 lines × 2) backend/tools_knowe.py:2645— backend/tools_knowe.py:2645-2649 | backend/tools_knowe.py:2716-2720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2 locations) src/components/ChatStream.tsx:40— src/components/ChatStream.tsx:40 · src/components/ChatStream.tsx:440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2 locations) src/components/ContextMenu.tsx:881— src/components/ContextMenu.tsx:881 · src/components/MSetSelect.tsx:30 — 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 (13 lines × 2 locations) src/components/FileCard.tsx:86— src/components/FileCard.tsx:86 · src/components/FileCard.tsx:235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2 locations) src/components/KnowledgeView.tsx:528— src/components/KnowledgeView.tsx:528 · src/components/KnowledgeView.tsx:1147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2 locations) src/components/KnowledgeView.tsx:1126— src/components/KnowledgeView.tsx:1126 · src/components/KnowledgeView.tsx:1171 — 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.
X1 · Async correctness· Task from `asyncio.create_task` is not kept · ×5
Task from `asyncio.create_task` is not kept REDACTED:8313— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept REDACTED:5275— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept REDACTED:5347— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept backend/agents/deepseek.py:553— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept backend/agents/deepseek.py:559— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×4
Edited copy of a member (9 corresponding lines) backend/knowe_harness/contracts.py:25— backend/knowe_harness/contracts.py:25-33 | backend/runtime.py:65-75 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) backend/persist.py:474— backend/persist.py:474-487 | backend/persist.py:526-534 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) REDACTED:4543— REDACTED:4543-4551 | REDACTED:4555-4563 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) REDACTED:3022— REDACTED:3022-3030 | REDACTED:3845-3853 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2 locations) src/components/ContactsView.tsx:388— src/components/ContactsView.tsx:388 · src/components/FavoritesView.tsx:126 — 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 (14 lines × 2 locations) src/components/KnowledgeView.tsx:782— src/components/KnowledgeView.tsx:782 · src/components/KnowledgeView.tsx:796 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (14 lines × 2 locations) src/components/RecordsDrawer.tsx:301— src/components/RecordsDrawer.tsx:301 · src/components/RecordsDrawer.tsx:387 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) src/components/RosterPanel.tsx:134— src/components/RosterPanel.tsx:134 · src/components/TokenUsagePanel.tsx:654 — 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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×4
Recursive walk over a caller-supplied document has no depth cap backend/privacy.py:140— `sanitize_event` is public and takes `event: dict[str, Any]` from its caller, and it calls itself at line 140 (`sanitize_event`) with a piece of `event` — and nowhere in `sanitize_event` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `sanitize_event` 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 backend/runtime_settings.py:772— `redact_secrets` is public and takes `value: Any` from its caller, and it calls itself at line 772 (`redact_secrets`) with a piece of `value` (and at line 774, line 776) — and nowhere in `redact_secrets` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_secrets` 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 backend/tools/create_wave0_forensic_baseline.py:91— `canonicalize` is public and takes `value: Any` from its caller, and it calls itself at line 91 (`canonicalize`) with a piece of `value` (and at line 93) — and nowhere in `canonicalize` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize` 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 backend/knowe_harness/contracts.py:28— `canonical_json` is public, takes a document from its caller (line 36) and hands it to `_jsonable`, which calls itself at line 28 (`_jsonable`) with a piece of `value` (and at line 30) — and nowhere in `_jsonable` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_jsonable` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Low contrast colour pair in CSS (3.3:1) src/styles/knowe-components.css:1823— `.citem .unread-pill` sets color: #fff on background-color: #ec5d62 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.3:1) src/components/first-run.css:164— `.frg-enter` sets color: #fff on background-color: #b08752 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.3:1) src/components/settings-view.css:237— `.plm-apply` sets color: #fff on background-color: #b08752 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) REDACTED:113— REDACTED:113-119 | backend/worker_gateway_runtime.py:61-65 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) backend/knowe_harness/completion.py:2382— backend/knowe_harness/completion.py:2382-2387 | backend/knowe_storage/task_run_repository.py:141-145 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) backend/knowe_harness/completion.py:2660— backend/knowe_harness/completion.py:2660-2671 | backend/knowe_storage/task_run_repository.py:148-152 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2) backend/runtime.py:1171— backend/runtime.py:1171-1184 | backend/runtime.py:1202-1215 — both copies are in the same file, so extract the block into 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) backend/tools_knowe.py:521— backend/tools_knowe.py:521-534 | backend/tools_knowe.py:2673-2687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:521` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) backend/tools_knowe.py:519— backend/tools_knowe.py:519-532 | backend/tools_knowe.py:1776-1794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/tools_knowe.py:1795` calls `sorted`, `set`, `msg` and `backend/tools_knowe.py:533` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) REDACTED:1942— REDACTED:1942-1950 | REDACTED:2309-2317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1942` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) backend/tools_knowe.py:417— backend/tools_knowe.py:417-425 | backend/tools_knowe.py:487-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) backend/hub.py:415— backend/hub.py:415-423 | backend/hub.py:525-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/hub.py:424` calls `isinstance`, `setdefault`, `dict` and `backend/hub.py:535` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) REDACTED:3128— REDACTED:3128-3133 | backend/knowe_harness/projections.py:72-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) backend/knowe_adapters/model_adapter.py:198— backend/knowe_adapters/model_adapter.py:198-203 | backend/runtime.py:1369-1374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) REDACTED:4520— REDACTED:4520-4525 | REDACTED:4582-4587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:4526` calls `stage_delete_path` and `REDACTED:4588` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2 locations) src/components/KnowledgeView.tsx:1180— src/components/KnowledgeView.tsx:1180 · src/components/KnowledgeView.tsx:1199 — 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 (18 lines × 2 locations) src/contract/envelope.ts:1026— src/contract/envelope.ts:1026 · src/contract/envelope.ts:1281 — 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 (18 lines × 2 locations) src/store/state.ts:1233— src/store/state.ts:1233 · src/store/state.ts:1277 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (17 lines × 2 locations) electron/main.ts:431— electron/main.ts:431 · electron/trayCard.ts:32 — 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 (17 lines × 2 locations) scripts/make-avatars.mjs:46— scripts/make-avatars.mjs:46 · scripts/make-logo-v4.mjs:31 — 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 (17 lines × 2 locations) src/components/ContextMenu.tsx:1174— src/components/ContextMenu.tsx:1174 · src/components/ContextMenu.tsx:1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2 locations) src/components/ApprovalCard.tsx:486— src/components/ApprovalCard.tsx:486 · src/components/ApprovalCard.tsx:502 — 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 (15 lines × 2 locations) src/components/FileCard.tsx:36— src/components/FileCard.tsx:36 · src/components/FileCard.tsx:61 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2 locations) src/components/TokenUsagePanel.tsx:735— src/components/TokenUsagePanel.tsx:735 · src/components/TokenUsagePanel.tsx:756 — both copies are in the same file, so extract the block into 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 locations) electron/previewNavigation.ts:140— electron/previewNavigation.ts:140 · src/preview/renderers/MarkdownPreview.tsx:82 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (12 lines × 2 locations) src/components/ChatStream.tsx:538— src/components/ChatStream.tsx:538 · src/components/ChatStream.tsx:577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2 locations) src/components/ModelBindingModule.tsx:269— src/components/ModelBindingModule.tsx:269 · src/components/ModelBindingModule.tsx:364 — 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.
Low contrast colour pair in CSS (4.4:1) src/components/settings-view.css:327— `.conn-dot.fail` sets color: #a9564e on background-color: #f6ecea — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (4.4:1) src/components/settings-view.css:349— `.table-card .icon-btn.del:hover` sets color: #a9564e on background-color: #f6ecea — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
ClassTooLong: ChatStream src/components/ChatStream.tsx:1— ClassTooLong — 982 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 582 over it, 2.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: KnowledgeView src/components/KnowledgeView.tsx:1— ClassTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 320 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×2
Edited copy of a member (19 corresponding lines) backend/knowledge_api.py:124— backend/knowledge_api.py:124-142 | backend/knowledge_api.py:146-171 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) backend/knowe_harness/completion.py:2541— backend/knowe_harness/completion.py:2541-2573 | backend/knowe_harness/completion.py:2623-2641 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×2
Edited copy of a member (8 corresponding lines) REDACTED:3126— REDACTED:3126-3133 | backend/knowe_harness/projections.py:70-77 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) backend/config.py:79— backend/config.py:79-86 | backend/config.py:90-97 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) REDACTED:882— REDACTED:882-886 | backend/memory_manager.py:1223-1226 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) REDACTED:2145— REDACTED:2145-2148 | backend/memory_manager.py:1135-1138 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×2
Edited copy of a member (2 corresponding lines) REDACTED:876— REDACTED:876-878 | backend/knowledge_graph.py:2175-2176 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) backend/agents/zinnia.py:855— backend/agents/zinnia.py:855-856 | backend/runtime.py:852-853 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) backend/migrations.py:96— backend/migrations.py:96-108 | backend/persist.py:270-282 — 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 (13 lines × 2) REDACTED:2752— REDACTED:2752-2764 | REDACTED:2893-2905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) REDACTED:5986— REDACTED:5986-5998 | REDACTED:6225-6236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5986` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:6224` calls `stat` and `REDACTED:5986` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) backend/tools_knowe.py:407— backend/tools_knowe.py:407-418 | backend/tools_knowe.py:1718-1730 — both copies are in the same file, so extract the block into 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) REDACTED:1885— REDACTED:1885-1896 | REDACTED:1969-1980 — both copies are in the same file, so extract the block into 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) REDACTED:874— REDACTED:874-885 | REDACTED:1345-1356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) backend/knowe_harness/completion.py:2584— backend/knowe_harness/completion.py:2584-2591 | backend/knowe_harness/completion.py:2625-2632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) REDACTED:1643— REDACTED:1643-1650 | REDACTED:1698-1705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Low cohesion: KnowledgeGraphManager (LCOM4 5) backend/knowledge_graph.py:137— KnowledgeGraphManager's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MemoryManager (LCOM4 4) backend/memory_manager.py:98— MemoryManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Sync-over-async blocking REDACTED:25— `execSync` in `afterPack` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:39— `execSync` in `afterPack` 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.
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative src/preview/renderers/PdfPreview.tsx:237— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
Focus outline removed inline src/components/ContextMenu.tsx:1287— <textarea> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
Low contrast colour pair in CSS (2.4:1) src/styles/knowe-components.css:2086— `html.dark .md pre code .ln` sets color: #565771 on background-color: #1e1e28 — 2.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.7:1) src/components/settings-view.css:270— `.set-update-install` sets color: #fff on background-color: #4f7cff — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
state.applyEvent (cyclomatic 232) src/store/state.ts:830— state.applyEvent has cyclomatic complexity 232 (threshold 15). Of this number, 219 points are the body's own statements and 13 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KnowledgeView.KnowledgeView (cyclomatic 174) src/components/KnowledgeView.tsx:169— KnowledgeView.KnowledgeView has cyclomatic complexity 174 (threshold 15). Of this number, 66 points are the body's own statements and 108 belong to 47 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.
Composer.Composer (cyclomatic 130) src/components/Composer.tsx:141— Composer.Composer has cyclomatic complexity 130 (threshold 15). Of this number, 29 points are the body's own statements and 101 belong to 34 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.
ProjectEngine.iter_worker_retrieval_context (cyclomatic 106) REDACTED:6071— ProjectEngine.iter_worker_retrieval_context has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KnoweServer._health_conn (cyclomatic 78) REDACTED:3920— KnoweServer._health_conn has cyclomatic complexity 78 (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.
ApprovalCard.ApprovalCard (cyclomatic 77) src/components/ApprovalCard.tsx:150— ApprovalCard.ApprovalCard has cyclomatic complexity 77 (threshold 15). Of this number, 50 points are the body's own statements and 27 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TokenUsagePanel.TokenUsagePanel (cyclomatic 75) src/components/TokenUsagePanel.tsx:559— TokenUsagePanel.TokenUsagePanel has cyclomatic complexity 75 (threshold 15). Of this number, 32 points are the body's own statements and 43 belong to 16 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.
MessageBubble.MessageBubble (cyclomatic 70) src/components/MessageBubble.tsx:376— MessageBubble.MessageBubble has cyclomatic complexity 70 (threshold 15). Of this number, 57 points are the body's own statements and 13 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
main.registerIpc (cyclomatic 61) electron/main.ts:1433— main.registerIpc has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 1 of the 61 points is its own statement and the rest belongs to 18 function items inside it that branch (localFileAction, a function literal at line 1610, a function literal at line 1711, …). 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.
ModelBindingModule.ModelBindingModule (cyclomatic 58) src/components/ModelBindingModule.tsx:147— ModelBindingModule.ModelBindingModule has cyclomatic complexity 58 (threshold 15). Of this number, 48 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codeSyntax.highlightGenericLine (cyclomatic 58) src/preview/renderers/codeSyntax.ts:202— codeSyntax.highlightGenericLine has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ZinniaAgent._execute (cyclomatic 56) backend/agents/zinnia.py:975— ZinniaAgent._execute has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KnoweServer._delete_project_permanently (cyclomatic 55) REDACTED:4943— KnoweServer._delete_project_permanently has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
token_usage.normalize_token_usage_record (cyclomatic 54) REDACTED:202— token_usage.normalize_token_usage_record has cyclomatic complexity 54 (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.
App.App (cyclomatic 54) src/app/App.tsx:155— App.App has cyclomatic complexity 54 (threshold 15). Of this number, 20 points are the body's own statements and 34 belong to 13 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.
KnowledgePreview.KnowledgePreview (cyclomatic 53) src/components/KnowledgePreview.tsx:55— KnowledgePreview.KnowledgePreview has cyclomatic complexity 53 (threshold 15). Of this number, 37 points are the body's own statements and 16 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
token_usage.aggregate_token_usage (cyclomatic 51) REDACTED:354— token_usage.aggregate_token_usage 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.
HandoffBook.write_report (cyclomatic 50) backend/handoff.py:352— HandoffBook.write_report has cyclomatic complexity 50 (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.
ContextMenu.ForwardModalBody (cyclomatic 50) src/components/ContextMenu.tsx:847— ContextMenu.ForwardModalBody has cyclomatic complexity 50 (threshold 15). Of this number, 18 points are the body's own statements and 32 belong to 18 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.
ChatStream.ChatStream (cyclomatic 49) src/components/ChatStream.tsx:212— ChatStream.ChatStream has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ChatStream.ChatStream::msgMenu) 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.
tools_knowe._parse_agents (cyclomatic 48) backend/tools_knowe.py:985— tools_knowe._parse_agents has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectEngine._stop_once (cyclomatic 47) REDACTED:2119— ProjectEngine._stop_once has cyclomatic complexity 47 (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.
ProjectEngine._completion_view_from_event (cyclomatic 47) REDACTED:2562— ProjectEngine._completion_view_from_event 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.
_Markdownifier.handle_starttag (cyclomatic 47) REDACTED:366— _Markdownifier.handle_starttag 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.
MemoryManager.update_project_context (cyclomatic 46) backend/memory_manager.py:425— MemoryManager.update_project_context 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.
TokenUsagePanel.TrendChart (cyclomatic 46) src/components/TokenUsagePanel.tsx:214— TokenUsagePanel.TrendChart has cyclomatic complexity 46 (threshold 15). Of this number, 19 points are the body's own statements and 27 belong to 13 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FavoritesView.FavoritesView (cyclomatic 46) src/components/FavoritesView.tsx:135— FavoritesView.FavoritesView has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 5 of the 46 points are its own statements and the rest belongs to 15 function items inside it that branch (catLabel, typeLabel, a function literal at line 153, …). 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.
KnowledgeGraphManager._refresh_graph (cyclomatic 45) backend/knowledge_graph.py:1187— KnowledgeGraphManager._refresh_graph has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectEngine._memory_clues_block (cyclomatic 44) REDACTED:5328— ProjectEngine._memory_clues_block 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.
tool_protocol.decode_text_tool_protocol (cyclomatic 44) REDACTED:569— tool_protocol.decode_text_tool_protocol 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.
RangeCalendar.RangeCalendar (cyclomatic 44) src/components/RangeCalendar.tsx:48— RangeCalendar.RangeCalendar has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 11 of the 44 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 196, a function literal at line 66, a function literal at line 81, …). 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.
ProjectEngine.emit (cyclomatic 42) REDACTED:8034— ProjectEngine.emit 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.
knowledge.useKnowledgeStore (cyclomatic 42) src/store/knowledge.ts:366— knowledge.useKnowledgeStore has cyclomatic complexity 42 (threshold 15). Of this number, 29 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
FirstRunModelGate.FirstRunModelGate (cyclomatic 41) src/components/FirstRunModelGate.tsx:38— FirstRunModelGate.FirstRunModelGate has cyclomatic complexity 41 (threshold 15). Of this number, 28 points are the body's own statements and 13 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectEngine._completion_message_text (cyclomatic 40) REDACTED:2506— ProjectEngine._completion_message_text 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.
ConvList.ConvListItem (cyclomatic 40) src/components/ConvList.tsx:366— ConvList.ConvListItem has cyclomatic complexity 40 (threshold 15). Of this number, 30 points are the body's own statements and 10 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.
PreviewApp.PreviewApp (cyclomatic 40) src/preview/PreviewApp.tsx:172— PreviewApp.PreviewApp has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 6 of the 40 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 297, 398, 191, …). 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.
ProjectEngine._persist_token_usage (cyclomatic 39) REDACTED:1767— ProjectEngine._persist_token_usage 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.
AgentLoop.run (cyclomatic 39) backend/knowe_core/agent_loop.py:108— AgentLoop.run 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.
runtime_settings.apply (cyclomatic 39) backend/runtime_settings.py:551— runtime_settings.apply 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.
file_ops.search_files (cyclomatic 37) backend/file_ops.py:136— file_ops.search_files 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.
knowledge_api._dispatch_get_sync (cyclomatic 37) backend/knowledge_api.py:230— knowledge_api._dispatch_get_sync 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.
KnoweServer._delete_agent_permanently (cyclomatic 37) REDACTED:5359— KnoweServer._delete_agent_permanently 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.
KnoweServer._serve_history (cyclomatic 37) REDACTED:6272— KnoweServer._serve_history 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.
RosterPanel.RosterPanel (cyclomatic 37) src/components/RosterPanel.tsx:49— RosterPanel.RosterPanel has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 4 of the 37 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 164, a function literal at line 131, a function literal at line 91, …). 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.
ContactsView.ContactsView (cyclomatic 37) src/components/ContactsView.tsx:397— ContactsView.ContactsView has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 565, 448, 480, …). 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.
ProjectEngine._emit_legacy_completion_visible (cyclomatic 36) REDACTED:2763— ProjectEngine._emit_legacy_completion_visible has cyclomatic complexity 36 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProviderClient._parse_sse_line (cyclomatic 36) backend/knowe_core/provider_client.py:863— ProviderClient._parse_sse_line has cyclomatic complexity 36 (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.
KnowledgeView.KnowledgeModals (cyclomatic 35) src/components/KnowledgeView.tsx:1044— KnowledgeView.KnowledgeModals has cyclomatic complexity 35 (threshold 15). Of this number, 16 points are the body's own statements and 19 belong to 12 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.
PdfPreview.PdfPreview (cyclomatic 35) src/preview/renderers/PdfPreview.tsx:36— PdfPreview.PdfPreview has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 11 of the 35 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 124, 114, 167, …). 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.
ProjectEngine._agent_memory_clues_block (cyclomatic 34) REDACTED:7436— ProjectEngine._agent_memory_clues_block has cyclomatic complexity 34 (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.
MemoryManager._ensure_history_initialized (cyclomatic 34) backend/memory_manager.py:865— MemoryManager._ensure_history_initialized 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.
file_ops.patch_file (cyclomatic 33) backend/file_ops.py:443— file_ops.patch_file 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.
knowledge_api._dispatch_post (cyclomatic 33) backend/knowledge_api.py:314— knowledge_api._dispatch_post 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.
KnowledgeGraphManager._merge_extraction (cyclomatic 33) backend/knowledge_graph.py:816— KnowledgeGraphManager._merge_extraction 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.
KnoweServer._cmd_token_usage_req (cyclomatic 33) REDACTED:2533— KnoweServer._cmd_token_usage_req has cyclomatic complexity 33 (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.
GlobalSearch.useGlobalSearchGroups (cyclomatic 33) src/components/GlobalSearch.tsx:117— GlobalSearch.useGlobalSearchGroups 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 4 function literals inside it that branch (lines 133, 191, 135, …). 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.
ProjectEngine.commit_handoff_step (cyclomatic 32) REDACTED:9058— ProjectEngine.commit_handoff_step 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.
KnowledgeAssetManager._sync_project_experience_skills (cyclomatic 32) REDACTED:1292— KnowledgeAssetManager._sync_project_experience_skills 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.
ContextMenu.FloatingLayers (cyclomatic 32) src/components/ContextMenu.tsx:1726— ContextMenu.FloatingLayers has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 5 of the 32 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 1769, 1737, 1799, …). 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.
codeSyntax.highlightMarkupLine (cyclomatic 32) src/preview/renderers/codeSyntax.ts:150— codeSyntax.highlightMarkupLine 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.
KnowledgeGraphManager.search (cyclomatic 31) backend/knowledge_graph.py:387— KnowledgeGraphManager.search 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.
WorkerRuntime.run (cyclomatic 31) backend/runtime.py:976— WorkerRuntime.run 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.
ReasoningPanel.ReasoningPanel (cyclomatic 31) src/components/ReasoningPanel.tsx:104— ReasoningPanel.ReasoningPanel has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 167, 186, 119, …). 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.
ProjectEngine._run_dm_turn (cyclomatic 30) REDACTED:3912— ProjectEngine._run_dm_turn has cyclomatic complexity 30 (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.
SettingsView.ModelsPane (cyclomatic 30) src/components/SettingsView.tsx:296— SettingsView.ModelsPane has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 9 function items inside it that branch (handleSave, a function literal at line 480, renderConnStatus, …). 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.
PreviewTabs.PreviewTabs (cyclomatic 30) src/preview/PreviewTabs.tsx:17— PreviewTabs.PreviewTabs has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 64, a function literal at line 45, a function literal at line 119, …). 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.
PptxPreview.parseTextShape (cyclomatic 30) src/preview/renderers/PptxPreview.tsx:265— PptxPreview.parseTextShape has cyclomatic complexity 30 (threshold 15). Of this number, 28 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.
PreviewApp.previewTabsReducer (cyclomatic 30) src/preview/PreviewApp.tsx:61— PreviewApp.previewTabsReducer 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.
ProjectEngine._run_agent_turn (cyclomatic 29) REDACTED:4856— ProjectEngine._run_agent_turn 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.
ProjectEngine.delete_agent_permanently (cyclomatic 29) REDACTED:7180— ProjectEngine.delete_agent_permanently 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.
lineage.resolve_task_lineage (cyclomatic 29) backend/knowe_provenance/lineage.py:333— lineage.resolve_task_lineage 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.
knowledge_graph._render_node (cyclomatic 29) backend/knowledge_graph.py:1686— knowledge_graph._render_node 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.
KnoweServer.load_from_disk (cyclomatic 29) REDACTED:1544— KnoweServer.load_from_disk 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.humanizeCompletionStatus (cyclomatic 29) src/store/state.ts:2197— state.humanizeCompletionStatus has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 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.
ConvList.ConvList (cyclomatic 29) src/components/ConvList.tsx:40— ConvList.ConvList has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectEngine._loop (cyclomatic 28) REDACTED:4431— ProjectEngine._loop 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.
CompletionEvent.from_dict (cyclomatic 28) backend/knowe_harness/completion.py:344— CompletionEvent.from_dict 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.
favorites.useFavoritesStore (cyclomatic 28) src/store/favorites.ts:189— favorites.useFavoritesStore has cyclomatic complexity 28 (threshold 15). Of this number, 24 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.
ProjectEngine._write_agent_memory (cyclomatic 27) REDACTED:7331— ProjectEngine._write_agent_memory has cyclomatic complexity 27 (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.
TaskResultV1.from_dict (cyclomatic 27) backend/knowe_harness/completion.py:510— TaskResultV1.from_dict 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.
SQLiteCompletionStore._event_for_run (cyclomatic 27) backend/knowe_harness/completion.py:2074— SQLiteCompletionStore._event_for_run 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.
KnowledgeAssetManager.refresh_assets (cyclomatic 27) REDACTED:567— KnowledgeAssetManager.refresh_assets 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.
MemoryManager.search_project_history (cyclomatic 27) backend/memory_manager.py:693— MemoryManager.search_project_history 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.
AnthropicStreamDecoder.feed (cyclomatic 26) backend/knowe_core/anthropic_codec.py:264— AnthropicStreamDecoder.feed 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.
Store.delete_project (cyclomatic 26) backend/persist.py:326— Store.delete_project has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ContextMenu.decorateConversationList (cyclomatic 26) src/components/ContextMenu.tsx:1614— ContextMenu.decorateConversationList has cyclomatic complexity 26 (threshold 15). Of this number, 22 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.
ContactsView.AgentProfile (cyclomatic 26) src/components/ContactsView.tsx:744— ContactsView.AgentProfile has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ZoomPan.ZoomPanViewport (cyclomatic 26) src/components/ZoomPan.tsx:81— ZoomPan.ZoomPanViewport has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
attachments.extract_file_text (cyclomatic 25) backend/attachments.py:399— attachments.extract_file_text 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.
ProjectEngine._run_worker_attempt (cyclomatic 25) REDACTED:3582— ProjectEngine._run_worker_attempt 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.
ProjectEngine._create_task_envelope (cyclomatic 25) REDACTED:8402— ProjectEngine._create_task_envelope 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.
engine.select_provider_fallback (cyclomatic 25) REDACTED:175— engine.select_provider_fallback 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.
ProviderModelAdapter._stream_step (cyclomatic 25) backend/knowe_adapters/model_adapter.py:142— ProviderModelAdapter._stream_step 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.
contracts.normalize_relative_path (cyclomatic 25) backend/knowe_harness/contracts.py:54— contracts.normalize_relative_path 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.
KnoweServer._cmd_update_agent_profile (cyclomatic 25) REDACTED:3664— KnoweServer._cmd_update_agent_profile has cyclomatic complexity 25 (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.
socket.createSocket.handleServerControlEvent (cyclomatic 25) src/transport/socket.ts:593— socket.createSocket.handleServerControlEvent 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.
projectAlias.reconcileProjectAlias (cyclomatic 25) src/store/projectAlias.ts:49— projectAlias.reconcileProjectAlias 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.
knowledge.toCard (cyclomatic 25) src/store/knowledge.ts:169— knowledge.toCard 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KnowledgeGraphManager._apply_approval_signal (cyclomatic 24) backend/knowledge_graph.py:1106— KnowledgeGraphManager._apply_approval_signal 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.
privacy.sanitize_event (cyclomatic 24) backend/privacy.py:91— privacy.sanitize_event 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.
KnoweServer._rename_project (cyclomatic 24) REDACTED:1184— KnoweServer._rename_project 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.
DateCalendar.DateCalendar (cyclomatic 24) src/components/DateCalendar.tsx:76— DateCalendar.DateCalendar has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 159, dayDisabled, goPrev, …). 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.
RecordsDrawer.RecordsDrawer::renderBody (cyclomatic 24) src/components/RecordsDrawer.tsx:421— RecordsDrawer.RecordsDrawer::renderBody 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 (RecordsDrawer.RecordsDrawer) 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.
MarkdownPreview.MarkdownPreview (cyclomatic 24) src/preview/renderers/MarkdownPreview.tsx:126— MarkdownPreview.MarkdownPreview has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 225, a function literal at line 145, a function literal at line 171, …). 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.
PptxPreview.parseSlide (cyclomatic 24) src/preview/renderers/PptxPreview.tsx:371— PptxPreview.parseSlide 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.
anthropic_codec.encode_request (cyclomatic 23) backend/knowe_core/anthropic_codec.py:112— anthropic_codec.encode_request 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.
_Markdownifier.handle_endtag (cyclomatic 23) REDACTED:465— _Markdownifier.handle_endtag 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.
KnoweAgent.run_conversation (cyclomatic 22) backend/agents/knowe_agent.py:214— KnoweAgent.run_conversation 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.
contract._check_card (cyclomatic 22) backend/contract.py:482— contract._check_card 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.
engine._agent_memory_duplicate_of_project (cyclomatic 22) REDACTED:1235— engine._agent_memory_duplicate_of_project 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.
engine._agent_messages (cyclomatic 22) REDACTED:9408— engine._agent_messages 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.
provider_client.normalize_usage_buckets (cyclomatic 22) backend/knowe_core/provider_client.py:57— provider_client.normalize_usage_buckets 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.
KnowledgeAssetManager._render_asset_md (cyclomatic 22) REDACTED:1222— KnowledgeAssetManager._render_asset_md 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.
knowledge_assets._validate_distilled (cyclomatic 22) REDACTED:1882— knowledge_assets._validate_distilled 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.
KnoweServer._do_replay (cyclomatic 22) REDACTED:2399— KnoweServer._do_replay 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.
tools_knowe._external_path (cyclomatic 22) backend/tools_knowe.py:2364— tools_knowe._external_path has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
state.registerMember (cyclomatic 22) src/store/state.ts:525— state.registerMember 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.
state.applyCompletionStatus (cyclomatic 22) src/store/state.ts:2242— state.applyCompletionStatus has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileCard.FileCard (cyclomatic 22) src/components/FileCard.tsx:14— FileCard.FileCard has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 45, a function literal at line 70, a function literal at line 41, …). 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.
ProjectEngine._persist_worker_token_usage (cyclomatic 21) REDACTED:1913— ProjectEngine._persist_worker_token_usage 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.
engine._memory_friendly_time (cyclomatic 21) REDACTED:889— engine._memory_friendly_time 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.
HandoffBook.write_approval (cyclomatic 21) backend/handoff.py:520— HandoffBook.write_approval 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.
tool_protocol._coerce_scalar (cyclomatic 21) REDACTED:202— tool_protocol._coerce_scalar 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.
KnowledgeGraphManager.apply_user_override (cyclomatic 21) backend/knowledge_graph.py:567— KnowledgeGraphManager.apply_user_override 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.
KnowledgeGraphManager._detach_source (cyclomatic 21) backend/knowledge_graph.py:1161— KnowledgeGraphManager._detach_source 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.
knowledge_graph._fallback_extraction (cyclomatic 21) backend/knowledge_graph.py:1558— knowledge_graph._fallback_extraction 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.
TaskEnvelope.from_dict (cyclomatic 21) backend/runtime.py:345— TaskEnvelope.from_dict 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.
KnoweServer._resolve_preview_target (cyclomatic 21) REDACTED:5838— KnoweServer._resolve_preview_target 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.
KnoweServer.run (cyclomatic 21) REDACTED:6541— KnoweServer.run 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.
workspace_layout.ensure_internal_workspace (cyclomatic 21) backend/workspace_layout.py:156— workspace_layout.ensure_internal_workspace 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.
main.spawnBackend (cyclomatic 21) electron/main.ts:723— main.spawnBackend has cyclomatic complexity 21 (threshold 15). Of this number, 15 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.
toolActivity.appendToolActivity (cyclomatic 21) src/store/toolActivity.ts:126— toolActivity.appendToolActivity 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.
ProviderClient.chat_stream (cyclomatic 20) backend/knowe_core/provider_client.py:375— ProviderClient.chat_stream 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.
TaskResultV1.from_completion (cyclomatic 20) backend/knowe_harness/completion.py:423— TaskResultV1.from_completion 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.
CompletionProjector._report (cyclomatic 20) backend/knowe_harness/projections.py:394— CompletionProjector._report 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.
WorkerRuntime._execute_tool (cyclomatic 20) backend/runtime.py:1259— WorkerRuntime._execute_tool has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorkerRuntime._collect_facts (cyclomatic 20) backend/runtime.py:1326— WorkerRuntime._collect_facts has cyclomatic complexity 20 (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.
KnoweServer._cmd_user_message (cyclomatic 20) REDACTED:2719— KnoweServer._cmd_user_message has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorkerRuntimeFactory.prepare_context (cyclomatic 20) backend/worker_gateway_runtime.py:144— WorkerRuntimeFactory.prepare_context 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.
socket.createSocket.routeEvent (cyclomatic 20) src/transport/socket.ts:475— socket.createSocket.routeEvent has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
state.applyCompletionViewV1 (cyclomatic 20) src/store/state.ts:2338— state.applyCompletionViewV1 has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsView.SettingsView (cyclomatic 20) src/components/SettingsView.tsx:733— SettingsView.SettingsView has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (restartBackend, a function literal at line 754, a function literal at line 759, …). 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.
fileKinds.kindOf (cyclomatic 20) src/preview/fileKinds.ts:66— fileKinds.kindOf has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DirectoryRecoveryCard.FullCard (cyclomatic 20) src/components/DirectoryRecoveryCard.tsx:116— DirectoryRecoveryCard.FullCard has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 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.
PptxPreview.PptxPreview (cyclomatic 20) src/preview/renderers/PptxPreview.tsx:549— PptxPreview.PptxPreview has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 567, 575, 583, …). 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.
ProjectEngine._normalize_outbound_files (cyclomatic 19) REDACTED:2448— ProjectEngine._normalize_outbound_files 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.
ProjectEngine._record_activity_from_event (cyclomatic 19) REDACTED:5882— ProjectEngine._record_activity_from_event 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.
ProjectEngine.project_summary (cyclomatic 19) REDACTED:6758— ProjectEngine.project_summary 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.
provider_identity.humanize_provider_error (cyclomatic 19) backend/knowe_core/provider_identity.py:210— provider_identity.humanize_provider_error 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.
SQLiteCompletionStore._insert_event (cyclomatic 19) backend/knowe_harness/completion.py:1492— SQLiteCompletionStore._insert_event 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.
lineage._memory_records (cyclomatic 19) backend/knowe_provenance/lineage.py:223— lineage._memory_records 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.
lineage._knowledge_records (cyclomatic 19) backend/knowe_provenance/lineage.py:263— lineage._knowledge_records 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.
KnowledgeAssetManager._public_asset (cyclomatic 19) REDACTED:1824— KnowledgeAssetManager._public_asset 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.
KnowledgeGraphManager.ingest_handoff (cyclomatic 19) backend/knowledge_graph.py:229— KnowledgeGraphManager.ingest_handoff 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.
SeenSpeechLedger._ensure_loaded (cyclomatic 19) backend/seen_speech.py:67— SeenSpeechLedger._ensure_loaded 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.
knowledge.toSkillPack (cyclomatic 19) src/store/knowledge.ts:219— knowledge.toSkillPack 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.
GlobalSearch.CommandPalette (cyclomatic 19) src/components/GlobalSearch.tsx:364— GlobalSearch.CommandPalette has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (onInputKeyDown, a function literal at line 383, a function literal at line 407, …). 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.
ZinniaAgent._resolve_binding (cyclomatic 18) backend/agents/zinnia.py:550— ZinniaAgent._resolve_binding 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.
ProjectEngine._run_feedback_flight (cyclomatic 18) REDACTED:4341— ProjectEngine._run_feedback_flight 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.
StreamAssembler._handle_tool_call (cyclomatic 18) backend/knowe_core/stream_assembler.py:282— StreamAssembler._handle_tool_call 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.
model.recorded_provenance (cyclomatic 18) backend/knowe_provenance/model.py:99— model.recorded_provenance 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.
knowledge_api._merged_skillpacks (cyclomatic 18) backend/knowledge_api.py:174— knowledge_api._merged_skillpacks has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
KnowledgeAssetManager._pass_conflicts (cyclomatic 18) REDACTED:739— KnowledgeAssetManager._pass_conflicts has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
KnowledgeAssetManager.apply_user_override (cyclomatic 18) REDACTED:826— KnowledgeAssetManager.apply_user_override 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.
Store.purge_agent_events (cyclomatic 18) backend/persist.py:771— Store.purge_agent_events 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.
TaskRun.from_dict (cyclomatic 18) backend/runtime.py:564— TaskRun.from_dict 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.
KnoweServer._cmd_create_project (cyclomatic 18) REDACTED:3529— KnoweServer._cmd_create_project 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.
DirectoryPicker.DirectoryPicker (cyclomatic 18) src/components/DirectoryPicker.tsx:55— DirectoryPicker.DirectoryPicker has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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.
delete_ops.find_locking_processes (cyclomatic 17) backend/delete_ops.py:188— delete_ops.find_locking_processes 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.
ProjectEngine._emit_completion_visible (cyclomatic 17) REDACTED:2699— ProjectEngine._emit_completion_visible 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.
ProjectEngine._correlate_visible_event (cyclomatic 17) REDACTED:2931— ProjectEngine._correlate_visible_event 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.
ProjectEngine.write_handoff_report (cyclomatic 17) REDACTED:4060— ProjectEngine.write_handoff_report 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.
ProjectEngine._recent_activity_block (cyclomatic 17) REDACTED:5478— ProjectEngine._recent_activity_block 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.
engine._select_diverse_memory_clues (cyclomatic 17) REDACTED:990— engine._select_diverse_memory_clues 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.
engine._parse_agent_worklog (cyclomatic 17) REDACTED:1120— engine._parse_agent_worklog 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.
ProviderModelAdapter._explicit_outcome (cyclomatic 17) backend/knowe_adapters/model_adapter.py:293— ProviderModelAdapter._explicit_outcome 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.
WaitToken.from_dict (cyclomatic 17) backend/knowe_harness/completion.py:691— WaitToken.from_dict 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.
SQLiteCompletionStore._scan_workspace_deltas (cyclomatic 17) backend/knowe_harness/completion.py:1965— SQLiteCompletionStore._scan_workspace_deltas 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.
KnowledgeAssetManager._third_party_skill_documents (cyclomatic 17) REDACTED:1465— KnowledgeAssetManager._third_party_skill_documents 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.
memory_manager._parse_retrieval_keywords (cyclomatic 17) backend/memory_manager.py:1285— memory_manager._parse_retrieval_keywords 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.
KnoweServer._canonical_project_id_from_request (cyclomatic 17) REDACTED:3310— KnoweServer._canonical_project_id_from_request 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.
selectors.orderRosterMembers.sorted (cyclomatic 17) src/store/selectors.ts:187— selectors.orderRosterMembers.sorted has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
records.useRecordsStore (cyclomatic 17) src/store/records.ts:182— records.useRecordsStore 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.
filePreview.resolveProjectRelativeTarget (cyclomatic 17) src/store/filePreview.ts:107— filePreview.resolveProjectRelativeTarget 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.
tiptapMarkdown.markdownToTiptapDoc (cyclomatic 17) src/shared/tiptapMarkdown.ts:140— tiptapMarkdown.markdownToTiptapDoc has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecordsDrawer.RecordsDrawer (cyclomatic 17) src/components/RecordsDrawer.tsx:127— RecordsDrawer.RecordsDrawer has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (RecordsDrawer.RecordsDrawer::renderBody) 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.
SheetPreview.SheetTable (cyclomatic 17) src/preview/renderers/SheetPreview.tsx:56— SheetPreview.SheetTable has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 67, a function literal at line 100, a function literal at line 64, …). 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.
ZinniaAgent._run (cyclomatic 16) backend/agents/zinnia.py:749— ZinniaAgent._run 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.
content_compress.compact_json (cyclomatic 16) backend/content_compress.py:233— content_compress.compact_json 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.
context_compressor._projection_index (cyclomatic 16) backend/context_compressor.py:264— context_compressor._projection_index 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.
file_ops._apply_line_range (cyclomatic 16) backend/file_ops.py:599— file_ops._apply_line_range 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.
ProviderModelAdapter.from_legacy (cyclomatic 16) backend/knowe_adapters/model_adapter.py:61— ProviderModelAdapter.from_legacy 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.
StreamAssembler.finalize_turn (cyclomatic 16) backend/knowe_core/stream_assembler.py:163— StreamAssembler.finalize_turn 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.
KnowledgeAssetManager.record_usage (cyclomatic 16) REDACTED:482— KnowledgeAssetManager.record_usage 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.
knowledge_assets._normalize_md_body (cyclomatic 16) REDACTED:1925— knowledge_assets._normalize_md_body 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.
KnowledgeGraphManager._public_node (cyclomatic 16) backend/knowledge_graph.py:1440— KnowledgeGraphManager._public_node 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.
knowledge_graph._render_graph_index (cyclomatic 16) backend/knowledge_graph.py:1648— knowledge_graph._render_graph_index 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.
memory_manager._normalize_state (cyclomatic 16) backend/memory_manager.py:1361— memory_manager._normalize_state 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.
mentions.resolve_mentions (cyclomatic 16) backend/mentions.py:123— mentions.resolve_mentions 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.
KnoweServer._delete_path_candidate (cyclomatic 16) REDACTED:4417— KnoweServer._delete_path_candidate 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.
settings.testBinding (cyclomatic 16) src/store/settings.ts:1025— settings.testBinding 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.
BackendGate.BackendGate (cyclomatic 16) src/components/BackendGate.tsx:23— BackendGate.BackendGate has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
FileCard.AttachmentCard (cyclomatic 16) src/components/FileCard.tsx:192— FileCard.AttachmentCard 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 5 function items inside it that branch (open, a function literal at line 209, reveal, …). 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.
tokenUsage.rangeToBounds (cyclomatic 16) src/store/tokenUsage.ts:304— tokenUsage.rangeToBounds 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.
ChatStream.findRelayPair (cyclomatic 16) src/components/ChatStream.tsx:98— ChatStream.findRelayPair 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.
ChatStream.ChatStream::msgMenu (cyclomatic 16) src/components/ChatStream.tsx:904— ChatStream.ChatStream::msgMenu 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 (ChatStream.ChatStream) 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.
No assertions: 服务器级事件(无 seq 白名单)都过 Zod src/contract/parity.test.ts:115— 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.
TodoComment src/store/favorites.ts:17— // TODO: favorites 持久化 API(后端就绪后 add/remove/setTags/rename 改发命令,启动拉全量) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
state.applyEvent (cognitive 412) src/store/state.ts:830— state.applyEvent has cognitive complexity 412 (threshold 15). Drivers by points: if/else 85 (229 pts), ternaries 26 (75 pts), boolean chains 71, loops 12 (33 pts), error handling 1 (3 pts), match/switch 1 (nesting depth added 216). Of this number, 390 points are the body's own statements and 22 belong to 11 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.
ChatStream.ChatStream (cognitive 339) src/components/ChatStream.tsx:212— ChatStream.ChatStream has cognitive complexity 339 (threshold 15). Drivers by points: if/else 120 (163 pts), boolean chains 99, ternaries 45 (71 pts), loops 5, error handling 1 (nesting depth added 69). Of this number, 50 points are the body's own statements and 289 belong to 66 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.
KnowledgeView.KnowledgeView (cognitive 259) src/components/KnowledgeView.tsx:169— KnowledgeView.KnowledgeView has cognitive complexity 259 (threshold 15). Drivers by points: ternaries 44 (153 pts), if/else 47 (60 pts), boolean chains 46 (nesting depth added 122). Of this number, 85 points are the body's own statements and 174 belong to 47 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.
ProjectEngine.iter_worker_retrieval_context (cognitive 216) REDACTED:6071— ProjectEngine.iter_worker_retrieval_context has cognitive complexity 216 (threshold 15). Drivers by points: if/else 48 (127 pts), loops 18 (39 pts), error handling 14 (23 pts), boolean chains 22, ternaries 2 (5 pts) (nesting depth added 112). 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.
ZinniaAgent._execute (cognitive 112) backend/agents/zinnia.py:975— ZinniaAgent._execute has cognitive complexity 112 (threshold 15). Drivers by points: if/else 28 (60 pts), error handling 12 (28 pts), ternaries 6 (12 pts), boolean chains 9, loops 1 (3 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Composer.Composer (cognitive 109) src/components/Composer.tsx:141— Composer.Composer has cognitive complexity 109 (threshold 15). Drivers by points: boolean chains 42, if/else 41 (42 pts), ternaries 18 (22 pts), error handling 2 (3 pts) (nesting depth added 6). Of this number, 22 points are the body's own statements and 87 belong to 34 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
file_ops.search_files (cognitive 106) backend/file_ops.py:136— file_ops.search_files has cognitive complexity 106 (threshold 15). Drivers by points: if/else 21 (78 pts), loops 4 (11 pts), error handling 4 (10 pts), boolean chains 7 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApprovalCard.ApprovalCard (cognitive 101) src/components/ApprovalCard.tsx:150— ApprovalCard.ApprovalCard has cognitive complexity 101 (threshold 15). Drivers by points: ternaries 23 (55 pts), boolean chains 23, if/else 17 (23 pts) (nesting depth added 38). Of this number, 69 points are the body's own statements and 32 belong to 12 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.
codeSyntax.highlightGenericLine (cognitive 100) src/preview/renderers/codeSyntax.ts:202— codeSyntax.highlightGenericLine has cognitive complexity 100 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 26, loops 8 (24 pts), ternaries 2 (5 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._delete_project_permanently (cognitive 92) REDACTED:4943— KnoweServer._delete_project_permanently has cognitive complexity 92 (threshold 15). Drivers by points: if/else 32 (59 pts), error handling 10 (18 pts), boolean chains 10, ternaries 4 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._health_conn (cognitive 91) REDACTED:3920— KnoweServer._health_conn has cognitive complexity 91 (threshold 15). Drivers by points: if/else 47 (58 pts), boolean chains 25, error handling 4 (5 pts), ternaries 2, loops 1 (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.
tools_knowe._parse_agents (cognitive 90) backend/tools_knowe.py:985— tools_knowe._parse_agents has cognitive complexity 90 (threshold 15). Drivers by points: if/else 28 (66 pts), boolean chains 12, loops 4 (6 pts), ternaries 3 (6 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.
token_usage.aggregate_token_usage (cognitive 79) REDACTED:354— token_usage.aggregate_token_usage has cognitive complexity 79 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 22, loops 6 (9 pts), ternaries 3 (7 pts), error handling 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenUsagePanel.TokenUsagePanel (cognitive 79) src/components/TokenUsagePanel.tsx:559— TokenUsagePanel.TokenUsagePanel has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 22 (38 pts), if/else 23 (24 pts), boolean chains 14, loops 2 (3 pts) (nesting depth added 18). Of this number, 27 points are the body's own statements and 52 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop.run (cognitive 77) backend/knowe_core/agent_loop.py:108— AgentLoop.run has cognitive complexity 77 (threshold 15). Drivers by points: if/else 14 (31 pts), error handling 8 (22 pts), loops 5 (10 pts), boolean chains 8, ternaries 3 (6 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
token_usage.normalize_token_usage_record (cognitive 76) REDACTED:202— token_usage.normalize_token_usage_record has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 23, error handling 9 (20 pts), ternaries 1 (2 pts), 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.
ProjectEngine._stop_once (cognitive 74) REDACTED:2119— ProjectEngine._stop_once has cognitive complexity 74 (threshold 15). Drivers by points: if/else 22 (31 pts), error handling 11 (22 pts), loops 8 (14 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.
KnoweServer._serve_history (cognitive 74) REDACTED:6272— KnoweServer._serve_history has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 4 (14 pts), error handling 6 (11 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 37). 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.
tool_protocol.decode_text_tool_protocol (cognitive 73) REDACTED:569— tool_protocol.decode_text_tool_protocol has cognitive complexity 73 (threshold 15). Drivers by points: if/else 22 (37 pts), ternaries 6 (20 pts), boolean chains 14, error handling 1 (2 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
KnowledgeGraphManager._refresh_graph (cognitive 69) backend/knowledge_graph.py:1187— KnowledgeGraphManager._refresh_graph has cognitive complexity 69 (threshold 15). Drivers by points: if/else 18 (45 pts), boolean chains 16, loops 5 (6 pts), ternaries 1 (2 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.
codeSyntax.highlightMarkupLine (cognitive 65) src/preview/renderers/codeSyntax.ts:150— codeSyntax.highlightMarkupLine has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 4 (10 pts), boolean chains 8, ternaries 2 (7 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.
MemoryManager.update_project_context (cognitive 63) backend/memory_manager.py:425— MemoryManager.update_project_context has cognitive complexity 63 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 21, ternaries 10 (13 pts), loops 1 (3 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.
main.registerIpc (cognitive 61) electron/main.ts:1433— main.registerIpc has cognitive complexity 61 (threshold 15). Drivers by points: if/else 30 (33 pts), boolean chains 16, ternaries 8, error handling 3, match/switch 1 (nesting depth added 3). None of this is in the body itself: all 61 points belong to 18 function items inside it that branch (localFileAction, a function literal at line 1610, a function literal at line 1645, …). 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.
MessageBubble.MessageBubble (cognitive 61) src/components/MessageBubble.tsx:376— MessageBubble.MessageBubble has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 16 (27 pts), boolean chains 25, if/else 9 (nesting depth added 11). Of this number, 48 points are the body's own statements and 13 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_Markdownifier.handle_starttag (cognitive 59) REDACTED:366— _Markdownifier.handle_starttag has cognitive complexity 59 (threshold 15). Drivers by points: if/else 26 (32 pts), ternaries 8 (16 pts), boolean chains 11 (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.
ProjectEngine._memory_clues_block (cognitive 56) REDACTED:5328— ProjectEngine._memory_clues_block has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 17, loops 4 (5 pts), ternaries 3 (4 pts), error handling 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.
KnoweServer._delete_agent_permanently (cognitive 56) REDACTED:5359— KnoweServer._delete_agent_permanently has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 9 (20 pts), boolean chains 7, ternaries 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.
ProjectEngine.emit (cognitive 55) REDACTED:8034— ProjectEngine.emit has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 17, ternaries 3 (5 pts), loops 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEngine._completion_view_from_event (cognitive 54) REDACTED:2562— ProjectEngine._completion_view_from_event has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 29, if/else 12 (20 pts), ternaries 3, loops 2 (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.
WorkerRuntime.run (cognitive 53) backend/runtime.py:976— WorkerRuntime.run has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 5, error handling 4, loops 2 (4 pts), ternaries 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.
runtime_settings.apply (cognitive 53) backend/runtime_settings.py:551— runtime_settings.apply has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 12, ternaries 6 (11 pts), error handling 1 (2 pts), loops 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.
RangeCalendar.RangeCalendar (cognitive 51) src/components/RangeCalendar.tsx:48— RangeCalendar.RangeCalendar has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 14 (18 pts), boolean chains 10, loops 3 (nesting depth added 6). Most of this is not in the body itself: 11 of the 51 points are its own statements and the rest belongs to 12 function items inside it that branch (pickDay, a function literal at line 196, a function literal at line 81, …). 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.
App.App (cognitive 51) src/app/App.tsx:155— App.App has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 18, ternaries 12 (18 pts), if/else 12 (14 pts), match/switch 1 (nesting depth added 8). Of this number, 22 points are the body's own statements and 29 belong to 13 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.
ProjectEngine._persist_token_usage (cognitive 50) REDACTED:1767— ProjectEngine._persist_token_usage has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 16, error handling 3 (5 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.
file_ops.patch_file (cognitive 50) backend/file_ops.py:443— file_ops.patch_file has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 6, ternaries 3 (6 pts), error handling 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.
knowledge_api._dispatch_post (cognitive 50) backend/knowledge_api.py:314— knowledge_api._dispatch_post has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 11 (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.
HandoffBook.write_report (cognitive 49) backend/handoff.py:352— HandoffBook.write_report has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 22, if/else 19, ternaries 7, 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.
ProjectEngine._completion_message_text (cognitive 48) REDACTED:2506— ProjectEngine._completion_message_text has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 11 (19 pts), if/else 15 (16 pts), boolean chains 13 (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.
GlobalSearch.useGlobalSearchGroups (cognitive 48) src/components/GlobalSearch.tsx:117— GlobalSearch.useGlobalSearchGroups has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 7, loops 4 (6 pts), ternaries 5 (nesting depth added 16). None of this is in the body itself: all 48 points belong to 4 function literals inside it that branch (lines 133, 191, 135, …). 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.
knowledge_api._dispatch_get_sync (cognitive 47) backend/knowledge_api.py:230— knowledge_api._dispatch_get_sync has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 13, ternaries 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.
ModelBindingModule.ModelBindingModule (cognitive 47) src/components/ModelBindingModule.tsx:147— ModelBindingModule.ModelBindingModule has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 16 (22 pts), boolean chains 21, if/else 4 (nesting depth added 6). Of this number, 40 points are the body's own statements and 7 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
KnowledgePreview.KnowledgePreview (cognitive 47) src/components/KnowledgePreview.tsx:55— KnowledgePreview.KnowledgePreview has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 15, ternaries 6 (8 pts) (nesting depth added 8). Of this number, 21 points are the body's own statements and 26 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEngine._loop (cognitive 46) REDACTED:4431— ProjectEngine._loop has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 4 (10 pts), boolean chains 9, error handling 3 (6 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.
ProviderClient.chat_stream (cognitive 46) backend/knowe_core/provider_client.py:375— ProviderClient.chat_stream has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (32 pts), error handling 4 (8 pts), boolean chains 3, loops 2 (3 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.
knowledge.useKnowledgeStore (cognitive 45) src/store/knowledge.ts:366— knowledge.useKnowledgeStore has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 15, if/else 12 (14 pts), error handling 11, ternaries 4 (5 pts) (nesting depth added 3). Of this number, 31 points are the body's own statements and 14 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.
ProjectEngine._agent_memory_clues_block (cognitive 43) REDACTED:7436— ProjectEngine._agent_memory_clues_block has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 16, loops 5 (7 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderClient._parse_sse_line (cognitive 43) backend/knowe_core/provider_client.py:863— ProviderClient._parse_sse_line has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 11, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ConvList.ConvListItem (cognitive 43) src/components/ConvList.tsx:366— ConvList.ConvListItem has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 9, if/else 4 (8 pts), loops 1 (nesting depth added 14). Of this number, 30 points are the body's own statements and 13 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.
TokenUsagePanel.TrendChart (cognitive 43) src/components/TokenUsagePanel.tsx:214— TokenUsagePanel.TrendChart has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 21, if/else 10 (11 pts), ternaries 10 (11 pts) (nesting depth added 2). Of this number, 16 points are the body's own statements and 27 belong to 13 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
KnowledgeGraphManager._merge_extraction (cognitive 42) backend/knowledge_graph.py:816— KnowledgeGraphManager._merge_extraction has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 21, if/else 8 (16 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MemoryManager._ensure_history_initialized (cognitive 42) backend/memory_manager.py:865— MemoryManager._ensure_history_initialized has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 18, ternaries 2 (3 pts), 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.
anthropic_codec.encode_request (cognitive 41) backend/knowe_core/anthropic_codec.py:112— anthropic_codec.encode_request has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 3, loops 2, ternaries 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.
ContextMenu.ForwardModalBody (cognitive 41) src/components/ContextMenu.tsx:847— ContextMenu.ForwardModalBody has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 20, if/else 12, ternaries 8 (9 pts) (nesting depth added 1). Most of this is not in the body itself: 12 of the 41 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 919, a function literal at line 996, a function literal at line 886, …). 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.
PptxPreview.parseTextShape (cognitive 41) src/preview/renderers/PptxPreview.tsx:265— PptxPreview.parseTextShape has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 16, loops 2 (3 pts), ternaries 1 (nesting depth added 12). Of this number, 39 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.
PptxPreview.parseSlide (cognitive 41) src/preview/renderers/PptxPreview.tsx:371— PptxPreview.parseSlide has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 3 (9 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
ProjectEngine._emit_legacy_completion_visible (cognitive 40) REDACTED:2763— ProjectEngine._emit_legacy_completion_visible has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 22, if/else 12 (17 pts), loops 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProviderModelAdapter._stream_step (cognitive 40) backend/knowe_adapters/model_adapter.py:142— ProviderModelAdapter._stream_step has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (23 pts), ternaries 3 (9 pts), boolean chains 7, loops 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.
KnowledgeAssetManager._sync_project_experience_skills (cognitive 40) REDACTED:1292— KnowledgeAssetManager._sync_project_experience_skills has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 19, if/else 6 (11 pts), ternaries 3 (6 pts), loops 2 (3 pts), error handling 1 (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
privacy.sanitize_event (cognitive 40) backend/privacy.py:91— privacy.sanitize_event has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (7 pts), boolean chains 6, ternaries 1 (2 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.
RecordsDrawer.RecordsDrawer::renderBody (cognitive 40) src/components/RecordsDrawer.tsx:421— RecordsDrawer.RecordsDrawer::renderBody has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 11 (15 pts), boolean chains 5 (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 shape REPEATS in the file: one other method here (RecordsDrawer.RecordsDrawer) 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.
ProjectEngine.commit_handoff_step (cognitive 39) REDACTED:9058— ProjectEngine.commit_handoff_step has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 9 (11 pts), boolean chains 6, error handling 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.
KnoweServer.load_from_disk (cognitive 38) REDACTED:1544— KnoweServer.load_from_disk has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._cmd_token_usage_req (cognitive 38) REDACTED:2533— KnoweServer._cmd_token_usage_req has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 13, error handling 3 (5 pts), loops 2 (4 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._cmd_update_agent_profile (cognitive 38) REDACTED:3664— KnoweServer._cmd_update_agent_profile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 4 (11 pts), boolean chains 10, ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewApp.PreviewApp (cognitive 38) src/preview/PreviewApp.tsx:172— PreviewApp.PreviewApp has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 18, if/else 14 (16 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 38 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 297, 191, 287, …). 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.
KnowledgeGraphManager.search (cognitive 37) backend/knowledge_graph.py:387— KnowledgeGraphManager.search has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 16, if/else 7 (14 pts), ternaries 2 (4 pts), loops 2, 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.
FirstRunModelGate.FirstRunModelGate (cognitive 37) src/components/FirstRunModelGate.tsx:38— FirstRunModelGate.FirstRunModelGate has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 9 (18 pts), boolean chains 12, if/else 7 (nesting depth added 9). Of this number, 25 points are the body's own statements and 12 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.
engine._agent_messages (cognitive 36) REDACTED:9408— engine._agent_messages has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (8 pts), boolean chains 4 (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.
KnowledgeGraphManager._detach_source (cognitive 36) backend/knowledge_graph.py:1161— KnowledgeGraphManager._detach_source has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 7, loops 4 (6 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.
KnowledgeGraphManager._load_graph (cognitive 36) backend/knowledge_graph.py:1318— KnowledgeGraphManager._load_graph has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 3 (13 pts), if/else 4 (9 pts), loops 3 (9 pts), error handling 2 (4 pts), boolean chains 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.
MemoryManager.search_project_history (cognitive 36) backend/memory_manager.py:693— MemoryManager.search_project_history has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 10, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store.delete_project (cognitive 36) backend/persist.py:326— Store.delete_project has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, error handling 4 (7 pts), loops 6 (7 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.
FavoritesView.FavoritesView (cognitive 36) src/components/FavoritesView.tsx:135— FavoritesView.FavoritesView has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (17 pts), if/else 8 (10 pts), boolean chains 4, loops 2 (3 pts), match/switch 2 (nesting depth added 9). Most of this is not in the body itself: 5 of the 36 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 153, a function literal at line 146, a function literal at line 196, …). 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.
ProjectEngine._recent_activity_block (cognitive 35) REDACTED:5478— ProjectEngine._recent_activity_block has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEngine.delete_agent_permanently (cognitive 35) REDACTED:7180— ProjectEngine.delete_agent_permanently has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 10, loops 4, error handling 1 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
provider_client.normalize_usage_buckets (cognitive 35) backend/knowe_core/provider_client.py:57— provider_client.normalize_usage_buckets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (9 pts), boolean chains 4 (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.
KnoweServer._rename_project (cognitive 35) REDACTED:1184— KnoweServer._rename_project has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (20 pts), error handling 5 (9 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
favorites.useFavoritesStore (cognitive 35) src/store/favorites.ts:189— favorites.useFavoritesStore has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 10 (11 pts), boolean chains 8 (nesting depth added 8). Of this number, 31 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.
ContactsView.ContactsView (cognitive 35) src/components/ContactsView.tsx:397— ContactsView.ContactsView has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 14 (15 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 448, 415, 480, …). 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.
PreviewApp.previewTabsReducer (cognitive 35) src/preview/PreviewApp.tsx:61— PreviewApp.previewTabsReducer has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 4, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WorkerRuntimeFactory.prepare_context (cognitive 34) backend/worker_gateway_runtime.py:144— WorkerRuntimeFactory.prepare_context has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tiptapMarkdown.markdownToTiptapDoc (cognitive 34) src/shared/tiptapMarkdown.ts:140— tiptapMarkdown.markdownToTiptapDoc has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (12 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 19). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEngine._run_dm_turn (cognitive 33) REDACTED:3912— ProjectEngine._run_dm_turn has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (12 pts), error handling 6 (8 pts), if/else 6 (7 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.
knowledge_graph._render_node (cognitive 33) backend/knowledge_graph.py:1686— knowledge_graph._render_node has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), ternaries 6 (9 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.
KnoweServer.run (cognitive 33) REDACTED:6541— KnoweServer.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 5 (8 pts), loops 4 (7 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.
ContextMenu.decorateConversationList (cognitive 33) src/components/ContextMenu.tsx:1614— ContextMenu.decorateConversationList has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, ternaries 3 (6 pts), loops 3 (nesting depth added 6). Of this number, 29 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.
ProjectRuntime.aclose (cognitive 32) backend/agent_runtime.py:334— ProjectRuntime.aclose has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (16 pts), error handling 3 (12 pts), boolean chains 3, 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.
KnoweAgent.run_conversation (cognitive 32) backend/agents/knowe_agent.py:214— KnoweAgent.run_conversation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 2 (4 pts), error handling 2, ternaries 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.
ProjectEngine._record_activity_from_event (cognitive 32) REDACTED:5882— ProjectEngine._record_activity_from_event has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
engine.select_provider_fallback (cognitive 32) REDACTED:175— engine.select_provider_fallback has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9, error handling 1 (2 pts), 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.
lineage._memory_records (cognitive 32) backend/knowe_provenance/lineage.py:223— lineage._memory_records has cognitive complexity 32 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (8 pts), boolean chains 7, loops 3 (6 pts), 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.
lineage.resolve_task_lineage (cognitive 32) backend/knowe_provenance/lineage.py:333— lineage.resolve_task_lineage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 9, loops 4 (6 pts), ternaries 2 (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.
KnowledgeAssetManager.refresh_assets (cognitive 32) REDACTED:567— KnowledgeAssetManager.refresh_assets has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 13, 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.
ProjectEngine._run_agent_turn (cognitive 31) REDACTED:4856— ProjectEngine._run_agent_turn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 10, ternaries 5 (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.
ProviderClient._parse_sse_stream (cognitive 31) backend/knowe_core/provider_client.py:753— ProviderClient._parse_sse_stream has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (10 pts), boolean chains 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.
socket.createSocket.handleServerControlEvent (cognitive 31) src/transport/socket.ts:593— socket.createSocket.handleServerControlEvent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 6, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PreviewTabs.PreviewTabs (cognitive 31) src/preview/PreviewTabs.tsx:17— PreviewTabs.PreviewTabs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14, ternaries 10, boolean chains 7. None of this is in the body itself: all 31 points belong to 9 function items inside it that branch (a function literal at line 64, a function literal at line 45, a function literal at line 119, …). 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.
PdfPreview.PdfPreview (cognitive 31) src/preview/renderers/PdfPreview.tsx:36— PdfPreview.PdfPreview has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14, boolean chains 11, ternaries 6. Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 124, 167, 85, …). 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.
contracts.normalize_relative_path (cognitive 30) backend/knowe_harness/contracts.py:54— contracts.normalize_relative_path has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 5, 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.
lineage._knowledge_records (cognitive 30) backend/knowe_provenance/lineage.py:263— lineage._knowledge_records has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (9 pts), boolean chains 7, loops 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store.purge_agent_events (cognitive 30) backend/persist.py:771— Store.purge_agent_events has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 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.
KnoweServer._do_replay (cognitive 30) REDACTED:2399— KnoweServer._do_replay has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 5, loops 2 (3 pts), error handling 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.
SettingsView.ModelsPane (cognitive 30) src/components/SettingsView.tsx:296— SettingsView.ModelsPane has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 6 (8 pts), boolean chains 7 (nesting depth added 3). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 9 function items inside it that branch (handleSave, renderConnStatus, a function literal at line 480, …). 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.
KnowledgeView.KnowledgeModals (cognitive 30) src/components/KnowledgeView.tsx:1044— KnowledgeView.KnowledgeModals has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 11 (nesting depth added 1). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 1053, doRename, a function literal at line 1079, …). 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.
ProjectEngine._write_agent_memory (cognitive 29) REDACTED:7331— ProjectEngine._write_agent_memory has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (12 pts), error handling 2 (3 pts), 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.
engine._parse_agent_worklog (cognitive 29) REDACTED:1120— engine._parse_agent_worklog has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 2 (4 pts), ternaries 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.
knowledge_api._merged_skillpacks (cognitive 29) backend/knowledge_api.py:174— knowledge_api._merged_skillpacks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, loops 4 (7 pts), error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeGraphManager._apply_approval_signal (cognitive 29) backend/knowledge_graph.py:1106— KnowledgeGraphManager._apply_approval_signal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 10, loops 4 (5 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.
toolActivity.appendToolActivity (cognitive 29) src/store/toolActivity.ts:126— toolActivity.appendToolActivity has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 5, loops 1 (nesting depth added 10). 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.
projectAlias.reconcileProjectAlias (cognitive 29) src/store/projectAlias.ts:49— projectAlias.reconcileProjectAlias has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (12 pts), loops 2 (3 pts), 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.
contract._check_card (cognitive 28) backend/contract.py:482— contract._check_card has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEngine._run_worker_attempt (cognitive 28) REDACTED:3582— ProjectEngine._run_worker_attempt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, boolean chains 6, ternaries 3 (5 pts), error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AnthropicStreamDecoder.feed (cognitive 28) backend/knowe_core/anthropic_codec.py:264— AnthropicStreamDecoder.feed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool_protocol._coerce_scalar (cognitive 28) REDACTED:202— tool_protocol._coerce_scalar has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 3 (6 pts), boolean chains 4, 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.
SQLiteCompletionStore._insert_event (cognitive 28) backend/knowe_harness/completion.py:1492— SQLiteCompletionStore._insert_event has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (7 pts), boolean chains 6, error handling 1 (2 pts), 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.
CompletionProjector.drain (cognitive 28) backend/knowe_harness/projections.py:157— CompletionProjector.drain has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 2 (6 pts), boolean chains 3, 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.
knowledge_assets._validate_distilled (cognitive 28) REDACTED:1882— knowledge_assets._validate_distilled has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 11, 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.
KnowledgeGraphManager.apply_user_override (cognitive 28) backend/knowledge_graph.py:567— KnowledgeGraphManager.apply_user_override has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5, error handling 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.
_Markdownifier.handle_endtag (cognitive 28) REDACTED:465— _Markdownifier.handle_endtag has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 2 (5 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.registerMember (cognitive 28) src/store/state.ts:525— state.registerMember has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 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.
state.humanizeCompletionStatus (cognitive 28) src/store/state.ts:2197— state.humanizeCompletionStatus has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 13 (22 pts), boolean chains 5, match/switch 1 (nesting depth added 9). Of this number, 23 points are the body's own statements and 5 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.
ProjectEngine._normalize_outbound_files (cognitive 27) REDACTED:2448— ProjectEngine._normalize_outbound_files has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, 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.
CompletionEvent.from_dict (cognitive 27) backend/knowe_harness/completion.py:344— CompletionEvent.from_dict has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 24, if/else 2, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KnoweServer._assert_project_delete_paths_isolated (cognitive 27) REDACTED:4470— KnoweServer._assert_project_delete_paths_isolated has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (6 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.spawnBackend (cognitive 27) electron/main.ts:723— main.spawnBackend has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 8). Of this number, 20 points are the body's own statements and 7 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.
ConvList.ConvList (cognitive 27) src/components/ConvList.tsx:40— ConvList.ConvList has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (9 pts), if/else 2 (4 pts), loops 2 (3 pts) (nesting depth added 6). Of this number, 16 points are the body's own statements and 11 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RosterPanel.RosterPanel (cognitive 27) src/components/RosterPanel.tsx:49— RosterPanel.RosterPanel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 7. Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 164, a function literal at line 131, a function literal at line 91, …). 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.
context_compressor._projection_index (cognitive 26) backend/context_compressor.py:264— context_compressor._projection_index has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderClient._parse_anthropic_sse_stream (cognitive 26) backend/knowe_core/provider_client.py:797— ProviderClient._parse_anthropic_sse_stream has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 6 (12 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TaskResultV1.from_dict (cognitive 26) backend/knowe_harness/completion.py:510— TaskResultV1.from_dict has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 22, if/else 3, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SQLiteCompletionStore._event_for_run (cognitive 26) backend/knowe_harness/completion.py:2074— SQLiteCompletionStore._event_for_run has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 18, if/else 5, ternaries 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.
CompletionProjector._memory (cognitive 26) backend/knowe_harness/projections.py:588— CompletionProjector._memory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 3 (6 pts), boolean chains 4, loops 1 (3 pts), 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.
KnowledgeAssetManager._render_asset_md (cognitive 26) REDACTED:1222— KnowledgeAssetManager._render_asset_md has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (8 pts), ternaries 1 (3 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.
ProjectEngine._create_task_envelope (cognitive 25) REDACTED:8402— ProjectEngine._create_task_envelope has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 16, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
engine._agent_memory_duplicate_of_project (cognitive 25) REDACTED:1235— engine._agent_memory_duplicate_of_project has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (10 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StreamAssembler.finalize_turn (cognitive 25) backend/knowe_core/stream_assembler.py:163— StreamAssembler.finalize_turn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 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.
SQLiteCompletionStore._scan_workspace_deltas (cognitive 25) backend/knowe_harness/completion.py:1965— SQLiteCompletionStore._scan_workspace_deltas has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 4 (6 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mentions._mentioned_aliases (cognitive 25) backend/mentions.py:83— mentions._mentioned_aliases has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 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.
WorkerRuntime._collect_facts (cognitive 25) backend/runtime.py:1326— WorkerRuntime._collect_facts has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), error handling 2 (4 pts), 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.
KnoweServer._resolve_preview_target (cognitive 25) REDACTED:5838— KnoweServer._resolve_preview_target has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 6 (7 pts), ternaries 2 (3 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.
tools_knowe._external_path (cognitive 25) backend/tools_knowe.py:2364— tools_knowe._external_path has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, error handling 2 (3 pts), loops 2, 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.
workspace_layout.ensure_internal_workspace (cognitive 25) backend/workspace_layout.py:156— workspace_layout.ensure_internal_workspace has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, error handling 2 (3 pts), loops 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.
ContextMenu.FloatingLayers (cognitive 25) src/components/ContextMenu.tsx:1726— ContextMenu.FloatingLayers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, ternaries 7, boolean chains 6. Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 1769, 1737, 1799, …). 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.
knowledge.toCard (cognitive 25) src/store/knowledge.ts:169— knowledge.toCard has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 17, ternaries 6 (7 pts), if/else 1 (nesting depth added 1). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReasoningPanel.ReasoningPanel (cognitive 25) src/components/ReasoningPanel.tsx:104— ReasoningPanel.ReasoningPanel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 3. Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 167, 186, 119, …). 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.
DateCalendar.DateCalendar (cognitive 25) src/components/DateCalendar.tsx:76— DateCalendar.DateCalendar has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11, ternaries 6, boolean chains 4, loops 4. Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 159, goPrev, goNext, …). 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.
attachments.extract_file_text (cognitive 24) backend/attachments.py:399— attachments.extract_file_text has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), ternaries 2 (3 pts), error handling 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.
messages.sanitize_messages (cognitive 24) backend/knowe_core/messages.py:24— messages.sanitize_messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 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.
StreamAssembler._validate_tool_calls (cognitive 24) backend/knowe_core/stream_assembler.py:424— StreamAssembler._validate_tool_calls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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.
tool_protocol._xml_args (cognitive 24) REDACTED:439— tool_protocol._xml_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 3 (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.
CompletionProjector._report (cognitive 24) backend/knowe_harness/projections.py:394— CompletionProjector._report has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 4 (6 pts), error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeAssetManager.apply_user_override (cognitive 24) REDACTED:826— KnowledgeAssetManager.apply_user_override has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, error handling 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server._build_handoff_items (cognitive 24) REDACTED:7027— server._build_handoff_items has cognitive complexity 24 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 4 (8 pts), ternaries 2 (4 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.
state.applyCompletionStatus (cognitive 24) src/store/state.ts:2242— state.applyCompletionStatus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, ternaries 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, 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.
AttemptProcessRegistry._terminate (cognitive 23) backend/agent_runtime.py:252— AttemptProcessRegistry._terminate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (8 pts), error handling 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ZinniaAgent._run (cognitive 23) backend/agents/zinnia.py:749— ZinniaAgent._run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 2, ternaries 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.
content_compress.compact_json (cognitive 23) backend/content_compress.py:233— content_compress.compact_json has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, 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.
ProjectEngine._drop_member_lifecycle_activity (cognitive 23) REDACTED:5847— ProjectEngine._drop_member_lifecycle_activity has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 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.
ProjectEngine.project_summary (cognitive 23) REDACTED:6758— ProjectEngine.project_summary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 3 (5 pts), error handling 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.
engine._repair_tool_calls (cognitive 23) REDACTED:9501— engine._repair_tool_calls has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._canonical_project_id_from_request (cognitive 23) REDACTED:3310— KnoweServer._canonical_project_id_from_request has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
token_usage.extract_token_usage_parts (cognitive 23) REDACTED:107— token_usage.extract_token_usage_parts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, 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.
socket.createSocket.routeEvent (cognitive 23) src/transport/socket.ts:475— socket.createSocket.routeEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 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, 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.
ChatStream.findRelayPair (cognitive 23) src/components/ChatStream.tsx:98— ChatStream.findRelayPair has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (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.
engine._select_diverse_memory_clues (cognitive 22) REDACTED:990— engine._select_diverse_memory_clues has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (9 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
provider_identity.humanize_provider_error (cognitive 22) backend/knowe_core/provider_identity.py:210— provider_identity.humanize_provider_error has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, 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.
StreamAssembler._handle_tool_call (cognitive 22) backend/knowe_core/stream_assembler.py:282— StreamAssembler._handle_tool_call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tool_protocol.decode_json_compat (cognitive 22) REDACTED:127— tool_protocol.decode_json_compat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (6 pts), loops 3 (5 pts), boolean chains 4 (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.
TaskResultV1.from_completion (cognitive 22) backend/knowe_harness/completion.py:423— TaskResultV1.from_completion has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), ternaries 1 (2 pts) (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.
KnowledgeAssetManager._third_party_skill_documents (cognitive 22) REDACTED:1465— KnowledgeAssetManager._third_party_skill_documents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, error handling 1 (2 pts), loops 2, 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.
knowledge_graph._fallback_extraction (cognitive 22) backend/knowledge_graph.py:1558— knowledge_graph._fallback_extraction has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (9 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Store.load_events (cognitive 22) backend/persist.py:649— Store.load_events has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 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.
SeenSpeechLedger._ensure_loaded (cognitive 22) backend/seen_speech.py:67— SeenSpeechLedger._ensure_loaded has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (7 pts), error handling 2 (3 pts), ternaries 1 (2 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.
KnoweServer._restart_engine (cognitive 22) REDACTED:2262— KnoweServer._restart_engine has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3 (5 pts), loops 1 (2 pts), ternaries 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.
KnoweServer._cmd_user_message (cognitive 22) REDACTED:2719— KnoweServer._cmd_user_message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 3, loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GlobalSearch.CommandPalette (cognitive 22) src/components/GlobalSearch.tsx:364— GlobalSearch.CommandPalette has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 5 function items inside it that branch (onInputKeyDown, a function literal at line 383, a function literal at line 407, …). 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.
ZinniaAgent._resolve_binding (cognitive 21) backend/agents/zinnia.py:550— ZinniaAgent._resolve_binding has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
content_compress._compress_nested (cognitive 21) backend/content_compress.py:191— content_compress._compress_nested has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 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.
delete_ops._restart_manager_resources (cognitive 21) backend/delete_ops.py:158— delete_ops._restart_manager_resources has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 pts), error handling 1 (2 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.
engine.rewrite_project_name_tree (cognitive 21) REDACTED:349— engine.rewrite_project_name_tree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (3 pts), loops 2 (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.
tool_protocol._ast_call (cognitive 21) REDACTED:528— tool_protocol._ast_call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3 (6 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.
KnowledgeAssetManager._pass_induce (cognitive 21) REDACTED:689— KnowledgeAssetManager._pass_induce has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeAssetManager._public_asset (cognitive 21) REDACTED:1824— KnowledgeAssetManager._public_asset has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (5 pts), ternaries 2 (3 pts), loops 2 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
memory_manager._normalize_state (cognitive 21) backend/memory_manager.py:1361— memory_manager._normalize_state has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 2 (3 pts), error handling 1 (2 pts), 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.
Store.load_roster_full (cognitive 21) backend/persist.py:905— Store.load_roster_full has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 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.
WorkerRuntime._execute_tool (cognitive 21) backend/runtime.py:1259— WorkerRuntime._execute_tool has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (7 pts), error handling 5 (6 pts), boolean chains 5, if/else 3 (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.
KnoweServer._announced_members (cognitive 21) REDACTED:2214— KnoweServer._announced_members has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._cmd_create_project (cognitive 21) REDACTED:3529— KnoweServer._cmd_create_project has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tools_knowe._project_path (cognitive 21) backend/tools_knowe.py:2150— tools_knowe._project_path has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (6 pts), loops 2 (3 pts), boolean chains 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.
selectors.orderRosterMembers.sorted (cognitive 21) src/store/selectors.ts:187— selectors.orderRosterMembers.sorted has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 5 (7 pts), boolean chains 4 (nesting depth added 5). 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.
ProjectEngine._persist_worker_token_usage (cognitive 20) REDACTED:1913— ProjectEngine._persist_worker_token_usage has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 6, error handling 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.
ProjectEngine._correlate_visible_event (cognitive 20) REDACTED:2931— ProjectEngine._correlate_visible_event has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (8 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProjectEngine.restore_roster (cognitive 20) REDACTED:7591— ProjectEngine.restore_roster has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 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.
HandoffBook.write_approval (cognitive 20) backend/handoff.py:520— HandoffBook.write_approval has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 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.
ProviderClient._request (cognitive 20) backend/knowe_core/provider_client.py:553— ProviderClient._request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 4 (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.
tool_protocol._contains_tool_token (cognitive 20) REDACTED:181— tool_protocol._contains_tool_token has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (6 pts), ternaries 2 (6 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeAssetManager._pass_conflicts (cognitive 20) REDACTED:739— KnowledgeAssetManager._pass_conflicts has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), loops 2 (3 pts), error handling 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.
knowledge_assets._normalize_md_body (cognitive 20) REDACTED:1925— knowledge_assets._normalize_md_body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, 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.
KnowledgeGraphManager._public_node (cognitive 20) backend/knowledge_graph.py:1440— KnowledgeGraphManager._public_node has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 3 (5 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.
memory_manager._parse_retrieval_keywords (cognitive 20) backend/memory_manager.py:1285— memory_manager._parse_retrieval_keywords has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 1 (2 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory_manager._rotate_active_history (cognitive 20) backend/memory_manager.py:1725— memory_manager._rotate_active_history has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 4 (7 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.
TaskEnvelope.from_dict (cognitive 20) backend/runtime.py:345— TaskEnvelope.from_dict has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 17, ternaries 2, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
server._list_dir_any (cognitive 20) REDACTED:7274— server._list_dir_any has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3 (5 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
tools_knowe._split_background_command (cognitive 20) backend/tools_knowe.py:2318— tools_knowe._split_background_command has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 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.
WorkerRuntimeFactory.create (cognitive 20) backend/worker_gateway_runtime.py:266— WorkerRuntimeFactory.create has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
state.applyCompletionViewV1 (cognitive 20) src/store/state.ts:2338— state.applyCompletionViewV1 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 5. 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.
TokenUsagePanel.formatZhCompact (cognitive 20) src/components/TokenUsagePanel.tsx:48— TokenUsagePanel.formatZhCompact has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, ternaries 1 (nesting depth added 8). Of this number, 19 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.
ContactsView.AgentProfile (cognitive 20) src/components/ContactsView.tsx:744— ContactsView.AgentProfile has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 3. Of this number, 11 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MarkdownPreview.MarkdownPreview (cognitive 20) src/preview/renderers/MarkdownPreview.tsx:126— MarkdownPreview.MarkdownPreview has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 7, error handling 3, ternaries 1. Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 225, a function literal at line 145, a function literal at line 171, …). 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.
PptxPreview.PptxPreview (cognitive 20) src/preview/renderers/PptxPreview.tsx:549— PptxPreview.PptxPreview has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6, loops 2 (3 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 567, 575, 583, …). 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.
attachments._extract_with_xlrd (cognitive 19) backend/attachments.py:375— attachments._extract_with_xlrd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 pts), ternaries 1 (4 pts), error handling 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.
aux_client._parse_aux (cognitive 19) REDACTED:135— aux_client._parse_aux has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 1 (2 pts), 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.
browser_tools.format_snapshot (cognitive 19) backend/browser_tools.py:258— browser_tools.format_snapshot 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.
engine._select_agent_memory_clues (cognitive 19) REDACTED:1277— engine._select_agent_memory_clues has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 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.
engine.learn_history_attr (cognitive 19) REDACTED:9464— engine.learn_history_attr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 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.
HandoffBook.find (cognitive 19) backend/handoff.py:622— HandoffBook.find has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), error handling 1 (3 pts), boolean chains 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.
KnowledgeGraphManager.ingest_handoff (cognitive 19) backend/knowledge_graph.py:229— KnowledgeGraphManager.ingest_handoff has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 6, error handling 4 (5 pts), 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.
KnowledgeGraphManager.snapshot (cognitive 19) backend/knowledge_graph.py:485— KnowledgeGraphManager.snapshot has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (5 pts), loops 3 (4 pts), ternaries 1 (3 pts), 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.
runtime_settings._ensure_loaded (cognitive 19) backend/runtime_settings.py:134— runtime_settings._ensure_loaded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._bind_project_id_to_approval (cognitive 19) REDACTED:3257— KnoweServer._bind_project_id_to_approval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._cmd_add_agents (cognitive 19) REDACTED:3591— KnoweServer._cmd_add_agents has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 5 (6 pts), loops 3 (4 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.
server._dedupe_agents_created (cognitive 19) REDACTED:7077— server._dedupe_agents_created has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 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.
token_pricing.estimate_cost (cognitive 19) backend/token_pricing.py:392— token_pricing.estimate_cost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, 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.
tools_knowe._missing_artifacts (cognitive 19) backend/tools_knowe.py:1997— tools_knowe._missing_artifacts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings.postCurrentSettingsNow (cognitive 19) src/store/settings.ts:474— settings.postCurrentSettingsNow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 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.
records.useRecordsStore (cognitive 19) src/store/records.ts:182— records.useRecordsStore has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 5, error handling 3, boolean chains 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.
FileCard.FileCard (cognitive 19) src/components/FileCard.tsx:14— FileCard.FileCard has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 4. Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 45, a function literal at line 70, a function literal at line 41, …). 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.
ZoomPan.ZoomPanViewport (cognitive 19) src/components/ZoomPan.tsx:81— ZoomPan.ZoomPanViewport has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 142, 114, 117, …). 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.
context_compressor.classify_layer (cognitive 18) backend/context_compressor.py:43— context_compressor.classify_layer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, 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.
delete_ops.find_locking_processes (cognitive 18) backend/delete_ops.py:188— delete_ops.find_locking_processes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, loops 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProjectEngine._emit_completion_visible (cognitive 18) REDACTED:2699— ProjectEngine._emit_completion_visible has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 3 (5 pts), if/else 4, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProjectEngine.submit_dm (cognitive 18) REDACTED:3844— ProjectEngine.submit_dm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 2 (3 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, 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.
ProjectEngine.write_handoff_report (cognitive 18) REDACTED:4060— ProjectEngine.write_handoff_report has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (7 pts), if/else 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.
ProviderModelAdapter.from_legacy (cognitive 18) backend/knowe_adapters/model_adapter.py:61— ProviderModelAdapter.from_legacy has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), ternaries 2 (4 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.
ProviderModelAdapter._explicit_outcome (cognitive 18) backend/knowe_adapters/model_adapter.py:293— ProviderModelAdapter._explicit_outcome has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 2 (4 pts), if/else 3 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
anthropic_codec._tool_use_blocks (cognitive 18) backend/knowe_core/anthropic_codec.py:76— anthropic_codec._tool_use_blocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, error handling 1 (3 pts), 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.
provider_identity._clean_response_detail (cognitive 18) backend/knowe_core/provider_identity.py:103— provider_identity._clean_response_detail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (2 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.
tool_protocol._remove_trailing_commas (cognitive 18) REDACTED:91— tool_protocol._remove_trailing_commas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 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.
CompletionProjector._task_state (cognitive 18) backend/knowe_harness/projections.py:294— CompletionProjector._task_state has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 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.
mentions.resolve_mentions (cognitive 18) backend/mentions.py:123— mentions.resolve_mentions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5, 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.
KnoweServer._dm_channel_name (cognitive 18) REDACTED:2827— KnoweServer._dm_channel_name has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server._pending_approval_snapshots (cognitive 18) REDACTED:6790— server._pending_approval_snapshots 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.
knowledge.toSkillPack (cognitive 18) src/store/knowledge.ts:219— knowledge.toSkillPack has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (8 pts), if/else 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SettingsView.SettingsView (cognitive 18) src/components/SettingsView.tsx:733— SettingsView.SettingsView has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 8, error handling 1. Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (restartBackend, a function literal at line 754, a function literal at line 759, …). 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.
_UsageTrackingClient.chat_stream (cognitive 17) backend/agents/knowe_agent.py:71— _UsageTrackingClient.chat_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 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.
attachments.replace_file_blocks_with_text (cognitive 17) backend/attachments.py:445— attachments.replace_file_blocks_with_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
contract._check (cognitive 17) backend/contract.py:431— contract._check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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.
ProjectEngine.rename_project_references (cognitive 17) REDACTED:1709— ProjectEngine.rename_project_references has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, error handling 1 (2 pts), loops 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.
ProjectEngine._run_feedback_flight (cognitive 17) REDACTED:4341— ProjectEngine._run_feedback_flight has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4, boolean chains 3, error handling 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.
model.recorded_provenance (cognitive 17) backend/knowe_provenance/model.py:99— model.recorded_provenance has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, if/else 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.
KnowledgeAssetManager.distill_task (cognitive 17) REDACTED:214— KnowledgeAssetManager.distill_task has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 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, 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.
KnowledgeAssetManager._check_evidence (cognitive 17) REDACTED:343— KnowledgeAssetManager._check_evidence has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 2 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KnowledgeAssetManager.resolve_step_decision (cognitive 17) REDACTED:526— KnowledgeAssetManager.resolve_step_decision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
KnowledgeAssetManager._pass_dedup (cognitive 17) REDACTED:658— KnowledgeAssetManager._pass_dedup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 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.
KnowledgeGraphManager.read_node (cognitive 17) backend/knowledge_graph.py:453— KnowledgeGraphManager.read_node has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 1 (2 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.
KnowledgeGraphManager._resolve_node (cognitive 17) backend/knowledge_graph.py:1023— KnowledgeGraphManager._resolve_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, 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.
KnowledgeGraphManager._add_lexical_links (cognitive 17) backend/knowledge_graph.py:1081— KnowledgeGraphManager._add_lexical_links has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory_manager._valid_record (cognitive 17) backend/memory_manager.py:1625— memory_manager._valid_record has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, 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, 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.
TaskRun.from_dict (cognitive 17) backend/runtime.py:564— TaskRun.from_dict has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 16, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KnoweServer.create_project (cognitive 17) REDACTED:3407— KnoweServer.create_project has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, error handling 3 (5 pts), boolean chains 4, loops 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.
KnoweServer._delete_path_candidate (cognitive 17) REDACTED:4417— KnoweServer._delete_path_candidate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, error handling 2 (3 pts), loops 2, ternaries 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.
KnoweServer._stage_delete_paths (cognitive 17) REDACTED:4507— KnoweServer._stage_delete_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 4 (6 pts), error handling 2 (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.
main.migrateLegacyDataRoots (cognitive 17) electron/main.ts:195— main.migrateLegacyDataRoots has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3, 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.
main.pruneOldLogs (cognitive 17) electron/main.ts:457— main.pruneOldLogs has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 3 (5 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.
main.createPreviewWindow (cognitive 17) electron/main.ts:1313— main.createPreviewWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 7 function literals inside it that branch (lines 1356, 1346, 1349, …). 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.
store.projectMenuJson (cognitive 17) src/store/store.ts:168— store.projectMenuJson has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 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.
records.groupFileHistory (cognitive 17) src/store/records.ts:79— records.groupFileHistory has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 2 (4 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.
ContextMenu.openConversationMenu (cognitive 17) src/components/ContextMenu.tsx:415— ContextMenu.openConversationMenu has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 7, boolean chains 1 (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 3 function literals inside it that branch (lines 428, 438, 448). 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.
ContextMenu.findConversationDom (cognitive 17) src/components/ContextMenu.tsx:1511— ContextMenu.findConversationDom has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3, boolean chains 2, ternaries 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryPicker.DirectoryPicker (cognitive 17) src/components/DirectoryPicker.tsx:55— DirectoryPicker.DirectoryPicker has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 5, if/else 4 (5 pts), ternaries 3 (5 pts), error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 88, 68). 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.
DirectoryRecoveryCard.FullCard (cognitive 17) src/components/DirectoryRecoveryCard.tsx:116— DirectoryRecoveryCard.FullCard has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 4. Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 133, doConfirm, a function literal at line 189, …). 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.
tiptapMarkdown.parseInline (cognitive 17) src/shared/tiptapMarkdown.ts:99— tiptapMarkdown.parseInline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SheetPreview.SheetTable (cognitive 17) src/preview/renderers/SheetPreview.tsx:56— SheetPreview.SheetTable has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 6, if/else 3 (nesting depth added 3). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 100, a function literal at line 64, a function literal at line 67, …). 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.
ProjectEngine._recover_waiting_completions (cognitive 16) REDACTED:3071— ProjectEngine._recover_waiting_completions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEngine._probe_clear_interrupt (cognitive 16) REDACTED:5051— ProjectEngine._probe_clear_interrupt has cognitive complexity 16 (threshold 15). Drivers by points: error handling 2 (6 pts), if/else 3 (6 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.
file_ops._apply_line_range (cognitive 16) backend/file_ops.py:599— file_ops._apply_line_range has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, ternaries 2, 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.
Hub.replay (cognitive 16) backend/hub.py:261— Hub.replay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 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.
Hub.emit (cognitive 16) backend/hub.py:377— Hub.emit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
IdentityStore.load (cognitive 16) backend/identity_store.py:67— IdentityStore.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 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.
anthropic_codec.decode_response (cognitive 16) backend/knowe_core/anthropic_codec.py:213— anthropic_codec.decode_response has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WaitToken.from_dict (cognitive 16) backend/knowe_harness/completion.py:691— WaitToken.from_dict has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KnowledgeAssetManager._merge_into (cognitive 16) REDACTED:383— KnowledgeAssetManager._merge_into has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 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.
KnowledgeAssetManager.record_usage (cognitive 16) REDACTED:482— KnowledgeAssetManager.record_usage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, loops 3, 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.
KnowledgeAssetManager.match_for_task (cognitive 16) REDACTED:1039— KnowledgeAssetManager.match_for_task has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2, error handling 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.
KnowledgeAssetManager.purge_skillpack (cognitive 16) REDACTED:1694— KnowledgeAssetManager.purge_skillpack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, 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.
memory_manager._match_snippet (cognitive 16) backend/memory_manager.py:1949— memory_manager._match_snippet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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.
PlatformManifest._scan (cognitive 16) backend/platform_manifest.py:133— PlatformManifest._scan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnoweServer._cmd_set_project_directory (cognitive 16) REDACTED:2940— KnoweServer._cmd_set_project_directory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, error handling 3 (5 pts), boolean chains 4, ternaries 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.
KnoweServer._serve_preview_tree (cognitive 16) REDACTED:6101— KnoweServer._serve_preview_tree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 5, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
server._safe_read_any (cognitive 16) REDACTED:7206— server._safe_read_any has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 1, loops 1, 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, 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.
storage_migrator.migrate_task_runs (cognitive 16) backend/storage_migrator.py:58— storage_migrator.migrate_task_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 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.
tools_knowe._copy_external_atomic (cognitive 16) backend/tools_knowe.py:2255— tools_knowe._copy_external_atomic has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (7 pts), if/else 5 (6 pts), boolean chains 2, loops 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.
fileKinds.kindOf (cognitive 16) src/preview/fileKinds.ts:66— fileKinds.kindOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, 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.
RecordsDrawer.RecordsDrawer (cognitive 16) src/components/RecordsDrawer.tsx:127— RecordsDrawer.RecordsDrawer has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 25 (40 pts), if/else 28 (32 pts), boolean chains 24 (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 shape REPEATS in the file: one other method here (RecordsDrawer.RecordsDrawer::renderBody) 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.
Near-duplicate member pair (51 shared lines) backend/tools_knowe.py:391— backend/tools_knowe.py:391-555 | backend/tools_knowe.py:1716-1994 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) backend/knowe_harness/completion.py:345— backend/knowe_harness/completion.py:345-372 | backend/knowe_harness/completion.py:511-541 | backend/knowe_harness/completion.py:584-600 | backend/knowe_harness/completion.py:692-709 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) backend/hub.py:313— backend/hub.py:313-337 | backend/hub.py:342-374 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) REDACTED:3047— REDACTED:3047-3091 | REDACTED:3095-3140 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) REDACTED:865— REDACTED:865-885 | REDACTED:948-987 | REDACTED:1337-1356 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) REDACTED:663— REDACTED:663-679 | REDACTED:849-862 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) backend/knowe_adapters/model_adapter.py:374— backend/knowe_adapters/model_adapter.py:374-390 | backend/knowe_core/provider_client.py:974-993 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) REDACTED:5582— REDACTED:5582-5595 | REDACTED:5607-5631 | REDACTED:5636-5649 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) backend/knowe_harness/completion.py:2312— backend/knowe_harness/completion.py:2312-2329 | backend/knowe_harness/completion.py:2343-2379 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) backend/gate.py:92— backend/gate.py:92-128 | backend/gate.py:334-359 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) backend/prompt_resolver.py:56— backend/prompt_resolver.py:56-71 | backend/prompt_resolver.py:75-87 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) REDACTED:1088— REDACTED:1088-1097 | backend/gate.py:140-149 | backend/memory_manager.py:1905-1914 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) REDACTED:550— REDACTED:550-560 | REDACTED:741-750 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) backend/knowe_harness/completion.py:2475— backend/knowe_harness/completion.py:2475-2480 | backend/knowe_storage/task_run_repository.py:155-160 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) backend/agents/zinnia.py:473— backend/agents/zinnia.py:473-490 | backend/tools_knowe.py:2419-2429 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) REDACTED:9604— REDACTED:9604-9608 | backend/knowledge_graph.py:2188-2191 | backend/platform_manifest.py:244-247 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) backend/knowe_provenance/schema_registry.py:91— backend/knowe_provenance/schema_registry.py:91-93 | backend/migrations.py:84-87 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 1+ corresponding lines) · ×1
Edited copies of one member (3 members, 1+ corresponding lines) REDACTED:9600— REDACTED:9600-9600 | backend/persist.py:92-93 | REDACTED:7125-7126 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (41–44 lines × 2) backend/knowledge_graph.py:770— backend/knowledge_graph.py:770-810 | backend/memory_manager.py:1052-1095 — 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 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 (32–43 lines × 2) backend/tools_knowe.py:2548— backend/tools_knowe.py:2548-2579 | backend/tools_knowe.py:2602-2644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–40 lines × 2) backend/tools_knowe.py:2674— backend/tools_knowe.py:2674-2711 | backend/tools_knowe.py:3131-3170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:3131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (39–40 lines × 2) backend/tools_knowe.py:2848— backend/tools_knowe.py:2848-2887 | backend/tools_knowe.py:2908-2946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:2848` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) REDACTED:7700— REDACTED:7700-7730 | REDACTED:2648-2678 — 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 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 (24–30 lines × 3) backend/tools_knowe.py:781— backend/tools_knowe.py:781-810 | backend/tools_knowe.py:817-843 | backend/tools_knowe.py:854-877 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:781` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/tools_knowe.py:780` calls `msg` and `backend/tools_knowe.py:816` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (29–30 lines × 2) backend/tools_knowe.py:3092— backend/tools_knowe.py:3092-3120 | backend/tools_knowe.py:3148-3177 — both copies are in the same file, so extract the block into 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–28 lines × 2) backend/knowledge_graph.py:292— backend/knowledge_graph.py:292-316 | backend/knowledge_graph.py:340-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23–27 lines × 2) REDACTED:3487— REDACTED:3487-3513 | REDACTED:3639-3661 — both copies are in the same file, so extract the block into 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–26 lines × 2) backend/context_compressor.py:289— backend/context_compressor.py:289-313 | backend/context_compressor.py:332-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `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 (24 lines × 6) backend/tools_knowe.py:2515— backend/tools_knowe.py:2515-2539 | backend/tools_knowe.py:2689-2712 | backend/tools_knowe.py:2761-2789 | backend/tools_knowe.py:2862-2886 | backend/tools_knowe.py:2921-2945 | backend/tools_knowe.py:3147-3171 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:2515` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) backend/tools_knowe.py:464— backend/tools_knowe.py:464-487 | backend/tools_knowe.py:1805-1828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–24 lines × 2) backend/tools_knowe.py:644— backend/tools_knowe.py:644-650 | backend/tools_knowe.py:852-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:644` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–24 lines × 2) backend/tools_knowe.py:1949— backend/tools_knowe.py:1949-1967 | backend/tools_knowe.py:2738-2761 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 3) backend/tools_knowe.py:467— backend/tools_knowe.py:467-488 | backend/tools_knowe.py:813-840 | backend/tools_knowe.py:1807-1829 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18–22 lines × 2) backend/tools_knowe.py:449— backend/tools_knowe.py:449-470 | backend/tools_knowe.py:526-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:449` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/tools_knowe.py:471` calls `msg` and `backend/tools_knowe.py:543` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 5) backend/tools_knowe.py:2559— backend/tools_knowe.py:2559-2579 | backend/tools_knowe.py:2620-2644 | backend/tools_knowe.py:2764-2789 | backend/tools_knowe.py:2865-2886 | backend/tools_knowe.py:2924-2945 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 3) backend/tools_knowe.py:3094— backend/tools_knowe.py:3094-3114 | backend/tools_knowe.py:3150-3171 | backend/tools_knowe.py:3401-3424 — 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 (16–20 lines × 3) backend/tools_knowe.py:2814— backend/tools_knowe.py:2814-2829 | backend/tools_knowe.py:2870-2889 | backend/tools_knowe.py:2929-2948 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/tools_knowe.py:2814` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) backend/agents/deepseek.py:249— backend/agents/deepseek.py:249-266 | backend/agents/zinnia.py:782-798 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14–15 lines × 2) REDACTED:3064— REDACTED:3064-3078 | REDACTED:3116-3129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–23 lines × 2) REDACTED:2579— REDACTED:2579-2599 | REDACTED:2784-2806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2807` calls `dict`, `get` and `REDACTED:2600` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–14 lines × 2) REDACTED:2782— REDACTED:2782-2795 | REDACTED:2925-2936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 3) REDACTED:6319— REDACTED:6319-6331 | REDACTED:6486-6498 | REDACTED:6552-6564 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–12 lines × 2) REDACTED:4508— REDACTED:4508-4515 | REDACTED:4569-4580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) REDACTED:621— REDACTED:621-630 | REDACTED:964-971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) REDACTED:5587— REDACTED:5587-5595 | REDACTED:5640-5649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–7 lines × 3) backend/knowledge_api.py:247— backend/knowledge_api.py:247-253 | backend/knowledge_api.py:255-260 | backend/knowledge_api.py:263-268 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/knowledge_api.py:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) backend/knowledge_graph.py:1341— backend/knowledge_graph.py:1341-1346 | backend/memory_manager.py:1408-1413 | backend/memory_manager.py:1651-1656 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) backend/hub.py:300— backend/hub.py:300-304 | backend/hub.py:325-329 | backend/hub.py:357-361 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) backend/knowe_harness/completion.py:348— backend/knowe_harness/completion.py:348-352 | backend/knowe_harness/completion.py:514-518 | backend/knowe_harness/completion.py:586-590 | backend/knowe_harness/completion.py:695-699 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/knowe_harness/completion.py:346` calls `str`, `get` and `backend/knowe_harness/completion.py:584` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. 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.
Duplication concentrated across 3 sibling directories (6 clone groups) src/components/ContextMenu.tsx:734— 6 duplicated blocks under src/ have copies in at least two of the sibling directories app, components, preview — 4 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplicated block (38 lines × 2 locations) src/store/messageCache.ts:58— src/store/messageCache.ts:58 · src/store/sessionDirCache.ts:74 — 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.
R10 · Code Duplication· Duplicated block with local edits (30 matched lines × 2 locations) · ×1
Duplicated block with local edits (30 matched lines × 2 locations) src/components/ApprovalCard.tsx:379— src/components/ApprovalCard.tsx:379 · src/components/DirectoryRecoveryCard.tsx:152 — the two spans are one implementation copied and then locally edited — 258 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 (27 lines × 2 locations) src/store/filePreview.ts:115— src/store/filePreview.ts:115 · src/store/filePreview.ts:155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2 locations) src/components/KnowledgeView.tsx:405— src/components/KnowledgeView.tsx:405 · src/components/KnowledgeView.tsx:444 — 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 (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) src/components/MSetSelect.tsx:48— src/components/MSetSelect.tsx:48 · src/components/ModelBindingModule.tsx:246 — the two spans are one implementation copied and then locally edited — 161 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 (22 lines × 2 locations) src/components/MessageBubble.tsx:384— src/components/MessageBubble.tsx:384 · src/components/StreamBubble.tsx:43 — 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 (22 matched lines × 2 locations) · ×1
Duplicated block with local edits (22 matched lines × 2 locations) src/store/tokenUsage.ts:200— src/store/tokenUsage.ts:200 · src/store/tokenUsage.ts:227 — the two spans are one implementation copied and then locally edited — 201 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 (21 lines × 3 locations) src/store/store.ts:1198— src/store/store.ts:1198 · src/store/store.ts:1220 · src/store/store.ts:1247 — all 3 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 (20 matched lines × 2 locations) · ×1
Duplicated block with local edits (20 matched lines × 2 locations) scripts/make-icon-icns.mjs:51— scripts/make-icon-icns.mjs:51 · scripts/make-icon-ico.mjs:32 — the two spans are one implementation copied and then locally edited — 172 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 (19 matched lines × 2 locations) · ×1
Duplicated block with local edits (19 matched lines × 2 locations) src/components/ConvList.tsx:226— src/components/ConvList.tsx:226 · src/components/ConvList.tsx:281 — the two spans are one implementation copied and then locally edited — 132 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 (19 lines × 2 locations) src/components/KnowledgeView.tsx:600— src/components/KnowledgeView.tsx:600 · src/components/KnowledgeView.tsx:682 — 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 (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) src/components/FavoritesView.tsx:309— src/components/FavoritesView.tsx:309 · src/components/FavoritesView.tsx:337 — the two spans are one implementation copied and then locally edited — 105 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 (16 lines × 2 locations) src/store/knowledge.ts:423— src/store/knowledge.ts:423 · src/store/knowledge.ts:441 — 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 (15 matched lines × 2 locations) · ×1
Duplicated block with local edits (15 matched lines × 2 locations) src/preview/renderers/PdfPreview.tsx:82— src/preview/renderers/PdfPreview.tsx:82 · src/preview/renderers/PdfPreview.tsx:161 — the two spans are one implementation copied and then locally edited — 77 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 (13 lines × 3 locations) src/components/ContextMenu.tsx:1132— src/components/ContextMenu.tsx:1132 · src/components/ContextMenu.tsx:1186 · src/components/ContextMenu.tsx:1318 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication· Duplicated block with local edits (13 matched lines × 2 locations) · ×1
Duplicated block with local edits (13 matched lines × 2 locations) src/components/ContextMenu.tsx:734— src/components/ContextMenu.tsx:734 · src/preview/renderers/FallbackPreview.tsx:20 — the two spans are one implementation copied and then locally edited — 70 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 (12 matched lines × 2 locations) · ×1
Duplicated block with local edits (12 matched lines × 2 locations) src/components/FileCard.tsx:21— src/components/FileCard.tsx:21 · src/preview/PreviewApp.tsx:176 — the two spans are one implementation copied and then locally edited — 54 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 (12 lines × 3 locations) src/components/RangeCalendar.tsx:88— src/components/RangeCalendar.tsx:88 · src/components/RosterPanel.tsx:136 · src/components/TokenUsagePanel.tsx:656 — the 3 copies are spread across 3 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.
Boundary violation [package:third-party-deep-import] src/preview/renderers/PdfPreview.tsx:10— src/preview/renderers/PdfPreview.tsx:10 imports pdfjs-dist/build/pdf.worker.min.mjs?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Complex function applyEvent (cyclomatic 225, cognitive 403) src/store/state.ts:830— applyEvent has cyclomatic complexity 225 and cognitive complexity 403; 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 KnowledgeView (cyclomatic 66, cognitive 57) src/components/KnowledgeView.tsx:169— KnowledgeView has cyclomatic complexity 66 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 60, cognitive 94) src/store/store.ts:1461— (anonymous) has cyclomatic complexity 60 and cognitive complexity 94; 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 highlightGenericLine (cyclomatic 58, cognitive 104) src/preview/renderers/codeSyntax.ts:202— highlightGenericLine has cyclomatic complexity 58 and cognitive complexity 104; 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 58, cognitive 58) src/components/MessageBubble.tsx:376— (anonymous) has cyclomatic complexity 58 and cognitive complexity 58; 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 ModelBindingModule (cyclomatic 58, cognitive 52) src/components/ModelBindingModule.tsx:147— ModelBindingModule has cyclomatic complexity 58 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 51, cognitive 43) src/components/ApprovalCard.tsx:150— (anonymous) has cyclomatic complexity 51 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function TokenUsagePanel (cyclomatic 49, cognitive 40) src/components/TokenUsagePanel.tsx:559— TokenUsagePanel has cyclomatic complexity 49 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function KnowledgePreview (cyclomatic 43, cognitive 41) src/components/KnowledgePreview.tsx:55— KnowledgePreview has cyclomatic complexity 43 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ChatStream (cyclomatic 40, cognitive 34) src/components/ChatStream.tsx:212— ChatStream has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 38, cognitive 51) src/components/ChatStream.tsx:1461— (anonymous) has cyclomatic complexity 38 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 previewTabsReducer (cyclomatic 35, cognitive 40) src/preview/PreviewApp.tsx:61— previewTabsReducer has cyclomatic complexity 35 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 highlightMarkupLine (cyclomatic 33, cognitive 66) src/preview/renderers/codeSyntax.ts:150— highlightMarkupLine has cyclomatic complexity 33 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ConvListItem (cyclomatic 31, cognitive 29) src/components/ConvList.tsx:366— ConvListItem has cyclomatic complexity 31 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseTextShape (cyclomatic 30, cognitive 41) src/preview/renderers/PptxPreview.tsx:265— parseTextShape has cyclomatic complexity 30 and cognitive complexity 41; 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 markdownToTiptapDoc (cyclomatic 29, cognitive 47) src/shared/tiptapMarkdown.ts:140— markdownToTiptapDoc has cyclomatic complexity 29 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function FirstRunModelGate (cyclomatic 29, cognitive 23) src/components/FirstRunModelGate.tsx:38— FirstRunModelGate has cyclomatic complexity 29 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 27, cognitive 38) src/components/GlobalSearch.tsx:133— (anonymous) has cyclomatic complexity 27 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 deleteProjectPermanently (cyclomatic 27, cognitive 31) src/store/store.ts:1290— deleteProjectPermanently has cyclomatic complexity 27 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function reconcileProjectAlias (cyclomatic 26, cognitive 30) src/store/projectAlias.ts:49— reconcileProjectAlias has cyclomatic complexity 26 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 handleServerControlEvent (cyclomatic 25, cognitive 31) src/transport/socket.ts:593— handleServerControlEvent has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function routeEvent (cyclomatic 25, cognitive 28) src/transport/socket.ts:475— routeEvent has cyclomatic complexity 25 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toCard (cyclomatic 25, cognitive 24) src/store/knowledge.ts:169— toCard has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseSlide (cyclomatic 24, cognitive 41) src/preview/renderers/PptxPreview.tsx:371— parseSlide has cyclomatic complexity 24 and cognitive complexity 41; 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 24, cognitive 37) src/components/RecordsDrawer.tsx:421— (anonymous) has cyclomatic complexity 24 and cognitive complexity 37; 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 decodePng (cyclomatic 24, cognitive 28) scripts/make-logo-v4.mjs:59— decodePng has cyclomatic complexity 24 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 24, cognitive 24) src/components/Composer.tsx:591— (anonymous) has cyclomatic complexity 24 and cognitive complexity 24; 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 humanizeCompletionStatus (cyclomatic 24, cognitive 23) src/store/state.ts:2197— humanizeCompletionStatus has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function registerMember (cyclomatic 23, cognitive 29) src/store/state.ts:525— registerMember has cyclomatic complexity 23 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 applyCompletionStatus (cyclomatic 23, cognitive 27) src/store/state.ts:2242— applyCompletionStatus has cyclomatic complexity 23 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 Composer (cyclomatic 23, cognitive 21) src/components/Composer.tsx:141— Composer has cyclomatic complexity 23 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 22, cognitive 40) src/store/store.ts:996— (anonymous) has cyclomatic complexity 22 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 decorateConversationList (cyclomatic 21, cognitive 30) src/components/ContextMenu.tsx:1614— decorateConversationList has cyclomatic complexity 21 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 applyCompletionViewV1 (cyclomatic 21, cognitive 23) src/store/state.ts:2338— applyCompletionViewV1 has cyclomatic complexity 21 and cognitive complexity 23; 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 toSkillPack (cyclomatic 21, cognitive 19) src/store/knowledge.ts:219— toSkillPack has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function appendToolActivity (cyclomatic 20, cognitive 28) src/store/toolActivity.ts:126— appendToolActivity has cyclomatic complexity 20 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function App (cyclomatic 20, cognitive 19) src/app/App.tsx:155— App has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function kindOf (cyclomatic 20, cognitive 16) src/preview/fileKinds.ts:66— kindOf has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 19, cognitive 20) src/store/selectors.ts:187— (anonymous) has cyclomatic complexity 19 and cognitive complexity 20; 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 19, cognitive 17) src/components/KnowledgeView.tsx:840— (anonymous) has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
src/store/state.ts: 2379 lines of code src/store/state.ts:1— src/store/state.ts has 2379 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/store/store.ts: 2003 lines of code src/store/store.ts:1— src/store/store.ts has 2003 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
electron/main.ts: 1791 lines of code electron/main.ts:1— electron/main.ts has 1791 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/components/ContextMenu.tsx · ×1
src/components/ContextMenu.tsx: 1738 lines of code src/components/ContextMenu.tsx:1— src/components/ContextMenu.tsx has 1738 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/components/ChatStream.tsx · ×1
src/components/ChatStream.tsx: 1625 lines of code src/components/ChatStream.tsx:1— src/components/ChatStream.tsx has 1625 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/contract/envelope.ts: 1354 lines of code src/contract/envelope.ts:1— src/contract/envelope.ts has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/components/KnowledgeView.tsx · ×1
src/components/KnowledgeView.tsx: 1209 lines of code src/components/KnowledgeView.tsx:1— src/components/KnowledgeView.tsx has 1209 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/store/settings.ts: 1029 lines of code src/store/settings.ts:1— src/store/settings.ts has 1029 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/components/ContactsView.tsx · ×1
src/components/ContactsView.tsx: 999 lines of code src/components/ContactsView.tsx:1— src/components/ContactsView.tsx has 999 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/components/TokenUsagePanel.tsx · ×1
src/components/TokenUsagePanel.tsx: 960 lines of code src/components/TokenUsagePanel.tsx:1— src/components/TokenUsagePanel.tsx has 960 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/transport/socket.ts: 924 lines of code src/transport/socket.ts:1— src/transport/socket.ts has 924 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/components/Composer.tsx · ×1
src/components/Composer.tsx: 835 lines of code src/components/Composer.tsx:1— src/components/Composer.tsx has 835 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/components/SettingsView.tsx · ×1
src/components/SettingsView.tsx: 784 lines of code src/components/SettingsView.tsx:1— src/components/SettingsView.tsx has 784 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/components/ApprovalCard.tsx · ×1
src/components/ApprovalCard.tsx: 705 lines of code src/components/ApprovalCard.tsx:1— src/components/ApprovalCard.tsx has 705 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/app/App.tsx: 651 lines of code src/app/App.tsx:1— src/app/App.tsx has 651 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/preview/renderers/PptxPreview.tsx · ×1
src/preview/renderers/PptxPreview.tsx: 611 lines of code src/preview/renderers/PptxPreview.tsx:1— src/preview/renderers/PptxPreview.tsx has 611 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/components/ConvList.tsx · ×1
src/components/ConvList.tsx: 583 lines of code src/components/ConvList.tsx:1— src/components/ConvList.tsx has 583 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/store/knowledge.ts: 569 lines of code src/store/knowledge.ts:1— src/store/knowledge.ts has 569 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/components/MessageBubble.tsx · ×1
src/components/MessageBubble.tsx: 563 lines of code src/components/MessageBubble.tsx:1— src/components/MessageBubble.tsx has 563 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/components/RecordsDrawer.tsx · ×1
src/components/RecordsDrawer.tsx: 518 lines of code src/components/RecordsDrawer.tsx:1— src/components/RecordsDrawer.tsx has 518 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/store/modelCatalog.ts: 491 lines of code src/store/modelCatalog.ts:1— src/store/modelCatalog.ts has 491 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/components/FavoritesView.tsx · ×1
src/components/FavoritesView.tsx: 454 lines of code src/components/FavoritesView.tsx:1— src/components/FavoritesView.tsx has 454 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/components/GlobalSearch.tsx · ×1
src/components/GlobalSearch.tsx: 439 lines of code src/components/GlobalSearch.tsx:1— src/components/GlobalSearch.tsx has 439 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/fakeserver/FakeKnoweServer.ts · ×1
src/fakeserver/FakeKnoweServer.ts: 427 lines of code src/fakeserver/FakeKnoweServer.ts:1— src/fakeserver/FakeKnoweServer.ts has 427 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/preview/PreviewApp.tsx: 425 lines of code src/preview/PreviewApp.tsx:1— src/preview/PreviewApp.tsx has 425 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/store/tokenUsage.ts: 425 lines of code src/store/tokenUsage.ts:1— src/store/tokenUsage.ts has 425 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/components/ModelBindingModule.tsx · ×1
src/components/ModelBindingModule.tsx: 423 lines of code src/components/ModelBindingModule.tsx:1— src/components/ModelBindingModule.tsx has 423 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 (~331 LoC) src/store/nameGenerator.ts— no import path from any entry point (17 application, 5 tooling, 34 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 (~92 LoC) src/store/agentParams.ts— no import path from any entry point (17 application, 5 tooling, 34 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 (~41 LoC) REDACTED— no import path from any entry point (17 application, 5 tooling, 34 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 (~10 LoC) src/test-setup.ts— no import path from any entry point (17 application, 5 tooling, 34 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
X1 · Async correctness· Task from `asyncio.ensure_future` is not kept · ×1
Task from `asyncio.ensure_future` is not kept backend/browser_tools.py:487— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×1
Untrusted text written into markup unescaped REDACTED:215— `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
X25 · Inert configuration knob· Option is kept and never read · ×1
Option is kept and never read src/transport/socket.ts:262— `createSocket` accepts `url` from the caller and keeps it in `url` on line 262, where only it can read the value — but nothing ever reads `url`. Setting `url` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `url` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `url` from the accepted options so callers stop setting a knob that does nothing.
Duplicated predicate src/store/messageCache.ts:54— `!parsed || parsed.schemaVersion !== SCHEMA_VERSION` appears character-identically in 2 files — src/store/messageCache.ts, src/store/sessionDirCache.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/store/projectAlias.ts:58— `!requestProjectId || requestProjectId === canonicalProjectId` appears character-identically in 2 files — src/store/projectAlias.ts, src/store/store.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 electron/previewNavigation.ts:149— `/^\d{1,3}$/.test(part) && Number(part) <= 255` appears character-identically in 2 files — electron/previewNavigation.ts, src/preview/renderers/MarkdownPreview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/App.tsx:140— `a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()` appears character-identically in 2 files — src/app/App.tsx, src/utils/messageTime.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/components/FileCard.tsx:53— `event.key !== 'Enter' && event.key !== ' '` appears character-identically in 2 files — src/components/FileCard.tsx, src/components/GlobalSearch.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/ContextMenu.tsx:1582— `event.key === 'Enter' || event.key === ' '` appears character-identically in 2 files — src/components/ContextMenu.tsx, src/preview/PreviewTabs.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/make-icon-icns.mjs:59— `existsSync(OUT) && existsSync(stampFile) && readFileSync(stampFile, 'utf8') === srcHash` appears character-identically in 2 files — scripts/make-icon-icns.mjs, scripts/make-icon-ico.mjs. 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 electron/previewNavigation.ts:143— `host === '0.0.0.0' || host.startsWith('::ffff:127.') || /^::ffff:7f[0-9a-f]{2}(?::|$)/.test(host)` appears character-identically in 2 files — electron/previewNavigation.ts, src/preview/renderers/MarkdownPreview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate electron/previewNavigation.ts:141— `host === 'localhost' || host.endsWith('.localhost') || host === '::1' || host === '::'` appears character-identically in 2 files — electron/previewNavigation.ts, src/preview/renderers/MarkdownPreview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/ChatStream.tsx:145— `it.kind === 'user' || it.kind === 'agent'` appears character-identically in 2 files — src/components/ChatStream.tsx, src/store/favorites.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/components/RecordsDrawer.tsx:47— `item.type === 'user_echo' || !item.agent_id` appears character-identically in 2 files — src/components/RecordsDrawer.tsx, src/store/records.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/components/ConvList.tsx:101— `m.status !== 'removed' && m.display.avatarUrl` appears character-identically in 2 files — src/components/ConvList.tsx, src/store/store.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/store/selectors.ts:81— `pid !== PLATFORM_PROJECT_ID && !parseDmId(pid)` appears character-identically in 2 files — src/store/selectors.ts, src/store/store.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/components/MessageBubble.tsx:402— `raf && typeof globalThis.cancelAnimationFrame === 'function'` appears character-identically in 2 files — src/components/MessageBubble.tsx, src/components/StreamBubble.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/preview/renderers/MarkdownPreview.tsx:57— `reason instanceof Error && reason.message` appears character-identically in 2 files — src/preview/renderers/MarkdownPreview.tsx, src/preview/renderers/PdfPreview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/ChatStream.tsx:1118— `s.convs[dmGroup]?.projectName || dmGroup` appears character-identically in 2 files — src/components/ChatStream.tsx, src/components/ConvList.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/RecordsDrawer.tsx:119— `typeof ts !== 'number' || !Number.isFinite(ts)` appears character-identically in 2 files — src/components/RecordsDrawer.tsx, src/store/records.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/store/completionProjection.ts:17— `typeof value === 'number' && Number.isFinite(value)` appears character-identically in 3 files — src/store/completionProjection.ts, src/store/settings.ts, src/store/tokenUsage.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 electron/previewNavigation.ts:131— `url.protocol !== 'http:' && url.protocol !== 'https:'` appears character-identically in 2 files — electron/previewNavigation.ts, src/preview/renderers/MarkdownPreview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:2084— `" ".join(str(exc).split()) or exc.__class__.__name__` appears character-identically in 3 files — REDACTED, backend/knowe_storage/_sqlite.py, backend/workspace_layout.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate backend/agents/zinnia.py:1126— `args.get("wait_until") or "domcontentloaded"` appears character-identically in 2 files — backend/agents/zinnia.py, backend/tools_knowe.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate backend/agents/zinnia.py:900— `aux and aux.get("api_key") and aux.get("base_url")` appears character-identically in 3 files — backend/agents/zinnia.py, REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate backend/knowledge_graph.py:776— `aux and aux.get("api_key") and aux.get("base_url") and aux.get("model")` appears character-identically in 3 files — backend/knowledge_graph.py, backend/memory_manager.py, backend/tools_knowe.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate backend/knowledge_graph.py:811— `data["choices"][0]["message"]["content"] or ""` appears character-identically in 2 files — backend/knowledge_graph.py, backend/memory_manager.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate backend/agents/knowe_agent.py:77— `event.get("type") == "usage" and isinstance(event.get("usage"), dict)` appears character-identically in 2 files — backend/agents/knowe_agent.py, backend/agents/zinnia.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch REDACTED:5541— `_knowledge_ctx_block` 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:7540— `_agent_memory_block` 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 backend/knowe_harness/completion.py:1980— `_scan_workspace_deltas` 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:752— `_pass_conflicts` 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 REDACTED:1009— `context_block` 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 backend/knowledge_graph.py:704— `brief` 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 scripts/write-build-manifest.mjs:13— `gitCommit` swallows every exception into `return 'unknown'` — 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 on parse failure REDACTED:672— `_parse_suggestions_json` returns `[]` when `(ValueError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure REDACTED:9574— `_supported_run_kwargs` returns `{}` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure backend/knowe_provenance/lineage.py:27— `_read_json` returns `{}` when `(TypeError, ValueError, json.JSONDecodeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure REDACTED:2128— `_safe_relative` returns `''` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure backend/memory_manager.py:1218— `_as_nonnegative_int` returns `0` when `(TypeError, ValueError, OverflowError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure REDACTED:350— `_ts_to_date` returns `''` when `(TypeError, ValueError, OverflowError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Fat interface: SocketAPI (19 required operations) src/transport/socket.ts:142— `SocketAPI` declares 19 required operations: `connect`, `disconnect`, `sendMessage`, `approve`, `reject`, `feedbackInstruction`, `stopWorker`, `createProject`, `addAgents`, `updateAgentProfile`, `setProjectDirectory`, `cancelProjectDirectory`, `requestSnapshot`, `requestHistory`, `sendCommand`, `noteIncremental`, `_debugReadyState`, `_getHandshakeBuffer`, `_getPendingEchoes`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: KnoweStore (60 required operations) src/store/store.ts:556— `KnoweStore` declares 60 required operations: `getConv`, `getActiveConv`, `switchProject`, `enterDm`, `exitDm`, `syncAllProjects`, `populateFromCache`, `removeCacheStaleProjects`, `buildSessionDirCache`, `markSessionDirDirty`, `setWindowFocused`, `markRead`, `reportRead`, `registerProject`, `getProjectList`, `syncConversationStates`, `setProjectPinned`, `setProjectMuted`, `setProjectFolded`, `renameProject`, `deleteProjectPermanently`, `deleteAgentPermanently`, `togglePinnedCollapsed`, `toggleFoldedOpen`, `handleEvent`, `applyIncrementalEvents`, `ackTransientFrame`, `setConnStatus`, `sendMessage`, `approve`, `reject`, `feedbackInstruction`, `stopWorker`, `createProject`, `addAgents`, `updateAgentProfile`, `setDraft`, `clearDraft`, `addAttachments`, `removeAttachment`, and 20 more. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: SettingsState (30 required operations) src/store/settings.ts:63— `SettingsState` declares 30 required operations: `setUserName`, `setAvatar`, `saveMainModel`, `editMainModel`, `saveAuxModel`, `editAuxModel`, `clearAuxModel`, `saveAgentModel`, `editAgentModel`, `clearAgentModel`, `addModelProfile`, `updateModelProfile`, `removeModelProfile`, `moveModelProfile`, `toggleProfilePool`, `setConnState`, `clearConnState`, `testAllConnections`, `setNotifyDesktop`, `setCloseToTray`, `setApprovalTimeout`, `setGroupApprovalTimeout`, `setAppearance`, `setFontScale`, `setLanguage`, `markModelBindingStale`, `clearRestartRequired`, `applyModelBinding`, `reconcileFromBackend`, `pushToBackend`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion backend/requirements.txt:1— `backend` (51685 LoC, 237 module-visible types across 8 directories) overshoots its size bounds. 2 of 2 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion package.json:1— `(repository root)` (38004 LoC, 280 module-visible types across 15 directories) overshoots its size bounds. 2 of 2 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Scattered collaborators — 70 % of calls cross a namespace and only 49 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation package.json:31— `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code· Unused export 'useZoomPanToolbar' · ×1
Unused export 'useZoomPanToolbar' src/components/ZoomPan.tsx:71— Nothing imports this binding — it is safe to review for removal.
Unused export 'stageLabel' src/store/toolPhrase.ts:221— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused module-local declaration 'UPDATER_CACHE_DIR_NAME' · ×1
Unused module-local declaration 'UPDATER_CACHE_DIR_NAME' electron/updater.ts:25— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'sha256Hex' · ×1
Unused module-local declaration 'sha256Hex' src/store/filePreview.ts:236— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Null assertions (`!`) override strict null checking — ~0.8 `!` null assertions per 1k TypeScript source lines — 33 assertion(s) across the 39986 source line(s) of the 115 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/components/ChatStream.tsx (12), electron/main.ts (5), src/components/TokenUsagePanel.tsx (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 1 file(s) — `src/store/selectors.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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 01a1eb23-d54e-7331-b8b9-45e29ca854f6 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 75 · Warnings: 950 · Recommendations: 88 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 20:12 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.