Public report of RightNow-AI/openfang, published 26 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 26 October 2026, 03:34 UTC · Survey ID cd_7f0e63f2d26e4a7ca2dc2533a19293cc
RightNow-AI/openfang
Measured 26 October 2026, 03:28 UTC, at code version acf2587
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAt riskDown 4 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 176,728 lines of product code in 18 projects, tests not counted · Estimated rebuild effort: about 1.1 person-years · Weakest lens: Code Health, 28
Findings by how serious they are
52 critical1534 serious111 minor
11 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 03:28 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
83of 83 dimensions measured by tools.
1640of 1697 findings point to an exact file and line, so you can open each one in the code. The other 57 concern the repository as a whole, such as missing documentation.
83dimensions across 8 lenses, read from 176,728 lines of product code in 18 projects.
RightNow-AI/openfang is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 42 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Code Health, at 28, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the password or key in the code, worth about 4 points. Adding type checking would lift Code Health itself, worth about 5 points. Raising Code Health to 67 would lift the score to about 54.
Twenty-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nine secrets can leak from the build pipeline, and four known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, limiting each secret to its own step and updating the vulnerable packages would close these risks. The three unsafe settings in infrastructure or container files need changing to safe values. The two pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions. The button or link with no name needs a name, even when it only shows an icon.
The product code is 176,728 lines, about €160,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 28 to 67, the lowest score rated Strong, the score would rise from 42 to about 54.
Code composition: what the lines of code are
Product code 97%Tests 3%
New since the last survey: 103 findings
These 103 critical or serious findings weren't in the previous survey, on 12 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Visual & motion safety · Focus outline removed in CSS without a :focus replacement crates/openfang-api/static/css/components.css
Visual & motion safety · Focus outline removed in CSS without a :focus replacement crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Visual & motion safety · Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 2 findings
These 2 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.
€52,000 to €260,000, for 867 to 2,750 hours of work, about 1.1 person-years for 1 to 3 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 42. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 176,728 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 4 points · Low effort · Secret Scanning
2
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 5 points · Medium effort · Type Safety
3
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 5 points · Medium effort · Large Files
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 €160,000 to build again, about 1.1 person-years of work. Its weakest lens is Code Health, at 28 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 269,605 lines over the last 90 days, which is about 1,093,398 lines a year. At that pace, the extra work comes to an estimated 144.6 to 867.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
252 modules, with 354 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 212 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.
openfang_extensions.registry uses openfang_extensions, so a change to openfang_extensions can break openfang_extensions.registry, while a change to openfang_extensions.registry can't break openfang_extensions.
Position
Below the diagonal: openfang_extensions.registry uses a module listed above it, which is the healthy direction.
openfang_extensions.registry uses openfang_types.config, so a change to openfang_types.config can break openfang_extensions.registry, while a change to openfang_extensions.registry can't break openfang_types.config.
Position
Below the diagonal: openfang_extensions.registry uses a module listed above it, which is the healthy direction.
openfang_runtime.browser uses openfang_types.config, so a change to openfang_types.config can break openfang_runtime.browser, while a change to openfang_runtime.browser can't break openfang_types.config.
Position
Below the diagonal: openfang_runtime.browser uses a module listed above it, which is the healthy direction.
openfang_runtime.mcp uses openfang_types.tool, so a change to openfang_types.tool can break openfang_runtime.mcp, while a change to openfang_runtime.mcp can't break openfang_types.tool.
Position
Below the diagonal: openfang_runtime.mcp uses a module listed above it, which is the healthy direction.
12→17 openfang_runtime.model_catalog uses openfang_cli.tui.screens.init_wizardpart of a loop✕
Connections
2 pairs of types, where a type in openfang_runtime.model_catalog uses a type in openfang_cli.tui.screens.init_wizard.
openfang_runtime.model_catalog uses openfang_cli.tui.screens.init_wizard, so a change to openfang_cli.tui.screens.init_wizard can break openfang_runtime.model_catalog, while a change to openfang_runtime.model_catalog can't break openfang_cli.tui.screens.init_wizard.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
openfang_runtime.web_search uses openfang_types.config, so a change to openfang_types.config can break openfang_runtime.web_search, while a change to openfang_runtime.web_search can't break openfang_types.config.
Position
Below the diagonal: openfang_runtime.web_search uses a module listed above it, which is the healthy direction.
openfang_types.agent uses openfang_types.config, so a change to openfang_types.config can break openfang_types.agent, while a change to openfang_types.agent can't break openfang_types.config.
Position
Below the diagonal: openfang_types.agent uses a module listed above it, which is the healthy direction.
openfang_types.agent uses openfang_types.tool, so a change to openfang_types.tool can break openfang_types.agent, while a change to openfang_types.agent can't break openfang_types.tool.
Position
Below the diagonal: openfang_types.agent uses a module listed above it, which is the healthy direction.
openfang_types.message uses openfang_cli.tui.screens.chat, so a change to openfang_cli.tui.screens.chat can break openfang_types.message, while a change to openfang_types.message can't break openfang_cli.tui.screens.chat.
Position
Below the diagonal: openfang_types.message uses a module listed above it, which is the healthy direction.
openfang_channels.types uses openfang_types.agent, so a change to openfang_types.agent can break openfang_channels.types, while a change to openfang_channels.types can't break openfang_types.agent.
Position
Below the diagonal: openfang_channels.types uses a module listed above it, which is the healthy direction.
openfang_cli.tui.screens.init_wizard uses openfang_cli.tui.screens.chat, so a change to openfang_cli.tui.screens.chat can break openfang_cli.tui.screens.init_wizard, while a change to openfang_cli.tui.screens.init_wizard can't break openfang_cli.tui.screens.chat.
Position
Below the diagonal: openfang_cli.tui.screens.init_wizard uses a module listed above it, which is the healthy direction.
openfang_cli.tui.screens.init_wizard uses openfang_migrate.openclaw, so a change to openfang_migrate.openclaw can break openfang_cli.tui.screens.init_wizard, while a change to openfang_cli.tui.screens.init_wizard can't break openfang_migrate.openclaw.
Position
Below the diagonal: openfang_cli.tui.screens.init_wizard uses a module listed above it, which is the healthy direction.
openfang_cli.tui.screens.init_wizard uses openfang_runtime.model_catalog, so a change to openfang_runtime.model_catalog can break openfang_cli.tui.screens.init_wizard, while a change to openfang_cli.tui.screens.init_wizard can't break openfang_runtime.model_catalog.
Position
Below the diagonal: openfang_cli.tui.screens.init_wizard uses a module listed above it, which is the healthy direction.
openfang_kernel.metering uses openfang_types.config, so a change to openfang_types.config can break openfang_kernel.metering, while a change to openfang_kernel.metering can't break openfang_types.config.
Position
Below the diagonal: openfang_kernel.metering uses a module listed above it, which is the healthy direction.
openfang_kernel.metering uses openfang_runtime.model_catalog, so a change to openfang_runtime.model_catalog can break openfang_kernel.metering, while a change to openfang_kernel.metering can't break openfang_runtime.model_catalog.
Position
Below the diagonal: openfang_kernel.metering uses a module listed above it, which is the healthy direction.
openfang_kernel.metering uses openfang_types.agent, so a change to openfang_types.agent can break openfang_kernel.metering, while a change to openfang_kernel.metering can't break openfang_types.agent.
Position
Below the diagonal: openfang_kernel.metering uses a module listed above it, which is the healthy direction.
openfang_kernel.registry uses openfang_cli.tui.screens.memory, so a change to openfang_cli.tui.screens.memory can break openfang_kernel.registry, while a change to openfang_kernel.registry can't break openfang_cli.tui.screens.memory.
Position
Below the diagonal: openfang_kernel.registry uses a module listed above it, which is the healthy direction.
openfang_kernel.registry uses openfang_types.agent, so a change to openfang_types.agent can break openfang_kernel.registry, while a change to openfang_kernel.registry can't break openfang_types.agent.
Position
Below the diagonal: openfang_kernel.registry uses a module listed above it, which is the healthy direction.
openfang_memory.session uses openfang_types.agent, so a change to openfang_types.agent can break openfang_memory.session, while a change to openfang_memory.session can't break openfang_types.agent.
Position
Below the diagonal: openfang_memory.session uses a module listed above it, which is the healthy direction.
openfang_memory.session uses openfang_types.message, so a change to openfang_types.message can break openfang_memory.session, while a change to openfang_memory.session can't break openfang_types.message.
Position
Below the diagonal: openfang_memory.session uses a module listed above it, which is the healthy direction.
openfang_runtime.llm_driver uses openfang_types.config, so a change to openfang_types.config can break openfang_runtime.llm_driver, while a change to openfang_runtime.llm_driver can't break openfang_types.config.
Position
Below the diagonal: openfang_runtime.llm_driver uses a module listed above it, which is the healthy direction.
openfang_runtime.llm_driver uses openfang_types.tool, so a change to openfang_types.tool can break openfang_runtime.llm_driver, while a change to openfang_runtime.llm_driver can't break openfang_types.tool.
Position
Below the diagonal: openfang_runtime.llm_driver uses a module listed above it, which is the healthy direction.
openfang_runtime.llm_driver uses openfang_types.message, so a change to openfang_types.message can break openfang_runtime.llm_driver, while a change to openfang_runtime.llm_driver can't break openfang_types.message.
Position
Below the diagonal: openfang_runtime.llm_driver uses a module listed above it, which is the healthy direction.
openfang_types.event uses openfang_types.agent, so a change to openfang_types.agent can break openfang_types.event, while a change to openfang_types.event can't break openfang_types.agent.
Position
Below the diagonal: openfang_types.event uses a module listed above it, which is the healthy direction.
openfang_types.memory uses openfang_types.agent, so a change to openfang_types.agent can break openfang_types.memory, while a change to openfang_types.memory can't break openfang_types.agent.
Position
Below the diagonal: openfang_types.memory uses a module listed above it, which is the healthy direction.
openfang_types.scheduler uses openfang_types.agent, so a change to openfang_types.agent can break openfang_types.scheduler, while a change to openfang_types.scheduler can't break openfang_types.agent.
Position
Below the diagonal: openfang_types.scheduler uses a module listed above it, which is the healthy direction.
openfang_channels.router uses openfang_types.config, so a change to openfang_types.config can break openfang_channels.router, while a change to openfang_channels.router can't break openfang_types.config.
Position
Below the diagonal: openfang_channels.router uses a module listed above it, which is the healthy direction.
openfang_channels.router uses openfang_types.agent, so a change to openfang_types.agent can break openfang_channels.router, while a change to openfang_channels.router can't break openfang_types.agent.
Position
Below the diagonal: openfang_channels.router uses a module listed above it, which is the healthy direction.
openfang_channels.router uses openfang_channels.types, so a change to openfang_channels.types can break openfang_channels.router, while a change to openfang_channels.router can't break openfang_channels.types.
Position
Below the diagonal: openfang_channels.router uses a module listed above it, which is the healthy direction.
openfang_kernel.triggers uses openfang_types.agent, so a change to openfang_types.agent can break openfang_kernel.triggers, while a change to openfang_kernel.triggers can't break openfang_types.agent.
Position
Below the diagonal: openfang_kernel.triggers uses a module listed above it, which is the healthy direction.
openfang_kernel.triggers uses openfang_types.event, so a change to openfang_types.event can break openfang_kernel.triggers, while a change to openfang_kernel.triggers can't break openfang_types.event.
Position
Below the diagonal: openfang_kernel.triggers uses a module listed above it, which is the healthy direction.
openfang_memory.semantic uses openfang_types.agent, so a change to openfang_types.agent can break openfang_memory.semantic, while a change to openfang_memory.semantic can't break openfang_types.agent.
Position
Below the diagonal: openfang_memory.semantic uses a module listed above it, which is the healthy direction.
openfang_memory.semantic uses openfang_types.memory, so a change to openfang_types.memory can break openfang_memory.semantic, while a change to openfang_memory.semantic can't break openfang_types.memory.
Position
Below the diagonal: openfang_memory.semantic uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_runtime.media_understanding, so a change to openfang_runtime.media_understanding can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_runtime.media_understanding.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_types.config, so a change to openfang_types.config can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_types.config.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_types.tool, so a change to openfang_types.tool can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_types.tool.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_runtime.browser, so a change to openfang_runtime.browser can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_runtime.browser.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_runtime.mcp, so a change to openfang_runtime.mcp can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_runtime.mcp.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_runtime.web_search, so a change to openfang_runtime.web_search can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_runtime.web_search.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_runtime.tool_runner uses openfang_types.memory, so a change to openfang_types.memory can break openfang_runtime.tool_runner, while a change to openfang_runtime.tool_runner can't break openfang_types.memory.
Position
Below the diagonal: openfang_runtime.tool_runner uses a module listed above it, which is the healthy direction.
openfang_channels.bridge uses openfang_types.config, so a change to openfang_types.config can break openfang_channels.bridge, while a change to openfang_channels.bridge can't break openfang_types.config.
Position
Below the diagonal: openfang_channels.bridge uses a module listed above it, which is the healthy direction.
openfang_channels.bridge uses openfang_types.agent, so a change to openfang_types.agent can break openfang_channels.bridge, while a change to openfang_channels.bridge can't break openfang_types.agent.
Position
Below the diagonal: openfang_channels.bridge uses a module listed above it, which is the healthy direction.
openfang_channels.bridge uses openfang_types.message, so a change to openfang_types.message can break openfang_channels.bridge, while a change to openfang_channels.bridge can't break openfang_types.message.
Position
Below the diagonal: openfang_channels.bridge uses a module listed above it, which is the healthy direction.
openfang_channels.bridge uses openfang_channels.types, so a change to openfang_channels.types can break openfang_channels.bridge, while a change to openfang_channels.bridge can't break openfang_channels.types.
Position
Below the diagonal: openfang_channels.bridge uses a module listed above it, which is the healthy direction.
openfang_channels.bridge uses openfang_channels.router, so a change to openfang_channels.router can break openfang_channels.bridge, while a change to openfang_channels.bridge can't break openfang_channels.router.
Position
Below the diagonal: openfang_channels.bridge uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_cli.tui.screens.memory, so a change to openfang_cli.tui.screens.memory can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_cli.tui.screens.memory.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_types.config, so a change to openfang_types.config can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_types.config.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_types.agent, so a change to openfang_types.agent can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_types.agent.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_types.message, so a change to openfang_types.message can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_types.message.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_memory.session, so a change to openfang_memory.session can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_memory.session.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_types.memory, so a change to openfang_types.memory can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_types.memory.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_memory.substrate uses openfang_memory.semantic, so a change to openfang_memory.semantic can break openfang_memory.substrate, while a change to openfang_memory.substrate can't break openfang_memory.semantic.
Position
Below the diagonal: openfang_memory.substrate uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_cli.tui.screens.memory, so a change to openfang_cli.tui.screens.memory can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_cli.tui.screens.memory.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_runtime.media_understanding, so a change to openfang_runtime.media_understanding can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_runtime.media_understanding.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.config, so a change to openfang_types.config can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.config.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.tool, so a change to openfang_types.tool can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.tool.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_extensions.registry, so a change to openfang_extensions.registry can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_extensions.registry.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_runtime.browser, so a change to openfang_runtime.browser can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_runtime.browser.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_runtime.mcp, so a change to openfang_runtime.mcp can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_runtime.mcp.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_runtime.model_catalog, so a change to openfang_runtime.model_catalog can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_runtime.model_catalog.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_runtime.web_search, so a change to openfang_runtime.web_search can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_runtime.web_search.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.agent, so a change to openfang_types.agent can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.agent.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.message, so a change to openfang_types.message can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.message.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_channels.types, so a change to openfang_channels.types can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_channels.types.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_kernel.metering, so a change to openfang_kernel.metering can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_kernel.metering.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_kernel.registry, so a change to openfang_kernel.registry can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_kernel.registry.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_memory.session, so a change to openfang_memory.session can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_memory.session.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_runtime.llm_driver, so a change to openfang_runtime.llm_driver can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_runtime.llm_driver.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.event, so a change to openfang_types.event can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.event.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.memory, so a change to openfang_types.memory can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.memory.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_types.scheduler, so a change to openfang_types.scheduler can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_types.scheduler.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_kernel.triggers, so a change to openfang_kernel.triggers can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_kernel.triggers.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_channels.bridge, so a change to openfang_channels.bridge can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_channels.bridge.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_kernel.kernel uses openfang_memory.substrate, so a change to openfang_memory.substrate can break openfang_kernel.kernel, while a change to openfang_kernel.kernel can't break openfang_memory.substrate.
Position
Below the diagonal: openfang_kernel.kernel uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_runtime.media_understanding, so a change to openfang_runtime.media_understanding can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_runtime.media_understanding.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_types.config, so a change to openfang_types.config can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_types.config.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_types.tool, so a change to openfang_types.tool can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_types.tool.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_runtime.browser, so a change to openfang_runtime.browser can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_runtime.browser.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_runtime.mcp, so a change to openfang_runtime.mcp can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_runtime.mcp.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_runtime.web_search, so a change to openfang_runtime.web_search can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_runtime.web_search.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_types.agent, so a change to openfang_types.agent can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_types.agent.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_types.message, so a change to openfang_types.message can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_types.message.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_memory.session, so a change to openfang_memory.session can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_memory.session.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_runtime.llm_driver, so a change to openfang_runtime.llm_driver can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_runtime.llm_driver.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_runtime.agent_loop uses openfang_memory.substrate, so a change to openfang_memory.substrate can break openfang_runtime.agent_loop, while a change to openfang_runtime.agent_loop can't break openfang_memory.substrate.
Position
Below the diagonal: openfang_runtime.agent_loop uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_skills, so a change to openfang_skills can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_skills.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_types.config, so a change to openfang_types.config can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_types.config.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_types.agent, so a change to openfang_types.agent can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_types.agent.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_types.message, so a change to openfang_types.message can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_types.message.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_cli.tui.screens.init_wizard, so a change to openfang_cli.tui.screens.init_wizard can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_cli.tui.screens.init_wizard.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_types.event, so a change to openfang_types.event can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_types.event.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_types.scheduler, so a change to openfang_types.scheduler can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_types.scheduler.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_channels.bridge, so a change to openfang_channels.bridge can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_channels.bridge.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_api.routes uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_api.routes, while a change to openfang_api.routes can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_api.routes uses a module listed above it, which is the healthy direction.
openfang_cli.tui.event uses openfang_types.agent, so a change to openfang_types.agent can break openfang_cli.tui.event, while a change to openfang_cli.tui.event can't break openfang_types.agent.
Position
Below the diagonal: openfang_cli.tui.event uses a module listed above it, which is the healthy direction.
openfang_cli.tui.event uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_cli.tui.event, while a change to openfang_cli.tui.event can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_cli.tui.event uses a module listed above it, which is the healthy direction.
openfang_cli.tui.screens.agents uses openfang_types.agent, so a change to openfang_types.agent can break openfang_cli.tui.screens.agents, while a change to openfang_cli.tui.screens.agents can't break openfang_types.agent.
Position
Below the diagonal: openfang_cli.tui.screens.agents uses a module listed above it, which is the healthy direction.
openfang_cli.tui.screens.agents uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_cli.tui.screens.agents, while a change to openfang_cli.tui.screens.agents can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_cli.tui.screens.agents uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_types.config, so a change to openfang_types.config can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_types.config.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_types.agent, so a change to openfang_types.agent can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_types.agent.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_types.message, so a change to openfang_types.message can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_types.message.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_kernel.triggers, so a change to openfang_kernel.triggers can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_kernel.triggers.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_channels.bridge, so a change to openfang_channels.bridge can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_channels.bridge.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.channel_bridge uses openfang_api.routes, so a change to openfang_api.routes can break openfang_api.channel_bridge, while a change to openfang_api.channel_bridge can't break openfang_api.routes.
Position
Below the diagonal: openfang_api.channel_bridge uses a module listed above it, which is the healthy direction.
openfang_api.openai_compat uses openfang_types.agent, so a change to openfang_types.agent can break openfang_api.openai_compat, while a change to openfang_api.openai_compat can't break openfang_types.agent.
Position
Below the diagonal: openfang_api.openai_compat uses a module listed above it, which is the healthy direction.
openfang_api.openai_compat uses openfang_types.message, so a change to openfang_types.message can break openfang_api.openai_compat, while a change to openfang_api.openai_compat can't break openfang_types.message.
Position
Below the diagonal: openfang_api.openai_compat uses a module listed above it, which is the healthy direction.
openfang_api.openai_compat uses openfang_cli.tui.screens.init_wizard, so a change to openfang_cli.tui.screens.init_wizard can break openfang_api.openai_compat, while a change to openfang_api.openai_compat can't break openfang_cli.tui.screens.init_wizard.
Position
Below the diagonal: openfang_api.openai_compat uses a module listed above it, which is the healthy direction.
openfang_api.openai_compat uses openfang_api.routes, so a change to openfang_api.routes can break openfang_api.openai_compat, while a change to openfang_api.openai_compat can't break openfang_api.routes.
Position
Below the diagonal: openfang_api.openai_compat uses a module listed above it, which is the healthy direction.
openfang_api.ws uses openfang_types.agent, so a change to openfang_types.agent can break openfang_api.ws, while a change to openfang_api.ws can't break openfang_types.agent.
Position
Below the diagonal: openfang_api.ws uses a module listed above it, which is the healthy direction.
openfang_api.ws uses openfang_cli.tui.screens.init_wizard, so a change to openfang_cli.tui.screens.init_wizard can break openfang_api.ws, while a change to openfang_api.ws can't break openfang_cli.tui.screens.init_wizard.
Position
Below the diagonal: openfang_api.ws uses a module listed above it, which is the healthy direction.
openfang_api.ws uses openfang_runtime.llm_driver, so a change to openfang_runtime.llm_driver can break openfang_api.ws, while a change to openfang_api.ws can't break openfang_runtime.llm_driver.
Position
Below the diagonal: openfang_api.ws uses a module listed above it, which is the healthy direction.
openfang_api.ws uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_api.ws, while a change to openfang_api.ws can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_api.ws uses a module listed above it, which is the healthy direction.
openfang_api.ws uses openfang_api.routes, so a change to openfang_api.routes can break openfang_api.ws, while a change to openfang_api.ws can't break openfang_api.routes.
Position
Below the diagonal: openfang_api.ws uses a module listed above it, which is the healthy direction.
openfang_cli.tui.chat_runner uses openfang_cli.tui.screens.chat, so a change to openfang_cli.tui.screens.chat can break openfang_cli.tui.chat_runner, while a change to openfang_cli.tui.chat_runner can't break openfang_cli.tui.screens.chat.
Position
Below the diagonal: openfang_cli.tui.chat_runner uses a module listed above it, which is the healthy direction.
openfang_cli.tui.chat_runner uses openfang_types.agent, so a change to openfang_types.agent can break openfang_cli.tui.chat_runner, while a change to openfang_cli.tui.chat_runner can't break openfang_types.agent.
Position
Below the diagonal: openfang_cli.tui.chat_runner uses a module listed above it, which is the healthy direction.
openfang_cli.tui.chat_runner uses openfang_runtime.llm_driver, so a change to openfang_runtime.llm_driver can break openfang_cli.tui.chat_runner, while a change to openfang_cli.tui.chat_runner can't break openfang_runtime.llm_driver.
Position
Below the diagonal: openfang_cli.tui.chat_runner uses a module listed above it, which is the healthy direction.
openfang_cli.tui.chat_runner uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_cli.tui.chat_runner, while a change to openfang_cli.tui.chat_runner can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_cli.tui.chat_runner uses a module listed above it, which is the healthy direction.
openfang_cli.tui.chat_runner uses openfang_cli.tui.event, so a change to openfang_cli.tui.event can break openfang_cli.tui.chat_runner, while a change to openfang_cli.tui.chat_runner can't break openfang_cli.tui.event.
Position
Below the diagonal: openfang_cli.tui.chat_runner uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_cli.tui.screens.chat, so a change to openfang_cli.tui.screens.chat can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_cli.tui.screens.chat.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_cli.tui.screens.memory, so a change to openfang_cli.tui.screens.memory can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_cli.tui.screens.memory.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_types.agent, so a change to openfang_types.agent can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_types.agent.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_runtime.llm_driver, so a change to openfang_runtime.llm_driver can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_runtime.llm_driver.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_kernel.kernel, so a change to openfang_kernel.kernel can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_kernel.kernel.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_cli.tui.event, so a change to openfang_cli.tui.event can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_cli.tui.event.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_cli.tui.screens.agents, so a change to openfang_cli.tui.screens.agents can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_cli.tui.screens.agents.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
openfang_cli.tui uses openfang_cli.tui.chat_runner, so a change to openfang_cli.tui.chat_runner can break openfang_cli.tui, while a change to openfang_cli.tui can't break openfang_cli.tui.chat_runner.
Position
Below the diagonal: openfang_cli.tui uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 28% · Weak · gated by D1, D2, R1, R3, X4 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
48
High / Critical
A03:2025 — Software Supply Chain Failures
37
High / Critical
A02:2025 — Security Misconfiguration
7
High / Critical
A07:2025 — Authentication Failures
1
High / Critical
Roadmap
First, establish type safety by integrating a TypeScript check into the build process and converting high-traffic modules. Next, improve maintainability by splitting large files into smaller, focused modules and resolving the identified secret leak. Finally, ensure dependency hygiene by updating outdated packages and enforce visual accessibility standards by fixing focus styles, animations, and color contrast.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
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.
Bring the 45 bodies over 60 down to 60 or less in Cognitive Complexity — start with openfang_cli::cmd_doctor (cognitive 582), openfang_cli::tui::screens::init_wizard::run (cognitive 281), OpenAIDriver::stream (cognitive 273).
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 — 52
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 — 1534
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 — 111
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 11
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 83 of 83 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 83 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, 1640 of 1697 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.rs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 209 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check'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.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker-compose.yml). compose up failed (exit 17 — an image could not be built) — failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1": Forbidden; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). 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.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 583 further occurrence(s) are not listed individually; the score already reflects all 623.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
203 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was openfang_cli::cmd_doctor at 189. A further 18 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being openfang_runtime::prompt_builder::tool_hint at 47 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/openfang-api/src/rate_limiter.rs (openfang_api::rate_limiter::operation_cost at 26), crates/openfang-types/src/capability.rs (openfang_types::capability::capability_matches at 23), crates/openfang-kernel/src/triggers.rs (openfang_kernel::triggers::describe_event at 20), crates/openfang-types/src/tool_compat.rs (openfang_types::tool_compat::map_tool_name at 20). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 112 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with openfang_cli::cmd_doctor (cyclomatic 189), chat.chatPage.handleWsMessage (cyclomatic 123), chatPage.handleWsMessage (cyclomatic 123). — 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 3 together lifts Cyclomatic Complexity from 3.2 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 139 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 45 bodies over 60 down to 60 or less in Cognitive Complexity — start with openfang_cli::cmd_doctor (cognitive 582), openfang_cli::tui::screens::init_wizard::run (cognitive 281), OpenAIDriver::stream (cognitive 273). — 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 45 together lifts Cognitive Complexity from 2.0 to about 3.8/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.2 / 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 66 FunctionTooLong finding(s) in God Classes — start with routes.rs (8), main.rs (4), init_wizard.rs (4). — One of this dimension's main actionable groups (66 warning-level).
Resolve the 34 FileTooLong finding(s) in God Classes — start with routes.rs, kernel.rs, main.rs. — One of this dimension's main actionable groups (34 warning-level).
Resolve the 28 MethodTooLong finding(s) in God Classes — start with kernel.rs (11), mod.rs (3), openai.rs (2). — One of this dimension's main actionable groups (28 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
531 duplicated block group(s) detected. A further 33 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 163 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 34 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with routes.rs (3), discourse.rs (2), chat_runner.rs (2). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 34 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with routes.rs (5), main.rs (3), launcher.rs (2). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 31 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with routes.rs (5), init_wizard.rs (3), line.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.5 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
17 production modules (Cargo+npm+Python), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 4 module(s) off the main sequence, with abstractness counted on 14 of the 17 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: openfang-types · ×4
Unstable project openfang-api
What to do
Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Unstable project openfang-api finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with substrate.rs, kernel.rs. — One of this dimension's main actionable groups (2 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
2700 test methods: 2608 unit, 90 integration, 0 BDD, 2 e2e. The Rust suite contributes 2698 `#[test]` function(s) across 209 file(s) declaring at least one; its unit/integration split is Cargo's own — 13 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 2 test function(s) across 1 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
34 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: anyhow · ×34
What to do
Improve Dependency Hygiene — currently 8.3/10. — 34 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
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 843 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under Apache-2.0 OR MIT, which is its own choice and is not judged here.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: crates/openfang-kernel/src/kernel.rs (120×96=11520); crates/openfang-cli/src/main.rs (42×189=7938); crates/openfang-types/src/config.rs (43×94=4042) Repeated repair below the complexity floor: crates/openfang-types/src/model_catalog.rs (11 of 17 changes were fixes); crates/openfang-runtime/src/mcp.rs (11 of 14 changes were fixes); crates/openfang-kernel/src/cron.rs (7 of 13 changes were fixes)
Resolve the 53 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (2), kernel.rs, main.rs. — One of this dimension's main actionable groups (53 warning-level).
Resolve the 18 Repeated repair finding(s) in Churn × Complexity Hotspots — start with model_catalog.rs, mcp.rs, cron.rs. — One of this dimension's main actionable groups (18 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.8 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
27 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/openfang-cli/src/tui/event.rs. Counted over 235 of the 251 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_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.
3 deducted task-comment markers across 176728 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.
Resolve the 3 TodoComment finding(s) in Explicit Debt — start with hands.rs (2), config.rs. — One of this dimension's main actionable groups (3 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
1 of 1 documentation facets pass in full. 19 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
3 of 18 build units (Cargo, Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: 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).
48 finding(s): 0 critical, 43 high, 1 medium, 4 low. 28 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 1 file(s) — `crates/openfang-api/static/index_body.html` (line 863) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 28 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (28 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 warning-level).
Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 235 of the 251 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 9 Change coupling finding(s) in Change Coupling — start with anthropic.rs (2), metering.rs (2), main.rs. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 6 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ 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.
AC2 · Forms & labels3.5 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. — crates/openfang-api/static/js/app.js:63
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".
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.
`.model-switcher-search 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. — crates/openfang-api/static/css/components.css:1008
`.search-input 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. — crates/openfang-api/static/css/components.css:1187
`.card` moves (`transition: border-color var(--transition-fast), transform 0.2s var(--ease-spring), box-shadow var(--transition-fast)`) 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. — crates/openfang-api/static/css/components.css:49
`.modal` moves (`animation: scaleIn 0.2s var(--ease-spring)`) 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. — crates/openfang-api/static/css/components.css:257
`.message` moves (`animation: slideUp 0.25s var(--ease-smooth)`) 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. — crates/openfang-api/static/css/components.css:304
`.typing-dots span` moves (`animation: typing-bounce 1.4s ease-in-out 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. — crates/openfang-api/static/css/components.css:461
`.tool-card` moves (`animation: slideUp 0.2s var(--ease-smooth)`) 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. — crates/openfang-api/static/css/components.css:688
`.tool-card-spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/openfang-api/static/css/components.css:751
`.tool-card-body` moves (`animation: slideDown 0.15s var(--ease-smooth)`) 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. — crates/openfang-api/static/css/components.css:783
`.model-switcher-chevron` moves (`transition: transform 0.2s`) 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. — crates/openfang-api/static/css/components.css:969
`.spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/openfang-api/static/css/components.css:1137
`.toggle::after` moves (`transition: transform 0.2s`) 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. — crates/openfang-api/static/css/components.css:1162
`.stat-card` moves (`transition: transform 0.2s var(--ease-spring), box-shadow var(--transition-fast), border-color var(--transition-fast)`) 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. — crates/openfang-api/static/css/components.css:1239
`.stat-card-lg` moves (`transition: transform 0.3s var(--ease-spring), box-shadow var(--transition-fast)`) 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. — crates/openfang-api/static/css/components.css:1571
`.live-indicator.live .live-dot` moves (`animation: live-pulse 1.5s ease-in-out 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. — crates/openfang-api/static/css/components.css:1661
`.toast` moves (`animation: toastIn 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. — crates/openfang-api/static/css/components.css:1729
`.toast-dismiss` moves (`animation: toastOut 0.3s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/openfang-api/static/css/components.css:1742
`.wizard-progress-line-fill` moves (`transition: width 0.4s 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. — crates/openfang-api/static/css/components.css:2307
`.page-body` moves (`animation: slideIn 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/openfang-api/static/css/components.css:2365
`.skeleton` moves (`animation: shimmer 1.5s ease-in-out 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. — crates/openfang-api/static/css/components.css:2372
`.message-image` moves (`transition: transform 0.15s`) 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. — crates/openfang-api/static/css/components.css:2464
`.progress-bar-fill` moves (`transition: width 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. — crates/openfang-api/static/css/components.css:2486
`.skeleton-stat` moves (`animation: shimmer 1.5s ease-in-out 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. — crates/openfang-api/static/css/components.css:2685
`.skeleton-table` moves (`animation: shimmer 1.5s ease-in-out 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. — crates/openfang-api/static/css/components.css:2686
`.dep-progress-fill` moves (`transition: width 0.4s 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. — crates/openfang-api/static/css/components.css:3002
`.spinner-sm` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/openfang-api/static/css/components.css:3045
`.confidence-bar` moves (`transition: width 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. — crates/openfang-api/static/css/components.css:3417
`.sidebar-logo img` moves (`transition: opacity 0.2s, transform 0.2s`) 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. — crates/openfang-api/static/css/layout.css:55
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 16 of 16 project(s) that lack one — worth up to 2 pts.
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 README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
594/779 types (76%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
What to do
Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
Do you agree with this assessment?
P2 · Observability7.4 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 13/16 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `agents/langchain-code-reviewer`, `sdk/python`, `xtask`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Dependabot is configured but does not watch `npm`, `pip` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×33) — crates/openfang-channels/src/bluesky.rs:86, crates/openfang-channels/src/dingtalk.rs:55, crates/openfang-channels/src/dingtalk_stream.rs:50, …
`reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/openfang-runtime/src/browser.rs:375
`reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/openfang-skills/src/marketplace.rs:40
`urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — REDACTED:72, REDACTED:90
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.existsSync` in `ev.on("connection.update")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/whatsapp-gateway/index.js:92
`fs.rmSync` in `ev.on("connection.update")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/whatsapp-gateway/index.js:93
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 24 plain JS — the untyped files are crates/openfang-api/static/i18n/i18n.js, crates/openfang-api/static/js/api.js, crates/openfang-api/static/js/app.js, crates/openfang-api/static/js/katex.js, crates/openfang-api/static/js/pages/agents.js, crates/openfang-api/static/js/pages/approvals.js (+18 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
crates/openfang-api/static/js/pages/usage.js:189 · crates/openfang-api/static/js/pages/usage.js:243 — 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. — crates/openfang-api/static/js/pages/usage.js:189
crates/openfang-api/static/js/pages/agents.js:376 · crates/openfang-api/static/js/pages/chat.js:1199 — the two spans are one implementation copied and then locally edited — 66 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. — crates/openfang-api/static/js/pages/agents.js:376
crates/openfang-api/static/js/pages/overview.js:14 · crates/openfang-api/static/js/pages/settings.js:162 — 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. — crates/openfang-api/static/js/pages/overview.js:14
crates/openfang-api/static/js/pages/skills.js:300 · crates/openfang-api/static/js/pages/skills.js:331 — the two spans are one implementation copied and then locally edited — 78 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. — crates/openfang-api/static/js/pages/skills.js:300
sdk/javascript/index.js:425 · sdk/javascript/index.js:447 — 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. — sdk/javascript/index.js:425
crates/openfang-api/static/js/pages/agents.js:675 · crates/openfang-api/static/js/pages/agents.js:696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/openfang-api/static/js/pages/agents.js:675
crates/openfang-api/static/js/pages/chat.js:976 · crates/openfang-api/static/js/pages/chat.js:995 — 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. — crates/openfang-api/static/js/pages/chat.js:976
crates/openfang-api/static/js/pages/agents.js:181 · crates/openfang-api/static/js/pages/channels.js:46 — the two spans are one implementation copied and then locally edited — 66 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. — crates/openfang-api/static/js/pages/agents.js:181
crates/openfang-api/static/js/pages/hands.js:174 · crates/openfang-api/static/js/pages/hands.js:232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/openfang-api/static/js/pages/hands.js:174
crates/openfang-api/static/js/pages/sessions.js:98 · crates/openfang-api/static/js/pages/sessions.js:142 — the two spans are one implementation copied and then locally edited — 100 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. — crates/openfang-api/static/js/pages/sessions.js:98
crates/openfang-api/static/js/pages/agents.js:753 · crates/openfang-api/static/js/pages/agents.js:767 — 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. — crates/openfang-api/static/js/pages/agents.js:753
crates/openfang-api/static/js/pages/settings.js:708 · crates/openfang-api/static/js/pages/skills.js:95 — 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. — crates/openfang-api/static/js/pages/settings.js:708
crates/openfang-api/static/js/pages/usage.js:26 · crates/openfang-api/static/js/pages/workflows.js:20 — the two spans are one implementation copied and then locally edited — 51 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. — crates/openfang-api/static/js/pages/usage.js:26
crates/openfang-api/static/js/app.js:29 · crates/openfang-api/static/js/app.js:41 — 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. — crates/openfang-api/static/js/app.js:29
crates/openfang-api/static/js/pages/agents.js:794 · crates/openfang-api/static/js/pages/wizard.js:511 — 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. — crates/openfang-api/static/js/pages/agents.js:794
crates/openfang-api/static/js/pages/approvals.js:70 · crates/openfang-api/static/js/pages/comms.js:143 — 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. — crates/openfang-api/static/js/pages/approvals.js:70
sdk/javascript/index.js:54 · sdk/javascript/index.js:74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/javascript/index.js:54
crates/openfang-api/static/js/pages/agents.js:9 · crates/openfang-api/static/js/pages/wizard.js:6 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/openfang-api/static/js/pages/agents.js:9
crates/openfang-api/static/js/pages/approvals.js:35 · crates/openfang-api/static/js/pages/hands.js:39 — 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. — crates/openfang-api/static/js/pages/approvals.js:35
crates/openfang-api/static/js/pages/chat.js:504 · crates/openfang-api/static/js/pages/chat.js:518 — 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. — crates/openfang-api/static/js/pages/chat.js:504
crates/openfang-api/static/js/pages/hands.js:362 · crates/openfang-api/static/js/pages/hands.js:398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/openfang-api/static/js/pages/hands.js:362
crates/openfang-api/static/js/pages/overview.js:215 · crates/openfang-api/static/js/pages/usage.js:78 — 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. — crates/openfang-api/static/js/pages/overview.js:215
crates/openfang-api/static/js/pages/wizard.js:361 · crates/openfang-api/static/js/pages/wizard.js:562 — 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. — crates/openfang-api/static/js/pages/wizard.js:361
sdk/javascript/index.js:145 · sdk/javascript/index.js:369 — 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. — sdk/javascript/index.js:145
crates/openfang-api/static/js/pages/channels.js:85 · crates/openfang-api/static/js/pages/settings.js:708 · crates/openfang-api/static/js/pages/skills.js:95 — 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. — crates/openfang-api/static/js/pages/channels.js:85
crates/openfang-api/static/js/pages/chat.js:832 · crates/openfang-api/static/js/pages/chat.js:873 — 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. — crates/openfang-api/static/js/pages/chat.js:832
crates/openfang-api/static/js/pages/chat.js:872 · crates/openfang-api/static/js/pages/chat.js:883 — 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. — crates/openfang-api/static/js/pages/chat.js:872
crates/openfang-api/static/js/pages/hands.js:494 · crates/openfang-api/static/js/pages/settings.js:482 — 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. — crates/openfang-api/static/js/pages/hands.js:494
crates/openfang-api/static/js/pages/agents.js:199 · crates/openfang-api/static/js/pages/settings.js:415 — 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. — crates/openfang-api/static/js/pages/agents.js:199
crates/openfang-api/static/js/pages/chat.js:886 · crates/openfang-api/static/js/pages/chat.js:901 — 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. — crates/openfang-api/static/js/pages/chat.js:886
crates/openfang-api/static/js/pages/comms.js:148 · crates/openfang-api/static/js/pages/overview.js:236 — 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. — crates/openfang-api/static/js/pages/comms.js:148
crates/openfang-api/static/js/pages/settings.js:331 · crates/openfang-api/static/js/pages/settings.js:415 — 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. — crates/openfang-api/static/js/pages/settings.js:331
REDACTED:149 · REDACTED:162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:149
REDACTED:438 · REDACTED:449 — the two spans are one implementation copied and then locally edited — 112 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:438
crates/openfang-api/static/js/pages/chat.js:574 · crates/openfang-api/static/js/pages/chat.js:582 — 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. — crates/openfang-api/static/js/pages/chat.js:574
REDACTED:478 · REDACTED:544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:478
crates/openfang-api/static/js/pages/workflows.js:35 · crates/openfang-api/static/js/pages/workflows.js:118 — 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. — crates/openfang-api/static/js/pages/workflows.js:35
crates/openfang-api/static/js/pages/approvals.js:76 · crates/openfang-api/static/js/pages/comms.js:149 · crates/openfang-api/static/js/pages/overview.js:237 · crates/openfang-api/static/js/pages/scheduler.js:620 — the 4 copies are spread across 4 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. — crates/openfang-api/static/js/pages/approvals.js:76
crates/openfang-api/static/js/pages/channels.js:183 · crates/openfang-api/static/js/pages/hands.js:546 — 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. — crates/openfang-api/static/js/pages/channels.js:183
crates/openfang-api/static/js/pages/logs.js:216 · crates/openfang-api/static/js/pages/overview.js:285 — 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. — crates/openfang-api/static/js/pages/logs.js:216
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
handleWsMessage has cyclomatic complexity 110 and cognitive complexity 198; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/chat.js:747
executeSlashCommand has cyclomatic complexity 54 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/chat.js:439
_renderCharts has cyclomatic complexity 35 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/hands.js:740
generateToml has cyclomatic complexity 33 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. — REDACTED:472
renderCanvas has cyclomatic complexity 29 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. — REDACTED:75
(anonymous) has cyclomatic complexity 27 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — packages/whatsapp-gateway/index.js:119
_applyKvToData has cyclomatic complexity 27 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. — crates/openfang-api/static/js/pages/hands.js:690
describeCron has cyclomatic complexity 26 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/scheduler.js:529
_extractProvider has cyclomatic complexity 22 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. — crates/openfang-api/static/js/pages/usage.js:149
toolIcon has cyclomatic complexity 21 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 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. — crates/openfang-api/static/js/app.js:81
categories 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. — crates/openfang-api/static/js/pages/skills.js:48
validateTarget has cyclomatic complexity 19 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. — crates/openfang-api/static/js/pages/scheduler.js:313
createAgent has cyclomatic complexity 18 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. — crates/openfang-api/static/js/pages/wizard.js:492
(anonymous) has cyclomatic complexity 18 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 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. — packages/whatsapp-gateway/index.js:275
suggestedMessages has cyclomatic complexity 17 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. — crates/openfang-api/static/js/pages/wizard.js:179
getInstallCmd has cyclomatic complexity 17 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/hands.js:254
modelTier has cyclomatic complexity 17 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/usage.js:304
sendMessage has cyclomatic complexity 16 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. — crates/openfang-api/static/js/pages/chat.js:1071
_fetchDashboardData has cyclomatic complexity 16 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 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. — crates/openfang-api/static/js/pages/hands.js:620
loadData has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — crates/openfang-api/static/js/pages/runtime.js:18
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
crates/openfang-api/static/js/pages/chat.js has 1346 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/chat.js:1
crates/openfang-api/static/js/pages/hands.js has 888 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/hands.js:1
crates/openfang-api/static/js/pages/settings.js has 758 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/settings.js:1
crates/openfang-api/static/js/pages/agents.js has 753 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/agents.js:1
crates/openfang-api/static/js/pages/scheduler.js has 584 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/scheduler.js:1
crates/openfang-api/static/js/pages/wizard.js has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/wizard.js:1
REDACTED has 566 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
crates/openfang-api/static/js/pages/skills.js has 470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/openfang-api/static/js/pages/skills.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
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 Code10.0 / 10Exemplary✓ 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.
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.
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 · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (crates/openfang-extensions/src/oauth.rs:208)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — crates/openfang-channels/src/wecom.rs:83
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/4 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`_request` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — sdk/javascript/index.js:52
`_stream` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — sdk/javascript/index.js:71
`upload` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — sdk/javascript/index.js:253
`loadTranslations` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — crates/openfang-api/static/i18n/i18n.js:26
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×26) — crates/openfang-api/static/js/api.js:173, crates/openfang-api/static/js/app.js:11, crates/openfang-api/static/js/app.js:156, …
`catch (parseErr)` 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. — crates/openfang-api/static/js/api.js:246
`.catch(function(){})` 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. (×7) — crates/openfang-api/static/js/pages/chat.js:233, crates/openfang-api/static/js/pages/chat.js:372, crates/openfang-api/static/js/pages/chat.js:534, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info!` at line 193 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — crates/openfang-wire/src/peer.rs:193, crates/openfang-skills/src/marketplace.rs:193
`info!` at line 236 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:236
`info!` at line 296 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:296
`debug!` at line 346 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:346
`debug!` at line 470 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:470
`debug!` at line 478 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:478
`error!` at line 483 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:483
`info!` at line 587 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:587
`warn!` at line 612 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:612
`debug!` at line 642 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:642
`warn!` at line 738 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:738
`info!` at line 789 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:789
`info!` at line 796 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:796
`info!` at line 800 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-wire/src/peer.rs:800
`debug!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/clawhub.rs:337
`debug!` at line 80 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/loader.rs:80
`error!` at line 138 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/loader.rs:138
`debug!` at line 185 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/loader.rs:185
`debug!` at line 332 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/loader.rs:332
`error!` at line 384 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/loader.rs:384
`info!` at line 122 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/marketplace.rs:122
`info!` at line 154 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/marketplace.rs:154
`info!` at line 265 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/openclaw_compat.rs:265
`info!` at line 433 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/openclaw_compat.rs:433
`warn!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:137
`warn!` at line 170 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:170
`info!` at line 176 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:176
`warn!` at line 216 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:216
`warn!` at line 222 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:222
`warn!` at line 238 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:238
`warn!` at line 245 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:245
`warn!` at line 253 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:253
`warn!` at line 265 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:265
`info!` at line 270 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:270
`info!` at line 302 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:302
`info!` at line 328 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:328
`warn!` at line 423 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:423
`warn!` at line 430 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:430
`warn!` at line 437 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/openfang-skills/src/registry.rs:437
Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 46 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~4937 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, Rust not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript, Python, Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. 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 — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 3 value object(s); 5 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, 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 — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — the JS/TS workspace (24 production file(s)) has no JavaScript/TypeScript test, but it is 5% of this repository's production source and the other 95% carries 4,937 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC2 · Forms & labels· Link with no accessible name · ×1
Link with no accessible name crates/openfang-api/static/js/app.js:63— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
FunctionTooLong: openfang_runtime::model_catalog::builtin_models crates/openfang-runtime/src/model_catalog.rs:1067— FunctionTooLong — openfang_runtime::model_catalog::builtin_models runs 2667 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2567 over it, 26.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: chat.chatPage crates/openfang-api/static/js/pages/chat.js:4— FunctionTooLong — chatPage runs 1031 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 931 over it, 10.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: hands.handsPage crates/openfang-api/static/js/pages/hands.js:4— FunctionTooLong — handsPage runs 684 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 584 over it, 6.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: settings.settingsPage crates/openfang-api/static/js/pages/settings.js:4— FunctionTooLong — settingsPage runs 601 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 501 over it, 6.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_cli::cmd_doctor crates/openfang-cli/src/main.rs:2124— FunctionTooLong — openfang_cli::cmd_doctor runs 596 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 496 over it, 5.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: agents.agentsPage crates/openfang-api/static/js/pages/agents.js:19— FunctionTooLong — agentsPage 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: openfang_api::server::build_router crates/openfang-api/src/server.rs:37— FunctionTooLong — openfang_api::server::build_router runs 539 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 439 over it, 5.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_channels::bridge::dispatch_message crates/openfang-channels/src/bridge.rs:754— FunctionTooLong — openfang_channels::bridge::dispatch_message runs 471 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 371 over it, 4.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_api::channel_bridge::start_channel_bridge_with_config crates/openfang-api/src/channel_bridge.rs:1104— FunctionTooLong — openfang_api::channel_bridge::start_channel_bridge_with_config runs 470 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 370 over it, 4.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: scheduler.schedulerPage crates/openfang-api/static/js/pages/scheduler.js:4— FunctionTooLong — schedulerPage runs 456 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 356 over it, 4.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: wizard.wizardPage crates/openfang-api/static/js/pages/wizard.js:14— FunctionTooLong — wizardPage runs 443 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 343 over it, 4.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: workflow-builder.workflowBuilder REDACTED:4— FunctionTooLong — workflowBuilder runs 443 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 343 over it, 4.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: skills.skillsPage crates/openfang-api/static/js/pages/skills.js:4— FunctionTooLong — skillsPage runs 359 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 259 over it, 3.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_runtime::model_catalog::builtin_providers crates/openfang-runtime/src/model_catalog.rs:572— FunctionTooLong — openfang_runtime::model_catalog::builtin_providers runs 338 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 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: openfang_cli::tui::screens::init_wizard::run crates/openfang-cli/src/tui/screens/init_wizard.rs:659— FunctionTooLong — openfang_cli::tui::screens::init_wizard::run runs 332 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 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: openfang_migrate::openclaw::migrate_channels_from_json crates/openfang-migrate/src/openclaw.rs:1424— FunctionTooLong — openfang_migrate::openclaw::migrate_channels_from_json runs 325 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 225 over it, 3.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_api::ws::handle_text_message crates/openfang-api/src/ws.rs:589— FunctionTooLong — openfang_api::ws::handle_text_message runs 266 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: channels.channelsPage crates/openfang-api/static/js/pages/channels.js:4— FunctionTooLong — channelsPage runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× 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: usage.analyticsPage crates/openfang-api/static/js/pages/usage.js:5— FunctionTooLong — analyticsPage runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× 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: chat.chatPage.handleWsMessage crates/openfang-api/static/js/pages/chat.js:747— FunctionTooLong — chatPage.handleWsMessage runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× 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: overview.overviewPage crates/openfang-api/static/js/pages/overview.js:4— FunctionTooLong — overviewPage runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_cli::cmd_channel_setup crates/openfang-cli/src/main.rs:3956— FunctionTooLong — openfang_cli::cmd_channel_setup runs 202 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_migrate::openclaw::parse_legacy_channels crates/openfang-migrate/src/openclaw.rs:2654— FunctionTooLong — openfang_migrate::openclaw::parse_legacy_channels runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 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: openfang_channels::bridge::handle_command crates/openfang-channels/src/bridge.rs:1934— FunctionTooLong — openfang_channels::bridge::handle_command runs 187 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: openfang_cli::main crates/openfang-cli/src/main.rs:921— FunctionTooLong — openfang_cli::main runs 179 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× 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.
Hotspot: crates/openfang-kernel/src/kernel.rs crates/openfang-kernel/src/kernel.rs:590— crates/openfang-kernel/src/kernel.rs changed 120 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in OpenFangKernel::boot_with_config at line 590. 73 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-kernel/src/kernel.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-cli/src/main.rs crates/openfang-cli/src/main.rs:2124— crates/openfang-cli/src/main.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 189 in openfang_cli::cmd_doctor at line 2124. 28 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-cli/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-types/src/config.rs crates/openfang-types/src/config.rs:3382— crates/openfang-types/src/config.rs changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in KernelConfig::validate at line 3382. 16 of those changes were fix/bug commits, and the other 27 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-types/src/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/agent_loop.rs crates/openfang-runtime/src/agent_loop.rs:2387— crates/openfang-runtime/src/agent_loop.rs changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in openfang_runtime::agent_loop::recover_text_tool_calls at line 2387. 30 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/agent_loop.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/src/routes.rs crates/openfang-api/src/routes.rs:2347— crates/openfang-api/src/routes.rs changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in openfang_api::routes::is_channel_configured at line 2347. 48 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/src/routes.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/drivers/openai.rs crates/openfang-runtime/src/drivers/openai.rs:903— crates/openfang-runtime/src/drivers/openai.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in OpenAIDriver::stream at line 903. 31 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/drivers/openai.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/src/channel_bridge.rs crates/openfang-api/src/channel_bridge.rs:1104— crates/openfang-api/src/channel_bridge.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in openfang_api::channel_bridge::start_channel_bridge_with_config at line 1104. 15 of those changes were fix/bug commits, and the other 18 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/src/channel_bridge.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/tool_runner.rs crates/openfang-runtime/src/tool_runner.rs:109— crates/openfang-runtime/src/tool_runner.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in openfang_runtime::tool_runner::execute_tool at line 109. 19 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/tool_runner.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-channels/src/bridge.rs crates/openfang-channels/src/bridge.rs:754— crates/openfang-channels/src/bridge.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in openfang_channels::bridge::dispatch_message at line 754. 15 of those changes were fix/bug commits, and the other 21 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-channels/src/bridge.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/static/js/pages/chat.js crates/openfang-api/static/js/pages/chat.js:747— crates/openfang-api/static/js/pages/chat.js changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in chat.chatPage.handleWsMessage at line 747. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/static/js/pages/chat.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-cli/src/tui/screens/init_wizard.rs crates/openfang-cli/src/tui/screens/init_wizard.rs:659— crates/openfang-cli/src/tui/screens/init_wizard.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in openfang_cli::tui::screens::init_wizard::run at line 659. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-cli/src/tui/screens/init_wizard.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/drivers/mod.rs crates/openfang-runtime/src/drivers/mod.rs:97— crates/openfang-runtime/src/drivers/mod.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in openfang_runtime::drivers::provider_defaults at line 97. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/drivers/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-kernel/src/metering.rs crates/openfang-kernel/src/metering.rs:236— crates/openfang-kernel/src/metering.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in openfang_kernel::metering::estimate_cost_rates at line 236. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-kernel/src/metering.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/src/middleware.rs crates/openfang-api/src/middleware.rs:71— crates/openfang-api/src/middleware.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in openfang_api::middleware::auth at line 71. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/src/middleware.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/drivers/gemini.rs crates/openfang-runtime/src/drivers/gemini.rs:749— crates/openfang-runtime/src/drivers/gemini.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in GeminiDriver::stream at line 749. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/drivers/gemini.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/src/ws.rs crates/openfang-api/src/ws.rs:1009— crates/openfang-api/src/ws.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in openfang_api::ws::handle_command at line 1009. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/src/ws.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-cli/src/tui/mod.rs crates/openfang-cli/src/tui/mod.rs:227— crates/openfang-cli/src/tui/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in App::handle_event at line 227. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-cli/src/tui/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/drivers/anthropic.rs crates/openfang-runtime/src/drivers/anthropic.rs:304— crates/openfang-runtime/src/drivers/anthropic.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in AnthropicDriver::stream at line 304. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/drivers/anthropic.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-channels/src/telegram.rs crates/openfang-channels/src/telegram.rs:843— crates/openfang-channels/src/telegram.rs changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in openfang_channels::telegram::parse_telegram_update at line 843. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-channels/src/telegram.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/model_catalog.rs crates/openfang-runtime/src/model_catalog.rs:57— crates/openfang-runtime/src/model_catalog.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ModelCatalog::detect_auth at line 57. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/model_catalog.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-channels/src/discord.rs crates/openfang-channels/src/discord.rs:279— crates/openfang-channels/src/discord.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in DiscordAdapter::start at line 279. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-channels/src/discord.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/src/server.rs crates/openfang-api/src/server.rs:37— crates/openfang-api/src/server.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in openfang_api::server::build_router at line 37. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/src/server.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/static/js/app.js crates/openfang-api/static/js/app.js:123— crates/openfang-api/static/js/app.js changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in app.document.addEventListener("alpine:init") at line 123. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/static/js/app.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-runtime/src/prompt_builder.rs crates/openfang-runtime/src/prompt_builder.rs:76— crates/openfang-runtime/src/prompt_builder.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in openfang_runtime::prompt_builder::build_system_prompt at line 76. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/prompt_builder.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/openfang-api/static/js/pages/wizard.js crates/openfang-api/static/js/pages/wizard.js:14— crates/openfang-api/static/js/pages/wizard.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in wizard.wizardPage at line 14. 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-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/static/js/pages/wizard.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
openfang_runtime::agent_loop::recover_text_tool_calls (cognitive 194) crates/openfang-runtime/src/agent_loop.rs:2387— openfang_runtime::agent_loop::recover_text_tool_calls has cognitive complexity 194 (threshold 15). Drivers by points: if/else 55 (153 pts), boolean chains 16, loops 13 (14 pts), match/switch 5 (11 pts) (nesting depth added 105). 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.
openfang_runtime::agent_loop::run_agent_loop_streaming (cognitive 191) crates/openfang-runtime/src/agent_loop.rs:1520— openfang_runtime::agent_loop::run_agent_loop_streaming has cognitive complexity 191 (threshold 15). Drivers by points: if/else 57 (154 pts), match/switch 7 (23 pts), loops 4 (9 pts), boolean chains 5 (nesting depth added 118). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::agent_loop::run_agent_loop (cognitive 182) crates/openfang-runtime/src/agent_loop.rs:293— openfang_runtime::agent_loop::run_agent_loop has cognitive complexity 182 (threshold 15). Drivers by points: if/else 55 (146 pts), match/switch 6 (21 pts), loops 4 (9 pts), boolean chains 6 (nesting depth added 111). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::tool_runner::execute_tool (cognitive 88) crates/openfang-runtime/src/tool_runner.rs:109— openfang_runtime::tool_runner::execute_tool has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (58 pts), match/switch 15 (26 pts), boolean chains 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::apply_patch::parse_patch (cognitive 86) crates/openfang-runtime/src/apply_patch.rs:106— openfang_runtime::apply_patch::parse_patch has cognitive complexity 86 (threshold 15). Drivers by points: if/else 28 (68 pts), loops 4 (12 pts), boolean chains 6 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_runtime::session_repair::reorder_tool_results (cognitive 84) crates/openfang-runtime/src/session_repair.rs:232— openfang_runtime::session_repair::reorder_tool_results has cognitive complexity 84 (threshold 15). Drivers by points: if/else 22 (65 pts), loops 9 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 51). 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.
openfang_runtime::apply_patch::apply_patch (cognitive 59) crates/openfang-runtime/src/apply_patch.rs:282— openfang_runtime::apply_patch::apply_patch has cognitive complexity 59 (threshold 15). Drivers by points: match/switch 10 (34 pts), if/else 6 (23 pts), boolean chains 1, loops 1 (nesting depth added 41). 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.
openfang_runtime::drivers::bedrock::relocate_stray_tool_results (cognitive 58) crates/openfang-runtime/src/drivers/bedrock.rs:397— openfang_runtime::drivers::bedrock::relocate_stray_tool_results has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 9 (13 pts), boolean chains 2 (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.
openfang_runtime::compactor::build_conversation_text (cognitive 57) crates/openfang-runtime/src/compactor.rs:327— openfang_runtime::compactor::build_conversation_text has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (44 pts), match/switch 3 (8 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::prompt_builder::build_system_prompt (cognitive 52) crates/openfang-runtime/src/prompt_builder.rs:76— openfang_runtime::prompt_builder::build_system_prompt has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (48 pts), boolean chains 4 (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.
openfang_runtime::agent_loop::call_with_retry (cognitive 51) crates/openfang-runtime/src/agent_loop.rs:1155— openfang_runtime::agent_loop::call_with_retry has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 5 (17 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (openfang_runtime::agent_loop::stream_with_retry) 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.
openfang_runtime::agent_loop::stream_with_retry (cognitive 51) crates/openfang-runtime/src/agent_loop.rs:1339— openfang_runtime::agent_loop::stream_with_retry has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 5 (17 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (openfang_runtime::agent_loop::call_with_retry) 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.
openfang_runtime::shell_bleed::extract_env_var_refs (cognitive 49) crates/openfang-runtime/src/shell_bleed.rs:183— openfang_runtime::shell_bleed::extract_env_var_refs has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 6 (13 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::context_budget::apply_context_guard (cognitive 45) crates/openfang-runtime/src/context_budget.rs:101— openfang_runtime::context_budget::apply_context_guard has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 4 (6 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_runtime::subprocess_sandbox::wait_or_kill_with_idle (cognitive 44) crates/openfang-runtime/src/subprocess_sandbox.rs:594— openfang_runtime::subprocess_sandbox::wait_or_kill_with_idle has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 5 (16 pts), loops 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.
openfang_runtime::session_repair::insert_synthetic_results (cognitive 43) crates/openfang-runtime/src/session_repair.rs:381— openfang_runtime::session_repair::insert_synthetic_results has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 6 (11 pts), boolean chains 1 (nesting depth added 24). 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.
openfang_runtime::context_overflow::safe_drain_boundary (cognitive 41) crates/openfang-runtime/src/context_overflow.rs:26— openfang_runtime::context_overflow::safe_drain_boundary has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 3 (12 pts), boolean chains 3 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_runtime::drivers::create_driver (cognitive 41) crates/openfang-runtime/src/drivers/mod.rs:333— openfang_runtime::drivers::create_driver has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::llm_errors::classify_error (cognitive 39) crates/openfang-runtime/src/llm_errors.rs:243— openfang_runtime::llm_errors::classify_error has cognitive complexity 39 (threshold 15). Drivers by points: if/else 29 (35 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
openfang_runtime::context_overflow::recover_from_overflow (cognitive 35) crates/openfang-runtime/src/context_overflow.rs:117— openfang_runtime::context_overflow::recover_from_overflow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::session_repair::validate_and_repair_with_stats (cognitive 32) crates/openfang-runtime/src/session_repair.rs:57— openfang_runtime::session_repair::validate_and_repair_with_stats has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::tool_runner::parse_schedule_to_cron (cognitive 32) crates/openfang-runtime/src/tool_runner.rs:2147— openfang_runtime::tool_runner::parse_schedule_to_cron has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 8, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::browser::find_chromium (cognitive 31) crates/openfang-runtime/src/browser.rs:675— openfang_runtime::browser::find_chromium has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::agent_loop::parse_dash_dash_args (cognitive 30) crates/openfang-runtime/src/agent_loop.rs:3092— openfang_runtime::agent_loop::parse_dash_dash_args has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_runtime::drivers::gemini::sanitize_gemini_turns (cognitive 30) crates/openfang-runtime/src/drivers/gemini.rs:387— openfang_runtime::drivers::gemini::sanitize_gemini_turns has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4, 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.
Outbound HTTP without resilience crates/openfang-channels/src/bluesky.rs:86— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/dingtalk.rs:55— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/dingtalk_stream.rs:50— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/discord.rs:94— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/discourse.rs:67— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/feishu.rs:236— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/feishu.rs:294— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/flock.rs:55— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/google_chat.rs:58— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/gotify.rs:56— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/guilded.rs:58— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/keybase.rs:65— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/line.rs:68— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/line.rs:401— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/linkedin.rs:61— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/matrix.rs:90— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/mattermost.rs:58— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/messenger.rs:62— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/pumble.rs:55— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/revolt.rs:83— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/rocketchat.rs:64— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/signal.rs:41— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/slack.rs:94— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/teams.rs:73— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/openfang-channels/src/threema.rs:58— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
openfang_cli::cmd_doctor (cognitive 582) crates/openfang-cli/src/main.rs:2124— openfang_cli::cmd_doctor has cognitive complexity 582 (threshold 15). Drivers by points: if/else 176 (517 pts), match/switch 14 (31 pts), loops 9 (26 pts), boolean chains 8 (nesting depth added 375). 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.
openfang_cli::tui::screens::init_wizard::run (cognitive 281) crates/openfang-cli/src/tui/screens/init_wizard.rs:659— openfang_cli::tui::screens::init_wizard::run has cognitive complexity 281 (threshold 15). Drivers by points: if/else 46 (158 pts), match/switch 17 (99 pts), loops 4 (15 pts), boolean chains 9 (nesting depth added 205). 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.
openfang_cli::tui::screens::chat::draw_messages (cognitive 69) crates/openfang-cli/src/tui/screens/chat.rs:598— openfang_cli::tui::screens::chat::draw_messages has cognitive complexity 69 (threshold 15). Drivers by points: if/else 25 (46 pts), loops 6 (14 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_cli::cmd_channel_setup (cognitive 55) crates/openfang-cli/src/main.rs:3956— openfang_cli::cmd_channel_setup has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 10 (25 pts), loops 2 (4 pts) (nesting depth added 29). 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.
openfang_cli::main (cognitive 45) crates/openfang-cli/src/main.rs:921— openfang_cli::main has cognitive complexity 45 (threshold 15). Drivers by points: match/switch 20 (39 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 20). 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.
openfang_cli::launcher::run (cognitive 42) crates/openfang-cli/src/launcher.rs:187— openfang_cli::launcher::run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (37 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 29). 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.
openfang_cli::cmd_skill_install (cognitive 37) crates/openfang-cli/src/main.rs:3564— openfang_cli::cmd_skill_install has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 4 (12 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_cli::tui::screens::init_wizard::handle_routing_key (cognitive 36) crates/openfang-cli/src/tui/screens/init_wizard.rs:1224— openfang_cli::tui::screens::init_wizard::handle_routing_key has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), match/switch 3 (5 pts) (nesting depth added 19). 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.
openfang_cli::tui::screens::init_wizard::draw_complete (cognitive 34) crates/openfang-cli/src/tui/screens/init_wizard.rs:2475— openfang_cli::tui::screens::init_wizard::draw_complete has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
openfang_cli::cmd_uninstall (cognitive 33) crates/openfang-cli/src/main.rs:6796— openfang_cli::cmd_uninstall has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (26 pts), match/switch 2 (5 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.
openfang_cli::launcher::draw (cognitive 33) crates/openfang-cli/src/launcher.rs:304— openfang_cli::launcher::draw has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
openfang_cli::tui::screens::welcome::draw (cognitive 31) crates/openfang-cli/src/tui/screens/welcome.rs:217— openfang_cli::tui::screens::welcome::draw has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
openfang_cli::tui::event::spawn_daemon_stream (cognitive 30) crates/openfang-cli/src/tui/event.rs:334— openfang_cli::tui::event::spawn_daemon_stream has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_cli::cmd_integration_add (cognitive 28) crates/openfang-cli/src/main.rs:5395— openfang_cli::cmd_integration_add has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (5 pts), match/switch 3 (4 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.
openfang_cli::cmd_models_list (cognitive 28) crates/openfang-cli/src/main.rs:5707— openfang_cli::cmd_models_list has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (5 pts), match/switch 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.
openfang_cli::templates::load_all_templates (cognitive 26) crates/openfang-cli/src/templates.rs:65— openfang_cli::templates::load_all_templates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_cli::tui::event::spawn_fetch_agent_mcp_servers (cognitive 26) crates/openfang-cli/src/tui/event.rs:1064— openfang_cli::tui::event::spawn_fetch_agent_mcp_servers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 1 (4 pts), match/switch 1 (nesting depth added 18). 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.
openfang_cli::tui::screens::chat::draw_model_picker (cognitive 23) crates/openfang-cli/src/tui/screens/chat.rs:478— openfang_cli::tui::screens::chat::draw_model_picker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
openfang_cli::tui::screens::init_wizard::handle_migration_key (cognitive 22) crates/openfang-cli/src/tui/screens/init_wizard.rs:1160— openfang_cli::tui::screens::init_wizard::handle_migration_key has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (3 pts) (nesting depth added 11). 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.
openfang_cli::tui::screens::skills::draw_installed (cognitive 21) crates/openfang-cli/src/tui/screens/skills.rs:362— openfang_cli::tui::screens::skills::draw_installed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_cli::cmd_status (cognitive 20) crates/openfang-cli/src/main.rs:2038— openfang_cli::cmd_status has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (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.
openfang_cli::tui::screens::init_wizard::draw_migration_offer (cognitive 20) crates/openfang-cli/src/tui/screens/init_wizard.rs:1609— openfang_cli::tui::screens::init_wizard::draw_migration_offer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 2, match/switch 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.
openfang_cli::templates::discover_template_dirs (cognitive 19) crates/openfang-cli/src/templates.rs:19— openfang_cli::templates::discover_template_dirs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 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.
openfang_cli::tui::event::spawn_fetch_skill_config (cognitive 19) crates/openfang-cli/src/tui/event.rs:1626— openfang_cli::tui::event::spawn_fetch_skill_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 11). 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.
openfang_cli::tui::screens::init_wizard::draw_migration_done (cognitive 19) crates/openfang-cli/src/tui/screens/init_wizard.rs:1798— openfang_cli::tui::screens::init_wizard::draw_migration_done has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (5 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.
FileTooLong: src/routes.rs crates/openfang-api/src/routes.rs— FileTooLong — 8252 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 223 free functions. The bar is 500 significant lines; this is 7752 over it, 16.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/kernel.rs crates/openfang-kernel/src/kernel.rs— FileTooLong — 5068 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: OpenFangKernel (4 blocks, 60-7934). The bar is 500 significant lines; this is 4568 over it, 10.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/main.rs crates/openfang-cli/src/main.rs— FileTooLong — 4698 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 139 free functions. The bar is 500 significant lines; this is 4198 over it, 9.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/model_catalog.rs crates/openfang-runtime/src/model_catalog.rs— FileTooLong — 3324 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2824 over it, 6.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/tool_runner.rs crates/openfang-runtime/src/tool_runner.rs— FileTooLong — 2507 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 76 free functions. The bar is 500 significant lines; this is 2007 over it, 5.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/config.rs crates/openfang-types/src/config.rs— FileTooLong — 2224 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1724 over it, 4.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/openclaw.rs crates/openfang-migrate/src/openclaw.rs— FileTooLong — 2186 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 42 free functions. The bar is 500 significant lines; this is 1686 over it, 4.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/agent_loop.rs crates/openfang-runtime/src/agent_loop.rs— FileTooLong — 2035 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1535 over it, 4.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tui/event.rs crates/openfang-cli/src/tui/event.rs— FileTooLong — 1930 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 64 free functions. The bar is 500 significant lines; this is 1430 over it, 3.86× 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: screens/init_wizard.rs crates/openfang-cli/src/tui/screens/init_wizard.rs— FileTooLong — 1887 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1387 over it, 3.77× 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: tui/mod.rs crates/openfang-cli/src/tui/mod.rs— FileTooLong — 1658 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: App (2 blocks, 139-2375). The bar is 500 significant lines; this is 1158 over it, 3.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/bridge.rs crates/openfang-channels/src/bridge.rs— FileTooLong — 1368 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 868 over it, 2.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: src/channel_bridge.rs crates/openfang-api/src/channel_bridge.rs— FileTooLong — 1326 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 826 over it, 2.65× 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: drivers/openai.rs crates/openfang-runtime/src/drivers/openai.rs— FileTooLong — 1081 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: OpenAIDriver (3 blocks, 20-1518). The bar is 500 significant lines; this is 581 over it, 2.16× 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: screens/agents.rs crates/openfang-cli/src/tui/screens/agents.rs— FileTooLong — 1034 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 534 over it, 2.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: pages/chat.js crates/openfang-api/static/js/pages/chat.js— FileTooLong — 1032 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: chatPage (4-1439). The bar is 500 significant lines; this is 532 over it, 2.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/ws.rs crates/openfang-api/src/ws.rs— FileTooLong — 991 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 491 over it, 1.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/browser.rs crates/openfang-runtime/src/browser.rs— FileTooLong — 790 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 290 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/telegram.rs crates/openfang-channels/src/telegram.rs— FileTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 63% of them inside a single declaration: TelegramAdapter (4 blocks, 41-817). The bar is 500 significant lines; this is 267 over it, 1.53× 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: drivers/gemini.rs crates/openfang-runtime/src/drivers/gemini.rs— FileTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 249 over it, 1.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/server.rs crates/openfang-api/src/server.rs— FileTooLong — 701 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 201 over it, 1.40× 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: screens/channels.rs crates/openfang-cli/src/tui/screens/channels.rs— FileTooLong — 698 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 198 over it, 1.40× 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: pages/hands.js crates/openfang-api/static/js/pages/hands.js— FileTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: handsPage (4-962). The bar is 500 significant lines; this is 185 over it, 1.37× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/discord.rs crates/openfang-channels/src/discord.rs— FileTooLong — 642 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: DiscordAdapter (3 blocks, 55-745). The bar is 500 significant lines; this is 142 over it, 1.28× 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: pages/settings.js crates/openfang-api/static/js/pages/settings.js— FileTooLong — 602 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: settingsPage (4-819). The bar is 500 significant lines; this is 102 over it, 1.20× 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.
Duplicated block (10 lines × 2) crates/openfang-api/src/channel_bridge.rs:546— crates/openfang-api/src/channel_bridge.rs:546-555 | crates/openfang-api/src/channel_bridge.rs:575-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-api/src/routes.rs:6971— crates/openfang-api/src/routes.rs:6971-6980 | crates/openfang-api/src/routes.rs:7000-7009 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-api/src/routes.rs:8406— crates/openfang-api/src/routes.rs:8406-8415 | crates/openfang-api/src/routes.rs:8482-8491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-api/src/routes.rs:8629— crates/openfang-api/src/routes.rs:8629-8638 | crates/openfang-api/src/routes.rs:8831-8840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-channels/src/dingtalk.rs:50— crates/openfang-channels/src/dingtalk.rs:50-59 | crates/openfang-channels/src/messenger.rs:57-66 — 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 (10 lines × 2) crates/openfang-channels/src/discourse.rs:60— crates/openfang-channels/src/discourse.rs:60-69 | crates/openfang-channels/src/rocketchat.rs:57-66 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/rocketchat.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-channels/src/discourse.rs:141— crates/openfang-channels/src/discourse.rs:141-150 | crates/openfang-channels/src/rocketchat.rs:107-116 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/rocketchat.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-channels/src/zulip.rs:87— crates/openfang-channels/src/zulip.rs:87-96 | crates/openfang-channels/src/zulip.rs:155-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-cli/src/launcher.rs:42— crates/openfang-cli/src/launcher.rs:42-51 | crates/openfang-cli/src/tui/screens/wizard.rs:170-179 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:382— crates/openfang-cli/src/tui/chat_runner.rs:382-391 | crates/openfang-cli/src/tui/mod.rs:1871-1880 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:551— crates/openfang-cli/src/tui/chat_runner.rs:551-560 | crates/openfang-cli/src/tui/mod.rs:1780-1789 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-cli/src/tui/event.rs:1487— crates/openfang-cli/src/tui/event.rs:1487-1496 | crates/openfang-cli/src/tui/event.rs:1506-1515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-cli/src/tui/screens/audit.rs:292— crates/openfang-cli/src/tui/screens/audit.rs:292-301 | crates/openfang-cli/src/tui/screens/logs.rs:373-382 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/logs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-cli/src/tui/screens/settings.rs:535— crates/openfang-cli/src/tui/screens/settings.rs:535-544 | crates/openfang-cli/src/tui/screens/usage.rs:347-356 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/settings.rs` and `crates/openfang-cli/src/tui/screens/usage.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-kernel/src/workflow.rs:582— crates/openfang-kernel/src/workflow.rs:582-591 | crates/openfang-kernel/src/workflow.rs:734-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-migrate/src/openclaw.rs:2073— crates/openfang-migrate/src/openclaw.rs:2073-2082 | crates/openfang-migrate/src/openclaw.rs:3062-3071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-runtime/src/agent_loop.rs:319— crates/openfang-runtime/src/agent_loop.rs:319-328 | crates/openfang-runtime/src/agent_loop.rs:1547-1556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-runtime/src/agent_loop.rs:872— crates/openfang-runtime/src/agent_loop.rs:872-881 | crates/openfang-runtime/src/agent_loop.rs:2081-2090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:393— crates/openfang-runtime/src/drivers/gemini.rs:393-402 | crates/openfang-runtime/src/drivers/gemini.rs:477-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-wire/src/peer.rs:252— crates/openfang-wire/src/peer.rs:252-261 | crates/openfang-wire/src/peer.rs:386-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-runtime/src/drivers/anthropic.rs:26— crates/openfang-runtime/src/drivers/anthropic.rs:26-35 | crates/openfang-runtime/src/drivers/gemini.rs:31-40 — before extracting anything, compare `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/openfang-runtime/src/str_utils.rs:9— crates/openfang-runtime/src/str_utils.rs:9-19 | crates/openfang-types/src/lib.rs:27-36 — 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 (10 lines × 2) crates/openfang-cli/src/main.rs:2666— crates/openfang-cli/src/main.rs:2666-2676 | crates/openfang-cli/src/main.rs:2679-2688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:2521— crates/openfang-cli/src/tui/screens/init_wizard.rs:2521-2530 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2548-2558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/openfang-channels/src/twist.rs:74— crates/openfang-channels/src/twist.rs:74-83 | crates/openfang-channels/src/twist.rs:101-111 — both copies are in the same file, so extract the 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) crates/openfang-api/src/channel_bridge.rs:384— crates/openfang-api/src/channel_bridge.rs:384-391 | crates/openfang-api/src/channel_bridge.rs:464-471 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:921— crates/openfang-api/src/routes.rs:921-928 | crates/openfang-api/src/routes.rs:1144-1151 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:3938— crates/openfang-api/src/routes.rs:3938-3945 | crates/openfang-api/src/routes.rs:4018-4025 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/bluesky.rs:360— crates/openfang-channels/src/bluesky.rs:360-367 | crates/openfang-channels/src/reddit.rs:344-351 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/reddit.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/openfang-channels/src/discourse.rs:186— crates/openfang-channels/src/discourse.rs:186-193 | crates/openfang-channels/src/linkedin.rs:233-240 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/openfang-channels/src/revolt.rs:141— crates/openfang-channels/src/revolt.rs:141-148 | crates/openfang-channels/src/revolt.rs:181-188 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/viber.rs:175— crates/openfang-channels/src/viber.rs:175-182 | crates/openfang-channels/src/viber.rs:382-389 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/launcher.rs:547— crates/openfang-cli/src/launcher.rs:547-554 | crates/openfang-cli/src/main.rs:1380-1387 — 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 (8 lines × 2) crates/openfang-cli/src/main.rs:3096— crates/openfang-cli/src/main.rs:3096-3103 | crates/openfang-cli/src/main.rs:3128-3135 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/sessions.rs:138— crates/openfang-cli/src/tui/screens/sessions.rs:138-145 | crates/openfang-cli/src/tui/screens/templates.rs:202-209 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/sessions.rs` and `crates/openfang-cli/src/tui/screens/templates.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/openfang-cli/src/tui/screens/sessions.rs:222— crates/openfang-cli/src/tui/screens/sessions.rs:222-230 | crates/openfang-cli/src/tui/screens/skills.rs:608-615 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/sessions.rs` and `crates/openfang-cli/src/tui/screens/skills.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/openfang-cli/src/tui/screens/triggers.rs:326— crates/openfang-cli/src/tui/screens/triggers.rs:326-333 | crates/openfang-cli/src/tui/screens/workflows.rs:355-362 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/triggers.rs` and `crates/openfang-cli/src/tui/screens/workflows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/openfang-desktop/src/server.rs:172— crates/openfang-desktop/src/server.rs:172-179 | crates/openfang-extensions/src/credentials.rs:156-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/openfang-memory/src/session.rs:52— crates/openfang-memory/src/session.rs:52-59 | crates/openfang-memory/src/session.rs:236-243 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/context_budget.rs:151— crates/openfang-runtime/src/context_budget.rs:151-158 | crates/openfang-runtime/src/context_budget.rs:179-186 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/qwen_code.rs:212— crates/openfang-runtime/src/drivers/qwen_code.rs:212-219 | crates/openfang-runtime/src/drivers/qwen_code.rs:300-307 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/tool_runner.rs:2997— crates/openfang-runtime/src/tool_runner.rs:2997-3004 | crates/openfang-runtime/src/tool_runner.rs:3042-3049 — both copies are in the same file, so extract the 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) crates/openfang-skills/src/openclaw_compat.rs:253— crates/openfang-skills/src/openclaw_compat.rs:253-260 | crates/openfang-skills/src/openclaw_compat.rs:349-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/openfang-wire/src/registry.rs:146— crates/openfang-wire/src/registry.rs:146-153 | crates/openfang-wire/src/registry.rs:174-181 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/launcher.rs:32— crates/openfang-cli/src/launcher.rs:32-39 | crates/openfang-cli/src/tui/screens/welcome.rs:48-55 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/welcome.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/openfang-kernel/src/config.rs:352— crates/openfang-kernel/src/config.rs:352-359 | crates/openfang-types/src/config.rs:1669-1676 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:701— crates/openfang-runtime/src/drivers/openai.rs:701-712 | crates/openfang-runtime/src/drivers/openai.rs:1128-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/openfang-api/src/routes.rs:8006— crates/openfang-api/src/routes.rs:8006-8013 | crates/openfang-api/src/routes.rs:8113-8123 — both copies are in the same file, so extract the 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) crates/openfang-wire/src/peer.rs:531— crates/openfang-wire/src/peer.rs:531-538 | crates/openfang-wire/src/peer.rs:548-556 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:7551— crates/openfang-api/src/routes.rs:7551-7558 | crates/openfang-api/src/routes.rs:7636-7644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Swallowed exception (empty catch) crates/openfang-api/static/js/api.js:173— 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) crates/openfang-api/static/js/app.js:11— 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) crates/openfang-api/static/js/app.js:156— 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) crates/openfang-api/static/js/app.js:173— 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) crates/openfang-api/static/js/app.js:230— 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) crates/openfang-api/static/js/app.js:274— 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) crates/openfang-api/static/js/katex.js:80— 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) crates/openfang-api/static/js/pages/agents.js:367— 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) crates/openfang-api/static/js/pages/channels.js:222— 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) crates/openfang-api/static/js/pages/chat.js:233— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:372— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:534— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:565— 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) crates/openfang-api/static/js/pages/chat.js:576— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:584— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:596— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:606— 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) crates/openfang-api/static/js/pages/chat.js:621— 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) crates/openfang-api/static/js/pages/chat.js:679— 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) crates/openfang-api/static/js/pages/chat.js:920— 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) crates/openfang-api/static/js/pages/chat.js:930— 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) crates/openfang-api/static/js/pages/chat.js:1061— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/openfang-api/static/js/pages/chat.js:1206— 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) crates/openfang-api/static/js/pages/chat.js:1232— 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) crates/openfang-api/static/js/pages/comms.js:55— 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.
Duplicated block (7 lines × 2) crates/openfang-api/src/routes.rs:913— crates/openfang-api/src/routes.rs:913-919 | crates/openfang-api/src/routes.rs:1136-1142 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:5800— crates/openfang-api/src/routes.rs:5800-5806 | crates/openfang-api/src/routes.rs:9671-9677 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/google_chat.rs:167— crates/openfang-channels/src/google_chat.rs:167-173 | crates/openfang-channels/src/threema.rs:201-207 — before extracting anything, compare `crates/openfang-channels/src/google_chat.rs` and `crates/openfang-channels/src/threema.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-channels/src/line.rs:137— crates/openfang-channels/src/line.rs:137-143 | crates/openfang-channels/src/mastodon.rs:76-82 — before extracting anything, compare `crates/openfang-channels/src/line.rs` and `crates/openfang-channels/src/mastodon.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-channels/src/line.rs:375— crates/openfang-channels/src/line.rs:375-381 | crates/openfang-channels/src/webhook.rs:188-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/openfang-channels/src/messenger.rs:110— crates/openfang-channels/src/messenger.rs:110-117 | crates/openfang-channels/src/messenger.rs:392-398 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/reddit.rs:130— crates/openfang-channels/src/reddit.rs:130-136 | crates/openfang-channels/src/zulip.rs:91-97 — 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 (7 lines × 2) crates/openfang-channels/src/twist.rs:232— crates/openfang-channels/src/twist.rs:232-238 | crates/openfang-channels/src/webex.rs:135-141 — before extracting anything, compare `crates/openfang-channels/src/twist.rs` and `crates/openfang-channels/src/webex.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-cli/src/launcher.rs:567— crates/openfang-cli/src/launcher.rs:567-573 | crates/openfang-cli/src/main.rs:1395-1401 — 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 (7 lines × 2) crates/openfang-cli/src/tui/event.rs:1813— crates/openfang-cli/src/tui/event.rs:1813-1819 | crates/openfang-cli/src/tui/event.rs:2174-2180 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/channels.rs:733— crates/openfang-cli/src/tui/screens/channels.rs:733-739 | crates/openfang-cli/src/tui/screens/workflows.rs:358-364 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/channels.rs` and `crates/openfang-cli/src/tui/screens/workflows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-cli/src/tui/screens/extensions.rs:222— crates/openfang-cli/src/tui/screens/extensions.rs:222-228 | crates/openfang-cli/src/tui/screens/skills.rs:198-204 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/extensions.rs` and `crates/openfang-cli/src/tui/screens/skills.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1738— crates/openfang-cli/src/tui/screens/init_wizard.rs:1738-1744 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2305-2314 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/settings.rs:225— crates/openfang-cli/src/tui/screens/settings.rs:225-231 | crates/openfang-cli/src/tui/screens/usage.rs:117-123 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/settings.rs` and `crates/openfang-cli/src/tui/screens/usage.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-kernel/src/kernel.rs:7212— crates/openfang-kernel/src/kernel.rs:7212-7218 | crates/openfang-kernel/src/kernel.rs:7282-7288 — both copies are in the same file, so extract the 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) crates/openfang-kernel/src/kernel.rs:7873— crates/openfang-kernel/src/kernel.rs:7873-7879 | crates/openfang-kernel/src/kernel.rs:7923-7929 — both copies are in the same file, so extract the 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) crates/openfang-memory/src/session.rs:62— crates/openfang-memory/src/session.rs:62-68 | crates/openfang-memory/src/session.rs:246-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/openfang-runtime/src/browser.rs:544— crates/openfang-runtime/src/browser.rs:544-550 | crates/openfang-runtime/src/browser.rs:565-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/openfang-runtime/src/drivers/claude_code.rs:308— crates/openfang-runtime/src/drivers/claude_code.rs:308-314 | crates/openfang-runtime/src/drivers/claude_code.rs:503-509 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/fallback.rs:39— crates/openfang-runtime/src/drivers/fallback.rs:39-45 | crates/openfang-runtime/src/drivers/fallback.rs:80-86 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/tool_runner.rs:3025— crates/openfang-runtime/src/tool_runner.rs:3025-3031 | crates/openfang-runtime/src/tool_runner.rs:3070-3076 — both copies are in the same file, so extract the 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) crates/openfang-memory/src/semantic.rs:492— crates/openfang-memory/src/semantic.rs:492-498 | crates/openfang-runtime/src/embedding.rs:279-285 — before extracting anything, compare `crates/openfang-memory/src/semantic.rs` and `crates/openfang-runtime/src/embedding.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:2002— crates/openfang-cli/src/tui/screens/init_wizard.rs:2002-2008 | crates/openfang-cli/src/tui/screens/wizard.rs:563-571 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/openfang-memory/src/knowledge.rs:40— crates/openfang-memory/src/knowledge.rs:40-46 | crates/openfang-memory/src/knowledge.rs:62-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/openfang-api/src/routes.rs:4652— crates/openfang-api/src/routes.rs:4652-4658 | crates/openfang-api/src/routes.rs:4677-4683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
openfang_api::channel_bridge::start_channel_bridge_with_config (cognitive 177) crates/openfang-api/src/channel_bridge.rs:1104— openfang_api::channel_bridge::start_channel_bridge_with_config has cognitive complexity 177 (threshold 15). Drivers by points: if/else 101 (159 pts), match/switch 4 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::ws::handle_text_message (cognitive 103) crates/openfang-api/src/ws.rs:589— openfang_api::ws::handle_text_message has cognitive complexity 103 (threshold 15). Drivers by points: if/else 22 (78 pts), match/switch 8 (21 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 71). 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.
openfang_api::routes::get_agent_session (cognitive 85) crates/openfang-api/src/routes.rs:452— openfang_api::routes::get_agent_session has cognitive complexity 85 (threshold 15). Drivers by points: if/else 11 (57 pts), loops 5 (15 pts), match/switch 5 (11 pts), boolean chains 2 (nesting depth added 62). 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.
openfang_api::routes::install_hand_deps (cognitive 77) crates/openfang-api/src/routes.rs:4486— openfang_api::routes::install_hand_deps has cognitive complexity 77 (threshold 15). Drivers by points: if/else 17 (50 pts), loops 4 (16 pts), match/switch 5 (9 pts), boolean chains 2 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_api::routes::patch_agent_config (cognitive 66) crates/openfang-api/src/routes.rs:9712— openfang_api::routes::patch_agent_config has cognitive complexity 66 (threshold 15). Drivers by points: if/else 32 (62 pts), boolean chains 3, match/switch 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::ws::handle_command (cognitive 58) crates/openfang-api/src/ws.rs:1009— openfang_api::ws::handle_command has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (35 pts), match/switch 10 (23 pts) (nesting depth added 29). 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.
openfang_api::middleware::auth (cognitive 52) crates/openfang-api/src/middleware.rs:71— openfang_api::middleware::auth has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 36, if/else 12 (16 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.
openfang_api::routes::clone_agent (cognitive 40) crates/openfang-api/src/routes.rs:9991— openfang_api::routes::clone_agent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 5 (7 pts), loops 1 (3 pts), boolean chains 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.
openfang_api::server::build_router (cognitive 34) crates/openfang-api/src/server.rs:37— openfang_api::server::build_router has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 3, 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.
openfang_api::server::run_daemon (cognitive 34) crates/openfang-api/src/server.rs:803— openfang_api::server::run_daemon has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_api::routes::create_schedule (cognitive 33) crates/openfang-api/src/routes.rs:9185— openfang_api::routes::create_schedule has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (23 pts), match/switch 5 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::channel_bridge::reload_channels_from_disk (cognitive 31) crates/openfang-api/src/channel_bridge.rs:1842— openfang_api::channel_bridge::reload_channels_from_disk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_api::routes::load_skill_declared_config (cognitive 30) crates/openfang-api/src/routes.rs:8215— openfang_api::routes::load_skill_declared_config has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_api::ws::check_ws_auth (cognitive 28) crates/openfang-api/src/ws.rs:223— openfang_api::ws::check_ws_auth has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_api::routes::logs_stream (cognitive 26) crates/openfang-api/src/routes.rs:5321— openfang_api::routes::logs_stream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::routes::spawn_agent (cognitive 24) crates/openfang-api/src/routes.rs:49— openfang_api::routes::spawn_agent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (7 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.
openfang_api::routes::comms_topology (cognitive 24) crates/openfang-api/src/routes.rs:12119— openfang_api::routes::comms_topology has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (4 pts) (nesting depth added 15). 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.
openfang_api::ws::handle_agent_ws (cognitive 23) crates/openfang-api/src/ws.rs:411— openfang_api::ws::handle_agent_ws has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 4 (9 pts), loops 3 (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.
openfang_api::routes::build_field_json (cognitive 22) crates/openfang-api/src/routes.rs:2397— openfang_api::routes::build_field_json has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_api::routes::set_provider_key (cognitive 20) crates/openfang-api/src/routes.rs:7665— openfang_api::routes::set_provider_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::routes::build_skill_config_snapshot (cognitive 20) crates/openfang-api/src/routes.rs:8264— openfang_api::routes::build_skill_config_snapshot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::routes::config_set (cognitive 20) crates/openfang-api/src/routes.rs:11125— openfang_api::routes::config_set has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 6 (7 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.
openfang_api::routes::update_schedule (cognitive 19) crates/openfang-api/src/routes.rs:9360— openfang_api::routes::update_schedule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_api::routes::upload_file (cognitive 19) crates/openfang-api/src/routes.rs:10548— openfang_api::routes::upload_file has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 7, loops 1 (nesting depth added 5). 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.
openfang_api::routes::send_message (cognitive 18) crates/openfang-api/src/routes.rs:340— openfang_api::routes::send_message has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Duplicated block (9 lines × 2) crates/openfang-api/src/routes.rs:929— crates/openfang-api/src/routes.rs:929-937 | crates/openfang-api/src/routes.rs:1152-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/openfang-api/src/routes.rs:5834— crates/openfang-api/src/routes.rs:5834-5842 | crates/openfang-api/src/routes.rs:5862-5870 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:7542— crates/openfang-api/src/routes.rs:7542-7550 | crates/openfang-api/src/routes.rs:7627-7635 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/bluesky.rs:80— crates/openfang-channels/src/bluesky.rs:80-88 | crates/openfang-channels/src/nextcloud.rs:57-65 — 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 (9 lines × 2) crates/openfang-channels/src/keybase.rs:215— crates/openfang-channels/src/keybase.rs:215-223 | crates/openfang-channels/src/reddit.rs:347-355 — 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 (9 lines × 2) crates/openfang-cli/src/main.rs:4412— crates/openfang-cli/src/main.rs:4412-4420 | crates/openfang-cli/src/main.rs:4481-4489 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/chat_runner.rs:310— crates/openfang-cli/src/tui/chat_runner.rs:310-318 | crates/openfang-cli/src/tui/mod.rs:2086-2094 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:415— crates/openfang-cli/src/tui/chat_runner.rs:415-423 | crates/openfang-cli/src/tui/mod.rs:1904-1912 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/openfang-cli/src/tui/screens/wizard.rs:613— crates/openfang-cli/src/tui/screens/wizard.rs:613-621 | crates/openfang-cli/src/tui/screens/wizard.rs:661-669 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/apply_patch.rs:434— crates/openfang-runtime/src/apply_patch.rs:434-442 | crates/openfang-runtime/src/apply_patch.rs:454-462 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/browser.rs:455— crates/openfang-runtime/src/browser.rs:455-463 | crates/openfang-runtime/src/browser.rs:498-506 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/anthropic.rs:283— crates/openfang-runtime/src/drivers/anthropic.rs:283-291 | crates/openfang-runtime/src/drivers/vertex.rs:551-559 — before extracting anything, compare `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/vertex.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:723— crates/openfang-runtime/src/drivers/gemini.rs:723-731 | crates/openfang-runtime/src/drivers/gemini.rs:812-820 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/subprocess_sandbox.rs:683— crates/openfang-runtime/src/subprocess_sandbox.rs:683-691 | crates/openfang-runtime/src/subprocess_sandbox.rs:710-718 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/skills.rs:748— crates/openfang-cli/src/tui/screens/skills.rs:748-756 | crates/openfang-cli/src/tui/screens/usage.rs:420-428 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/skills.rs` and `crates/openfang-cli/src/tui/screens/usage.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/openfang-channels/src/twist.rs:128— crates/openfang-channels/src/twist.rs:128-136 | crates/openfang-channels/src/twist.rs:155-166 — both copies are in the same file, so extract the 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) crates/openfang-skills/src/marketplace.rs:52— crates/openfang-skills/src/marketplace.rs:52-62 | crates/openfang-skills/src/marketplace.rs:124-132 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/agent_loop.rs:2455— crates/openfang-runtime/src/agent_loop.rs:2455-2464 | crates/openfang-runtime/src/agent_loop.rs:2516-2524 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/tool_runner.rs:212— crates/openfang-runtime/src/tool_runner.rs:212-221 | crates/openfang-runtime/src/tool_runner.rs:380-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/openfang-cli/src/main.rs:6126— crates/openfang-cli/src/main.rs:6126-6134 | crates/openfang-cli/src/main.rs:6631-6639 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/browser.rs:886— crates/openfang-runtime/src/browser.rs:886-894 | crates/openfang-runtime/src/browser.rs:919-927 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:7561— crates/openfang-api/src/routes.rs:7561-7569 | crates/openfang-api/src/routes.rs:7649-7657 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/main.rs:6141— crates/openfang-cli/src/main.rs:6141-6149 | crates/openfang-cli/src/main.rs:6646-6654 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/openai.rs:925— crates/openfang-runtime/src/drivers/openai.rs:925-933 | crates/openfang-runtime/src/drivers/openai.rs:945-953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/openfang-cli/src/tui/screens/memory.rs:455— crates/openfang-cli/src/tui/screens/memory.rs:455-463 | crates/openfang-cli/src/tui/screens/workflows.rs:584-592 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/memory.rs` and `crates/openfang-cli/src/tui/screens/workflows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
MethodTooLong: OpenFangKernel.boot_with_config crates/openfang-kernel/src/kernel.rs:590— MethodTooLong — boot_with_config runs 629 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 529 over it, 6.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIDriver.stream crates/openfang-runtime/src/drivers/openai.rs:903— MethodTooLong — stream runs 403 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 303 over it, 4.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.
MethodTooLong: OpenFangKernel.send_message_streaming crates/openfang-kernel/src/kernel.rs:1984— MethodTooLong — send_message_streaming runs 349 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: KernelConfig.validate crates/openfang-types/src/config.rs:3382— MethodTooLong — validate runs 307 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIDriver.complete crates/openfang-runtime/src/drivers/openai.rs:452— MethodTooLong — complete runs 304 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 204 over it, 3.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GeminiDriver.stream crates/openfang-runtime/src/drivers/gemini.rs:749— MethodTooLong — stream runs 291 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 191 over it, 2.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenFangKernel.execute_llm_agent crates/openfang-kernel/src/kernel.rs:2631— MethodTooLong — execute_llm_agent runs 287 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 187 over it, 2.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: App.handle_event crates/openfang-cli/src/tui/mod.rs:227— MethodTooLong — handle_event runs 285 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AnthropicDriver.stream crates/openfang-runtime/src/drivers/anthropic.rs:304— MethodTooLong — stream runs 239 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenFangKernel.start_background_agents crates/openfang-kernel/src/kernel.rs:4390— MethodTooLong — start_background_agents runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 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.
MethodTooLong: App.handle_key crates/openfang-cli/src/tui/mod.rs:617— MethodTooLong — handle_key runs 186 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 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.
MethodTooLong: OpenFangKernel.activate_hand crates/openfang-kernel/src/kernel.rs:3754— MethodTooLong — activate_hand runs 159 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SemanticStore.recall_with_embedding crates/openfang-memory/src/semantic.rs:186— MethodTooLong — recall_with_embedding runs 151 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ClaudeCodeDriver.stream crates/openfang-runtime/src/drivers/claude_code.rs:498— MethodTooLong — stream runs 143 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenFangKernel.referenced_providers crates/openfang-kernel/src/kernel.rs:5339— MethodTooLong — referenced_providers runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenFangKernel.resolve_driver crates/openfang-kernel/src/kernel.rs:5562— MethodTooLong — resolve_driver runs 137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: App.handle_slash_command crates/openfang-cli/src/tui/mod.rs:2014— MethodTooLong — handle_slash_command runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ClawHubClient.install_with_options crates/openfang-skills/src/clawhub.rs:523— MethodTooLong — install_with_options runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SetupWizard.build_plan crates/openfang-kernel/src/wizard.rs:55— MethodTooLong — build_plan runs 124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenFangKernel.cron_run_job crates/openfang-kernel/src/kernel.rs:6573— MethodTooLong — cron_run_job runs 122 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 22 over it, 1.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.
MethodTooLong: OpenFangKernel.spawn_agent_with_parent crates/openfang-kernel/src/kernel.rs:1601— MethodTooLong — spawn_agent_with_parent runs 120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 20 over it, 1.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.
MethodTooLong: ClaudeCodeDriver.complete crates/openfang-runtime/src/drivers/claude_code.rs:307— MethodTooLong — complete runs 119 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenFangKernel.available_tools_with_registry crates/openfang-kernel/src/kernel.rs:6148— MethodTooLong — available_tools_with_registry runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StructuredStore.load_all_agents crates/openfang-memory/src/structured.rs:262— MethodTooLong — load_all_agents runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VertexAIDriver.stream crates/openfang-runtime/src/drivers/vertex.rs:572— MethodTooLong — stream runs 107 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
openfang_runtime::tool_runner::execute_tool (cyclomatic 106) crates/openfang-runtime/src/tool_runner.rs:109— openfang_runtime::tool_runner::execute_tool has cyclomatic complexity 106 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
openfang_runtime::agent_loop::recover_text_tool_calls (cyclomatic 89) crates/openfang-runtime/src/agent_loop.rs:2387— openfang_runtime::agent_loop::recover_text_tool_calls has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_runtime::agent_loop::run_agent_loop_streaming (cyclomatic 68) crates/openfang-runtime/src/agent_loop.rs:1520— openfang_runtime::agent_loop::run_agent_loop_streaming has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_runtime::agent_loop::run_agent_loop (cyclomatic 65) crates/openfang-runtime/src/agent_loop.rs:293— openfang_runtime::agent_loop::run_agent_loop has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_runtime::llm_errors::classify_error (cyclomatic 35) crates/openfang-runtime/src/llm_errors.rs:243— openfang_runtime::llm_errors::classify_error has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_runtime::prompt_builder::build_system_prompt (cyclomatic 34) crates/openfang-runtime/src/prompt_builder.rs:76— openfang_runtime::prompt_builder::build_system_prompt 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. This is NOT this file's highest cyclomatic complexity: openfang_runtime::prompt_builder::tool_hint (cyclomatic 47) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_runtime::apply_patch::parse_patch (cyclomatic 32) crates/openfang-runtime/src/apply_patch.rs:106— openfang_runtime::apply_patch::parse_patch 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.
openfang_runtime::tool_runner::tool_channel_send (cyclomatic 32) crates/openfang-runtime/src/tool_runner.rs:2463— openfang_runtime::tool_runner::tool_channel_send has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
openfang_runtime::session_repair::reorder_tool_results (cyclomatic 31) crates/openfang-runtime/src/session_repair.rs:232— openfang_runtime::session_repair::reorder_tool_results 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.
openfang_runtime::drivers::create_driver (cyclomatic 28) crates/openfang-runtime/src/drivers/mod.rs:333— openfang_runtime::drivers::create_driver has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_runtime::drivers::provider_defaults (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_runtime::drivers::bedrock::relocate_stray_tool_results (cyclomatic 26) crates/openfang-runtime/src/drivers/bedrock.rs:397— openfang_runtime::drivers::bedrock::relocate_stray_tool_results 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.
openfang_runtime::tool_runner::parse_schedule_to_cron (cyclomatic 26) crates/openfang-runtime/src/tool_runner.rs:2147— openfang_runtime::tool_runner::parse_schedule_to_cron 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.
openfang_runtime::python_runtime::run_python_agent (cyclomatic 23) crates/openfang-runtime/src/python_runtime.rs:122— openfang_runtime::python_runtime::run_python_agent has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_runtime::agent_loop::call_with_retry (cyclomatic 21) crates/openfang-runtime/src/agent_loop.rs:1155— openfang_runtime::agent_loop::call_with_retry has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (openfang_runtime::agent_loop::stream_with_retry) 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.
openfang_runtime::agent_loop::stream_with_retry (cyclomatic 21) crates/openfang-runtime/src/agent_loop.rs:1339— openfang_runtime::agent_loop::stream_with_retry has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (openfang_runtime::agent_loop::call_with_retry) 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.
openfang_runtime::compactor::build_conversation_text (cyclomatic 21) crates/openfang-runtime/src/compactor.rs:327— openfang_runtime::compactor::build_conversation_text 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.
openfang_runtime::context_budget::apply_context_guard (cyclomatic 20) crates/openfang-runtime/src/context_budget.rs:101— openfang_runtime::context_budget::apply_context_guard 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.
openfang_runtime::subprocess_sandbox::wait_or_kill_with_idle (cyclomatic 20) crates/openfang-runtime/src/subprocess_sandbox.rs:594— openfang_runtime::subprocess_sandbox::wait_or_kill_with_idle 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.
openfang_runtime::apply_patch::apply_patch (cyclomatic 19) crates/openfang-runtime/src/apply_patch.rs:282— openfang_runtime::apply_patch::apply_patch 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.
openfang_runtime::drivers::gemini::sanitize_gemini_turns (cyclomatic 19) crates/openfang-runtime/src/drivers/gemini.rs:387— openfang_runtime::drivers::gemini::sanitize_gemini_turns 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.
openfang_runtime::drivers::openai::assemble_assistant_message (cyclomatic 18) crates/openfang-runtime/src/drivers/openai.rs:326— openfang_runtime::drivers::openai::assemble_assistant_message 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.
openfang_runtime::shell_bleed::extract_env_var_refs (cyclomatic 18) crates/openfang-runtime/src/shell_bleed.rs:183— openfang_runtime::shell_bleed::extract_env_var_refs 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.
openfang_runtime::context_overflow::safe_drain_boundary (cyclomatic 17) crates/openfang-runtime/src/context_overflow.rs:26— openfang_runtime::context_overflow::safe_drain_boundary 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.
openfang_runtime::session_repair::insert_synthetic_results (cyclomatic 17) crates/openfang-runtime/src/session_repair.rs:381— openfang_runtime::session_repair::insert_synthetic_results 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.
openfang_runtime::context_overflow::recover_from_overflow (cyclomatic 16) crates/openfang-runtime/src/context_overflow.rs:117— openfang_runtime::context_overflow::recover_from_overflow 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.
Duplicated block (12 lines × 2) crates/openfang-api/src/routes.rs:10910— crates/openfang-api/src/routes.rs:10910-10921 | crates/openfang-api/src/routes.rs:10940-10951 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:11377— crates/openfang-api/src/routes.rs:11377-11388 | crates/openfang-api/src/routes.rs:11408-11419 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/channels.rs:471— crates/openfang-cli/src/tui/screens/channels.rs:471-482 | crates/openfang-cli/src/tui/screens/channels.rs:498-509 — both copies are in the same file, so extract the 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) crates/openfang-kernel/src/kernel.rs:2074— crates/openfang-kernel/src/kernel.rs:2074-2085 | crates/openfang-kernel/src/kernel.rs:2660-2671 — both copies are in the same file, so extract the 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) crates/openfang-kernel/src/kernel.rs:6643— crates/openfang-kernel/src/kernel.rs:6643-6654 | crates/openfang-kernel/src/kernel.rs:6711-6722 — both copies are in the same file, so extract the 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) crates/openfang-kernel/src/pairing.rs:213— crates/openfang-kernel/src/pairing.rs:213-224 | crates/openfang-kernel/src/pairing.rs:269-280 — both copies are in the same file, so extract the 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) crates/openfang-memory/src/http_client.rs:169— crates/openfang-memory/src/http_client.rs:169-180 | crates/openfang-memory/src/http_client.rs:217-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/openfang-migrate/src/openclaw.rs:1470— crates/openfang-migrate/src/openclaw.rs:1470-1481 | crates/openfang-migrate/src/openclaw.rs:1590-1601 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:3111— crates/openfang-migrate/src/openclaw.rs:3111-3122 | crates/openfang-migrate/src/openclaw.rs:3163-3174 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/anthropic.rs:228— crates/openfang-runtime/src/drivers/anthropic.rs:228-239 | crates/openfang-runtime/src/drivers/anthropic.rs:335-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/openfang-runtime/src/drivers/claude_code.rs:119— crates/openfang-runtime/src/drivers/claude_code.rs:119-130 | crates/openfang-runtime/src/drivers/qwen_code.rs:77-88 — before extracting anything, compare `crates/openfang-runtime/src/drivers/claude_code.rs` and `crates/openfang-runtime/src/drivers/qwen_code.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:493— crates/openfang-runtime/src/drivers/gemini.rs:493-504 | crates/openfang-runtime/src/drivers/vertex.rs:395-406 — before extracting anything, compare `crates/openfang-runtime/src/drivers/gemini.rs` and `crates/openfang-runtime/src/drivers/vertex.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:662— crates/openfang-runtime/src/drivers/openai.rs:662-673 | crates/openfang-runtime/src/drivers/openai.rs:1088-1100 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/openai.rs:676— crates/openfang-runtime/src/drivers/openai.rs:676-687 | crates/openfang-runtime/src/drivers/openai.rs:1103-1114 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/host_functions.rs:141— crates/openfang-runtime/src/host_functions.rs:141-152 | crates/openfang-runtime/src/host_functions.rs:188-199 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:10340— crates/openfang-api/src/routes.rs:10340-10351 | crates/openfang-api/src/routes.rs:10442-10455 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/linkedin.rs:172— crates/openfang-channels/src/linkedin.rs:172-184 | crates/openfang-channels/src/webhook.rs:346-357 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/openfang-cli/src/tui/screens/comms.rs:571— crates/openfang-cli/src/tui/screens/comms.rs:571-582 | crates/openfang-cli/src/tui/screens/comms.rs:646-657 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/agent_loop.rs:958— crates/openfang-runtime/src/agent_loop.rs:958-969 | crates/openfang-runtime/src/agent_loop.rs:2167-2178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/openfang-runtime/src/subprocess_sandbox.rs:363— crates/openfang-runtime/src/subprocess_sandbox.rs:363-374 | crates/openfang-runtime/src/subprocess_sandbox.rs:383-394 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/init_wizard.rs:2171— crates/openfang-cli/src/tui/screens/init_wizard.rs:2171-2182 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2187-2198 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/claude_code.rs:219— crates/openfang-runtime/src/drivers/claude_code.rs:219-230 | crates/openfang-runtime/src/drivers/qwen_code.rs:155-166 — before extracting anything, compare `crates/openfang-runtime/src/drivers/claude_code.rs` and `crates/openfang-runtime/src/drivers/qwen_code.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/openfang-skills/src/loader.rs:261— crates/openfang-skills/src/loader.rs:261-272 | crates/openfang-skills/src/loader.rs:292-303 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/event.rs:1375— crates/openfang-cli/src/tui/event.rs:1375-1386 | crates/openfang-cli/src/tui/event.rs:1405-1416 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:3973— crates/openfang-api/src/routes.rs:3973-3984 | crates/openfang-api/src/routes.rs:4047-4058 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:2992— crates/openfang-api/src/routes.rs:2992-2996 | crates/openfang-api/src/routes.rs:3008-3012 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:11172— crates/openfang-api/src/routes.rs:11172-11176 | crates/openfang-api/src/routes.rs:11184-11188 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/wecom.rs:266— crates/openfang-channels/src/wecom.rs:266-270 | crates/openfang-channels/src/wecom.rs:314-318 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/launcher.rs:454— crates/openfang-cli/src/launcher.rs:454-458 | crates/openfang-cli/src/tui/screens/welcome.rs:370-374 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/welcome.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/openfang-cli/src/main.rs:2054— crates/openfang-cli/src/main.rs:2054-2058 | crates/openfang-cli/src/main.rs:6719-6723 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/main.rs:6233— crates/openfang-cli/src/main.rs:6233-6237 | crates/openfang-cli/src/main.rs:6252-6256 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/chat_runner.rs:61— crates/openfang-cli/src/tui/chat_runner.rs:61-65 | crates/openfang-cli/src/tui/mod.rs:228-232 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:527— crates/openfang-cli/src/tui/chat_runner.rs:527-532 | crates/openfang-cli/src/tui/mod.rs:1752-1756 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/openfang-cli/src/tui/screens/audit.rs:241— crates/openfang-cli/src/tui/screens/audit.rs:241-245 | crates/openfang-cli/src/tui/screens/dashboard.rs:203-207 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/dashboard.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1518— crates/openfang-cli/src/tui/screens/init_wizard.rs:1518-1522 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1548-1552 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/wizard.rs:236— crates/openfang-cli/src/tui/screens/wizard.rs:236-240 | crates/openfang-cli/src/tui/screens/wizard.rs:247-251 — both copies are in the same file, so extract the 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) crates/openfang-extensions/src/vault.rs:441— crates/openfang-extensions/src/vault.rs:441-445 | crates/openfang-extensions/src/vault.rs:481-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/openfang-memory/src/knowledge.rs:127— crates/openfang-memory/src/knowledge.rs:127-131 | crates/openfang-memory/src/semantic.rs:262-266 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/openfang-memory/src/session.rs:157— crates/openfang-memory/src/session.rs:157-161 | crates/openfang-memory/src/structured.rs:282-286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/openfang-runtime/src/web_content.rs:292— crates/openfang-runtime/src/web_content.rs:292-296 | crates/openfang-runtime/src/web_content.rs:300-304 — both copies are in the same file, so extract the 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) crates/openfang-hands/src/registry.rs:26— crates/openfang-hands/src/registry.rs:26-30 | crates/openfang-types/src/manifest_signing.rs:39-43 — 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) crates/openfang-channels/src/nextcloud.rs:81— crates/openfang-channels/src/nextcloud.rs:81-85 | crates/openfang-channels/src/nextcloud.rs:100-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1851— crates/openfang-cli/src/tui/screens/init_wizard.rs:1851-1855 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1859-1863 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:2722— crates/openfang-migrate/src/openclaw.rs:2722-2726 | crates/openfang-migrate/src/openclaw.rs:2741-2745 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/browser.rs:927— crates/openfang-runtime/src/browser.rs:927-931 | crates/openfang-runtime/src/browser.rs:1115-1119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/openfang-memory/src/knowledge.rs:103— crates/openfang-memory/src/knowledge.rs:103-107 | crates/openfang-memory/src/knowledge.rs:116-120 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:1741— crates/openfang-migrate/src/openclaw.rs:1741-1745 | crates/openfang-migrate/src/openclaw.rs:1853-1857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/openfang-api/src/channel_bridge.rs:280— crates/openfang-api/src/channel_bridge.rs:280-284 | crates/openfang-cli/src/tui/mod.rs:2165-2169 — 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) crates/openfang-api/src/stream_chunker.rs:81— crates/openfang-api/src/stream_chunker.rs:81-85 | crates/openfang-api/src/stream_chunker.rs:89-93 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/main.rs:1807— crates/openfang-cli/src/main.rs:1807-1811 | crates/openfang-cli/src/main.rs:2076-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 2 more in this group — see findings.md.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×26
Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css:49— `.card` moves (`transition: border-color var(--transition-fast), transform 0.2s var(--ease-spring), box-shadow var(--transition-fast)`) 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 crates/openfang-api/static/css/components.css:257— `.modal` moves (`animation: scaleIn 0.2s var(--ease-spring)`) 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 crates/openfang-api/static/css/components.css:304— `.message` moves (`animation: slideUp 0.25s var(--ease-smooth)`) 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 crates/openfang-api/static/css/components.css:461— `.typing-dots span` moves (`animation: typing-bounce 1.4s ease-in-out 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 crates/openfang-api/static/css/components.css:688— `.tool-card` moves (`animation: slideUp 0.2s var(--ease-smooth)`) 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 crates/openfang-api/static/css/components.css:751— `.tool-card-spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css:783— `.tool-card-body` moves (`animation: slideDown 0.15s var(--ease-smooth)`) 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 crates/openfang-api/static/css/components.css:969— `.model-switcher-chevron` moves (`transition: transform 0.2s`) 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 crates/openfang-api/static/css/components.css:1137— `.spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css:1162— `.toggle::after` moves (`transition: transform 0.2s`) 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 crates/openfang-api/static/css/components.css:1239— `.stat-card` moves (`transition: transform 0.2s var(--ease-spring), box-shadow var(--transition-fast), border-color var(--transition-fast)`) 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 crates/openfang-api/static/css/components.css:1571— `.stat-card-lg` moves (`transition: transform 0.3s var(--ease-spring), box-shadow var(--transition-fast)`) 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 crates/openfang-api/static/css/components.css:1661— `.live-indicator.live .live-dot` moves (`animation: live-pulse 1.5s ease-in-out 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 crates/openfang-api/static/css/components.css:1729— `.toast` moves (`animation: toastIn 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 crates/openfang-api/static/css/components.css:1742— `.toast-dismiss` moves (`animation: toastOut 0.3s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css:2307— `.wizard-progress-line-fill` moves (`transition: width 0.4s 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 crates/openfang-api/static/css/components.css:2365— `.page-body` moves (`animation: slideIn 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css:2372— `.skeleton` moves (`animation: shimmer 1.5s ease-in-out 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 crates/openfang-api/static/css/components.css:2464— `.message-image` moves (`transition: transform 0.15s`) 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 crates/openfang-api/static/css/components.css:2486— `.progress-bar-fill` moves (`transition: width 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 crates/openfang-api/static/css/components.css:2685— `.skeleton-stat` moves (`animation: shimmer 1.5s ease-in-out 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 crates/openfang-api/static/css/components.css:2686— `.skeleton-table` moves (`animation: shimmer 1.5s ease-in-out 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 crates/openfang-api/static/css/components.css:3002— `.dep-progress-fill` moves (`transition: width 0.4s 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 crates/openfang-api/static/css/components.css:3045— `.spinner-sm` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/openfang-api/static/css/components.css:3417— `.confidence-bar` moves (`transition: width 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.
Duplicated block (11 lines × 2) crates/openfang-channels/src/dingtalk.rs:79— crates/openfang-channels/src/dingtalk.rs:79-89 | crates/openfang-channels/src/webhook.rs:102-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/openfang-channels/src/feishu.rs:233— crates/openfang-channels/src/feishu.rs:233-243 | crates/openfang-channels/src/feishu.rs:291-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-channels/src/line.rs:370— crates/openfang-channels/src/line.rs:370-380 | crates/openfang-channels/src/messenger.rs:275-285 — before extracting anything, compare `crates/openfang-channels/src/line.rs` and `crates/openfang-channels/src/messenger.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-channels/src/viber.rs:189— crates/openfang-channels/src/viber.rs:189-199 | crates/openfang-channels/src/viber.rs:396-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/main.rs:5142— crates/openfang-cli/src/main.rs:5142-5152 | crates/openfang-cli/src/main.rs:5210-5220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/main.rs:5713— crates/openfang-cli/src/main.rs:5713-5723 | crates/openfang-cli/src/main.rs:6176-6186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:110— crates/openfang-cli/src/tui/chat_runner.rs:110-120 | crates/openfang-cli/src/tui/mod.rs:1145-1155 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-cli/src/tui/screens/agents.rs:671— crates/openfang-cli/src/tui/screens/agents.rs:671-681 | crates/openfang-cli/src/tui/screens/agents.rs:722-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/tui/screens/agents.rs:697— crates/openfang-cli/src/tui/screens/agents.rs:697-707 | crates/openfang-cli/src/tui/screens/agents.rs:759-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/tui/screens/settings.rs:575— crates/openfang-cli/src/tui/screens/settings.rs:575-585 | crates/openfang-cli/src/tui/screens/skills.rs:644-654 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/settings.rs` and `crates/openfang-cli/src/tui/screens/skills.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-migrate/src/openclaw.rs:2237— crates/openfang-migrate/src/openclaw.rs:2237-2247 | crates/openfang-migrate/src/openclaw.rs:2307-2317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-runtime/src/drivers/claude_code.rs:735— crates/openfang-runtime/src/drivers/claude_code.rs:735-745 | crates/openfang-runtime/src/drivers/qwen_code.rs:435-445 — before extracting anything, compare `crates/openfang-runtime/src/drivers/claude_code.rs` and `crates/openfang-runtime/src/drivers/qwen_code.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-runtime/src/web_content.rs:310— crates/openfang-runtime/src/web_content.rs:310-320 | crates/openfang-runtime/src/web_search.rs:552-562 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/openfang-wire/src/peer.rs:238— crates/openfang-wire/src/peer.rs:238-248 | crates/openfang-wire/src/peer.rs:372-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-channels/src/bluesky.rs:321— crates/openfang-channels/src/bluesky.rs:321-331 | crates/openfang-channels/src/mastodon.rs:244-257 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/mastodon.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-cli/src/main.rs:1965— crates/openfang-cli/src/main.rs:1965-1975 | crates/openfang-cli/src/main.rs:3976-3987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:612— crates/openfang-runtime/src/drivers/openai.rs:612-622 | crates/openfang-runtime/src/drivers/openai.rs:1037-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-api/src/routes.rs:10026— crates/openfang-api/src/routes.rs:10026-10037 | crates/openfang-api/src/routes.rs:10299-10309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/tui/screens/hands.rs:300— crates/openfang-cli/src/tui/screens/hands.rs:300-310 | crates/openfang-cli/src/tui/screens/templates.rs:332-343 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/templates.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-migrate/src/openclaw.rs:1508— crates/openfang-migrate/src/openclaw.rs:1508-1518 | crates/openfang-migrate/src/openclaw.rs:1543-1554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-channels/src/discourse.rs:206— crates/openfang-channels/src/discourse.rs:206-216 | crates/openfang-channels/src/linkedin.rs:246-256 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/openfang-kernel/src/kernel.rs:7761— crates/openfang-kernel/src/kernel.rs:7761-7771 | crates/openfang-kernel/src/kernel.rs:7816-7826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-runtime/src/drivers/anthropic.rs:241— crates/openfang-runtime/src/drivers/anthropic.rs:241-251 | crates/openfang-runtime/src/drivers/anthropic.rs:348-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/openfang-cli/src/main.rs:2502— crates/openfang-cli/src/main.rs:2502-2512 | crates/openfang-cli/src/main.rs:2569-2579 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:4356— crates/openfang-api/src/routes.rs:4356-4368 | crates/openfang-api/src/routes.rs:4436-4448 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:4728— crates/openfang-api/src/routes.rs:4728-4740 | crates/openfang-api/src/routes.rs:4768-4780 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/bluesky.rs:110— crates/openfang-channels/src/bluesky.rs:110-122 | crates/openfang-channels/src/bluesky.rs:151-163 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/irc.rs:191— crates/openfang-channels/src/irc.rs:191-203 | crates/openfang-channels/src/mattermost.rs:200-212 — before extracting anything, compare `crates/openfang-channels/src/irc.rs` and `crates/openfang-channels/src/mattermost.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/openfang-channels/src/irc.rs:240— crates/openfang-channels/src/irc.rs:240-252 | crates/openfang-channels/src/mattermost.rs:248-260 — before extracting anything, compare `crates/openfang-channels/src/irc.rs` and `crates/openfang-channels/src/mattermost.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/openfang-channels/src/line.rs:193— crates/openfang-channels/src/line.rs:193-205 | crates/openfang-channels/src/line.rs:483-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 (13 lines × 2) crates/openfang-cli/src/main.rs:5467— crates/openfang-cli/src/main.rs:5467-5479 | crates/openfang-cli/src/main.rs:5491-5503 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/logs.rs:376— crates/openfang-cli/src/tui/screens/logs.rs:376-388 | crates/openfang-cli/src/tui/screens/peers.rs:183-195 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/logs.rs` and `crates/openfang-cli/src/tui/screens/peers.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/openfang-kernel/src/kernel.rs:2122— crates/openfang-kernel/src/kernel.rs:2122-2134 | crates/openfang-kernel/src/kernel.rs:2697-2709 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:2117— crates/openfang-migrate/src/openclaw.rs:2117-2129 | crates/openfang-migrate/src/openclaw.rs:3088-3100 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:2351— crates/openfang-migrate/src/openclaw.rs:2351-2363 | crates/openfang-migrate/src/openclaw.rs:3171-3183 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/vertex.rs:518— crates/openfang-runtime/src/drivers/vertex.rs:518-530 | crates/openfang-runtime/src/drivers/vertex.rs:597-609 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/tool_runner.rs:1612— crates/openfang-runtime/src/tool_runner.rs:1612-1624 | crates/openfang-runtime/src/web_search.rs:313-325 — 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) crates/openfang-channels/src/discord.rs:682— crates/openfang-channels/src/discord.rs:682-695 | crates/openfang-channels/src/mattermost.rs:392-404 — 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) crates/openfang-runtime/src/agent_loop.rs:1241— crates/openfang-runtime/src/agent_loop.rs:1241-1255 | crates/openfang-runtime/src/agent_loop.rs:1427-1439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/openfang-api/src/routes.rs:5004— crates/openfang-api/src/routes.rs:5004-5017 | crates/openfang-api/src/routes.rs:5075-5087 — both copies are in the same file, so extract the 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) crates/openfang-kernel/src/background.rs:72— crates/openfang-kernel/src/background.rs:72-85 | crates/openfang-kernel/src/background.rs:134-146 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/agent_loop.rs:2434— crates/openfang-runtime/src/agent_loop.rs:2434-2447 | crates/openfang-runtime/src/agent_loop.rs:2497-2509 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/agent_loop.rs:2575— crates/openfang-runtime/src/agent_loop.rs:2575-2587 | crates/openfang-runtime/src/agent_loop.rs:2877-2889 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/memory.rs:423— crates/openfang-cli/src/tui/screens/memory.rs:423-435 | crates/openfang-cli/src/tui/screens/templates.rs:380-392 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/memory.rs` and `crates/openfang-cli/src/tui/screens/templates.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/openfang-skills/src/loader.rs:60— crates/openfang-skills/src/loader.rs:60-72 | crates/openfang-skills/src/loader.rs:312-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-api/src/routes.rs:3479— crates/openfang-api/src/routes.rs:3479-3484 | crates/openfang-api/src/routes.rs:3501-3506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-channels/src/bluesky.rs:100— crates/openfang-channels/src/bluesky.rs:100-105 | crates/openfang-channels/src/gotify.rs:114-119 — 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 (6 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:167— crates/openfang-cli/src/tui/chat_runner.rs:167-172 | crates/openfang-cli/src/tui/mod.rs:1202-1208 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:534— crates/openfang-cli/src/tui/chat_runner.rs:534-539 | crates/openfang-cli/src/tui/mod.rs:1758-1763 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/openfang-cli/src/tui/screens/agents.rs:1424— crates/openfang-cli/src/tui/screens/agents.rs:1424-1429 | crates/openfang-cli/src/tui/screens/channels.rs:635-640 — 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 (6 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:467— crates/openfang-cli/src/tui/screens/init_wizard.rs:467-472 | crates/openfang-cli/src/tui/screens/init_wizard.rs:478-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-extensions/src/oauth.rs:273— crates/openfang-extensions/src/oauth.rs:273-278 | crates/openfang-skills/src/clawhub.rs:741-746 — 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) crates/openfang-memory/src/session.rs:79— crates/openfang-memory/src/session.rs:79-84 | crates/openfang-memory/src/session.rs:495-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-memory/src/substrate.rs:63— crates/openfang-memory/src/substrate.rs:63-68 | crates/openfang-memory/src/substrate.rs:117-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-migrate/src/openclaw.rs:2107— crates/openfang-migrate/src/openclaw.rs:2107-2112 | crates/openfang-migrate/src/openclaw.rs:3078-3083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-runtime/src/a2a.rs:467— crates/openfang-runtime/src/a2a.rs:467-473 | crates/openfang-runtime/src/a2a.rs:501-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:453— crates/openfang-runtime/src/drivers/openai.rs:453-459 | crates/openfang-runtime/src/drivers/openai.rs:909-914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:813— crates/openfang-runtime/src/drivers/openai.rs:813-818 | crates/openfang-runtime/src/drivers/openai.rs:1418-1423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-memory/src/semantic.rs:501— crates/openfang-memory/src/semantic.rs:501-506 | crates/openfang-runtime/src/embedding.rs:288-293 — before extracting anything, compare `crates/openfang-memory/src/semantic.rs` and `crates/openfang-runtime/src/embedding.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/openfang-api/src/routes.rs:11743— crates/openfang-api/src/routes.rs:11743-11748 | crates/openfang-api/src/routes.rs:11837-11845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-runtime/src/tool_runner.rs:2165— crates/openfang-runtime/src/tool_runner.rs:2165-2170 | crates/openfang-runtime/src/tool_runner.rs:2178-2183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-memory/src/knowledge.rs:106— crates/openfang-memory/src/knowledge.rs:106-111 | crates/openfang-memory/src/semantic.rs:246-251 — 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 (6 lines × 2) crates/openfang-channels/src/reddit.rs:140— crates/openfang-channels/src/reddit.rs:140-145 | crates/openfang-channels/src/teams.rs:113-118 — before extracting anything, compare `crates/openfang-channels/src/reddit.rs` and `crates/openfang-channels/src/teams.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/openfang-migrate/src/openclaw.rs:1463— crates/openfang-migrate/src/openclaw.rs:1463-1468 | crates/openfang-migrate/src/openclaw.rs:1817-1822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/openfang-api/src/routes.rs:7456— crates/openfang-api/src/routes.rs:7456-7461 | crates/openfang-api/src/routes.rs:7464-7469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Repeated repair: crates/openfang-types/src/model_catalog.rs crates/openfang-types/src/model_catalog.rs:92— crates/openfang-types/src/model_catalog.rs changed 17 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is ModelTier::fmt at line 92), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: 6 bugs (#962, #939, #983, #987, #970, #882)”; “lint fixes for 'cargo clippy --workspace --all-targets -- -D warnings' and 'cargo test --workspace'”; “community fixes”; “community fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-types/src/model_catalog.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-runtime/src/mcp.rs crates/openfang-runtime/src/mcp.rs:217— crates/openfang-runtime/src/mcp.rs changed 14 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is McpConnection::connect_stdio at line 217), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): pass HOME/TMP/TEMP to stdio MCP servers on all platforms”; “v0.5.7: multi-instance hands + 8 critical fixes”; “Revert unrelated mcp.rs rewrite and REDACTED changes”; “Fix silent reinforcement: recognize [SILENT] token in agent replies”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/mcp.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-kernel/src/cron.rs crates/openfang-kernel/src/cron.rs:444— crates/openfang-kernel/src/cron.rs changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is openfang_kernel::cron::compute_next_run_after at line 444), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix failed manual run pushing next_run and premature last_run in UI”; “fix streaming-think, cron-orphans”; “community fixes”; “batch fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-kernel/src/cron.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-cli/src/tui/screens/wizard.rs crates/openfang-cli/src/tui/screens/wizard.rs:277— crates/openfang-cli/src/tui/screens/wizard.rs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is WizardState::handle_provider at line 277), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(clippy): resolve upstream warnings breaking CI”; “fix: expose MiniMax in init provider lists”; “fix: use existing nvidia/llama-3.1-nemotron-70b-instruct as default model”; “claude code fix”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-cli/src/tui/screens/wizard.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-hands/src/lib.rs crates/openfang-hands/src/lib.rs:209— crates/openfang-hands/src/lib.rs changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is openfang_hands::resolve_settings at line 209), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v0.5.7: multi-instance hands + 8 critical fixes”; “bug fixes”; “fix: make heartbeat interval configurable and reduce researcher max_iterations”; “community fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-hands/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-types/src/message.rs crates/openfang-types/src/message.rs:208— crates/openfang-types/src/message.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is MessageContent::text_length at line 208), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix cargo fmt: join Image/Unknown match arms on single line”; “Fix token estimation: include ToolUse arguments in text_length”; “fix 11 issues”; “fix 6 issues”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-types/src/message.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-types/src/agent.rs crates/openfang-types/src/agent.rs:346— crates/openfang-types/src/agent.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ToolProfile::implied_capabilities at line 346), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kernel): sync all agent.toml fields to DB on restart (fixes #1087) (#1118)”; “fix(runtime): re-read agent context.md per turn so external updates take effect (#843) (#1075)”; “fix community PRs (inspired by #438 @pandego, #433 @ozekimasaki, #417 @f-liva, #392 @cryptonahue, #410 @hobostay, #413 @castorinop, #275 @woodcoal, #464 @citadelgrad, #419 @shipdocs, #480 @skeltavik, #439 @modship)”; “issue fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-types/src/agent.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-memory/src/session.rs crates/openfang-memory/src/session.rs:533— crates/openfang-memory/src/session.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is SessionStore::write_jsonl_mirror at line 533), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “integration fixes”; “fix 11 issues”; “fix 6 issues”; “fix 7 issues”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-memory/src/session.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-cli/src/tui/event.rs crates/openfang-cli/src/tui/event.rs:334— crates/openfang-cli/src/tui/event.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is openfang_cli::tui::event::spawn_daemon_stream at line 334), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v0.5.7: multi-instance hands + 8 critical fixes”; “fix: resolve 5 bugs + close 1 resolved (#771, #811, #752, #772, #661)”; “community fixes”; “batch fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-cli/src/tui/event.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-runtime/src/llm_driver.rs crates/openfang-runtime/src/llm_driver.rs:99— crates/openfang-runtime/src/llm_driver.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is CompletionResponse::has_any_content at line 99), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): add subprocess timeout config for claude-code driver”; “fix: resolve 6 open bugs (#834, #805, #820, #848, #826, #836)”; “bug fixes”; “fix 11 issues”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/llm_driver.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-runtime/src/drivers/copilot.rs crates/openfang-runtime/src/drivers/copilot.rs:207— crates/openfang-runtime/src/drivers/copilot.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is openfang_runtime::drivers::copilot::poll_for_token at line 207), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: resolve remaining clippy warnings blocking CI (ptr_arg, dead_code, map_or, collapsible_if)”; “fix: suppress pre-existing dead code and clippy warnings in openfang-runtime”; “fix: rewrite Copilot driver with OAuth device flow authentication”; “bugfix batch”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/drivers/copilot.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-cli/src/tui/screens/peers.rs crates/openfang-cli/src/tui/screens/peers.rs:84— crates/openfang-cli/src/tui/screens/peers.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is openfang_cli::tui::screens::peers::draw at line 84), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(clippy): resolve upstream warnings breaking CI”; “community fixes”; “critical fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-cli/src/tui/screens/peers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-skills/src/registry.rs crates/openfang-skills/src/registry.rs:182— crates/openfang-skills/src/registry.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is SkillRegistry::load_all at line 182), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: resolve 5 bugs + close 1 resolved (#875, #872, #867, #824, #833, #766)”; “fix: resolve CI failures after rebase on upstream/main”; “fix: resolve 7 more bugs (#825, #828, #856, #770, #774, #851/#808, #785)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-skills/src/registry.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-runtime/src/drivers/fallback.rs crates/openfang-runtime/src/drivers/fallback.rs:38— crates/openfang-runtime/src/drivers/fallback.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is FallbackDriver::complete at line 38), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v0.5.7: multi-instance hands + 8 critical fixes”; “fix 11 issues”; “batch fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/drivers/fallback.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-channels/src/line.rs crates/openfang-channels/src/line.rs:362— crates/openfang-channels/src/line.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is LineAdapter::start at line 362), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: ensure message history starts with a user turn for Gemini compatibility”; “Fix clippy: remove needless borrow in line.rs”; “fix: resolve 5 bugs + close 1 resolved (#771, #811, #752, #772, #661)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-channels/src/line.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-kernel/src/scheduler.rs crates/openfang-kernel/src/scheduler.rs:78— crates/openfang-kernel/src/scheduler.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is AgentScheduler::check_quota at line 78), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “community fixes”; “issue fixes”; “PR fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-kernel/src/scheduler.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-api/static/js/api.js crates/openfang-api/static/js/api.js:119— crates/openfang-api/static/js/api.js changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is api.friendlyError at line 119), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: resolve 7 more bugs (#825, #828, #856, #770, #774, #851/#808, #785)”; “fix: Fix the error when uploading files with Unicode characters in filenames”; “community fixes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-api/static/js/api.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/openfang-runtime/src/loop_guard.rs crates/openfang-runtime/src/loop_guard.rs:448— crates/openfang-runtime/src/loop_guard.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is LoopGuard::count_ping_pong_repeats at line 448), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: Fix the issue of duplicate tool calls with identical arguments in certain scenarios.”; “community fixes”; “fix issues”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-02-11..2026-05-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-11 21:42:08 +03:00' --until='2026-05-12 21:42:08 +03:00' --full-history --no-merges -- crates/openfang-runtime/src/loop_guard.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
OpenFangKernel::boot_with_config (cognitive 207) crates/openfang-kernel/src/kernel.rs:590— OpenFangKernel::boot_with_config has cognitive complexity 207 (threshold 15). Drivers by points: if/else 64 (129 pts), match/switch 23 (54 pts), loops 11 (18 pts), boolean chains 6 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenFangKernel::start_background_agents (cognitive 103) crates/openfang-kernel/src/kernel.rs:4390— OpenFangKernel::start_background_agents has cognitive complexity 103 (threshold 15). Drivers by points: if/else 31 (77 pts), loops 8 (12 pts), match/switch 4 (11 pts), boolean chains 3 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenFangKernel::send_message_streaming (cognitive 62) crates/openfang-kernel/src/kernel.rs:1984— OpenFangKernel::send_message_streaming has cognitive complexity 62 (threshold 15). Drivers by points: if/else 34 (52 pts), match/switch 4 (6 pts), boolean chains 4 (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.
OpenFangKernel::referenced_providers (cognitive 59) crates/openfang-kernel/src/kernel.rs:5339— OpenFangKernel::referenced_providers has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 13 (24 pts), boolean chains 6 (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.
OpenFangKernel::start_heartbeat_monitor (cognitive 57) crates/openfang-kernel/src/kernel.rs:4832— OpenFangKernel::start_heartbeat_monitor has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (52 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenFangKernel::execute_llm_agent (cognitive 56) crates/openfang-kernel/src/kernel.rs:2631— OpenFangKernel::execute_llm_agent has cognitive complexity 56 (threshold 15). Drivers by points: if/else 34 (51 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenFangKernel::resolve_driver (cognitive 43) crates/openfang-kernel/src/kernel.rs:5562— OpenFangKernel::resolve_driver has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 5, match/switch 3 (5 pts), loops 2 (nesting depth added 9). 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.
OpenFangKernel::activate_hand (cognitive 41) crates/openfang-kernel/src/kernel.rs:3754— OpenFangKernel::activate_hand has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (34 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenFangKernel::spawn_agent_with_parent (cognitive 35) crates/openfang-kernel/src/kernel.rs:1601— OpenFangKernel::spawn_agent_with_parent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 8, 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.
OpenFangKernel::available_tools_with_registry (cognitive 34) crates/openfang-kernel/src/kernel.rs:6148— OpenFangKernel::available_tools_with_registry has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 5, loops 2 (3 pts), match/switch 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.
OpenFangKernel::reload_extension_mcps (cognitive 20) crates/openfang-kernel/src/kernel.rs:5881— OpenFangKernel::reload_extension_mcps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 pts), match/switch 2 (4 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.
OpenFangKernel::cron_run_job (cognitive 19) crates/openfang-kernel/src/kernel.rs:6573— OpenFangKernel::cron_run_job has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OpenFangKernel::set_agent_mcp_servers (cognitive 18) crates/openfang-kernel/src/kernel.rs:3442— OpenFangKernel::set_agent_mcp_servers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (6 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.
OpenFangKernel::connect_mcp_servers (cognitive 18) crates/openfang-kernel/src/kernel.rs:5801— OpenFangKernel::connect_mcp_servers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenFangKernel::collect_prompt_context_from (cognitive 18) crates/openfang-kernel/src/kernel.rs:6525— OpenFangKernel::collect_prompt_context_from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenFangKernel::start_ofp_node (cognitive 17) crates/openfang-kernel/src/kernel.rs:4739— OpenFangKernel::start_ofp_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenFangKernel::set_agent_model (cognitive 16) crates/openfang-kernel/src/kernel.rs:3324— OpenFangKernel::set_agent_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
openfang_channels::bridge::dispatch_message (cognitive 148) crates/openfang-channels/src/bridge.rs:754— openfang_channels::bridge::dispatch_message has cognitive complexity 148 (threshold 15). Drivers by points: if/else 41 (87 pts), match/switch 18 (44 pts), loops 4 (14 pts), boolean chains 3 (nesting depth added 82). 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.
openfang_channels::bridge::handle_command (cognitive 62) crates/openfang-channels/src/bridge.rs:1934— openfang_channels::bridge::handle_command has cognitive complexity 62 (threshold 15). Drivers by points: if/else 20 (34 pts), match/switch 10 (16 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 26). 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.
openfang_channels::telegram::parse_telegram_update (cognitive 56) crates/openfang-channels/src/telegram.rs:843— openfang_channels::telegram::parse_telegram_update has cognitive complexity 56 (threshold 15). Drivers by points: if/else 28 (40 pts), match/switch 8 (13 pts), boolean chains 3 (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.
openfang_channels::formatter::markdown_to_telegram_html (cognitive 52) crates/openfang-channels/src/formatter.rs:32— openfang_channels::formatter::markdown_to_telegram_html has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 6 (15 pts), boolean chains 2 (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.
openfang_channels::bridge::dispatch_with_blocks (cognitive 43) crates/openfang-channels/src/bridge.rs:1699— openfang_channels::bridge::dispatch_with_blocks has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 7 (14 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_channels::dingtalk_stream::handle_frame (cognitive 36) crates/openfang-channels/src/dingtalk_stream.rs:466— openfang_channels::dingtalk_stream::handle_frame has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (34 pts), match/switch 2 (nesting depth added 25). 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.
openfang_channels::slack::parse_slack_event (cognitive 33) crates/openfang-channels/src/slack.rs:455— openfang_channels::slack::parse_slack_event has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 3, match/switch 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.
openfang_channels::discord::parse_discord_message (cognitive 32) crates/openfang-channels/src/discord.rs:819— openfang_channels::discord::parse_discord_message has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 2 (5 pts), boolean chains 4 (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.
openfang_channels::formatter::strip_inline_markdown (cognitive 30) crates/openfang-channels/src/formatter.rs:392— openfang_channels::formatter::strip_inline_markdown has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 4, loops 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.
openfang_channels::formatter::render_inline_markdown (cognitive 27) crates/openfang-channels/src/formatter.rs:161— openfang_channels::formatter::render_inline_markdown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_channels::telegram::sanitize_telegram_html (cognitive 24) crates/openfang-channels/src/telegram.rs:1146— openfang_channels::telegram::sanitize_telegram_html has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_channels::telegram::check_mention_entities (cognitive 23) crates/openfang-channels/src/telegram.rs:1105— openfang_channels::telegram::check_mention_entities has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (4 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.
openfang_channels::messenger::parse_messenger_entry (cognitive 21) crates/openfang-channels/src/messenger.rs:161— openfang_channels::messenger::parse_messenger_entry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_channels::email::fetch_unseen_emails (cognitive 20) crates/openfang-channels/src/email.rs:206— openfang_channels::email::fetch_unseen_emails has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 3 (6 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
openfang_channels::bridge::sanitize_agent_error (cognitive 17) crates/openfang-channels/src/bridge.rs:1457— openfang_channels::bridge::sanitize_agent_error has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7 (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.
openfang_channels::revolt::parse_revolt_message (cognitive 16) crates/openfang-channels/src/revolt.rs:205— openfang_channels::revolt::parse_revolt_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
openfang_cli::cmd_doctor (cyclomatic 189) crates/openfang-cli/src/main.rs:2124— openfang_cli::cmd_doctor has cyclomatic complexity 189 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_cli::main (cyclomatic 115) crates/openfang-cli/src/main.rs:921— openfang_cli::main has cyclomatic complexity 115 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
openfang_cli::tui::screens::init_wizard::run (cyclomatic 93) crates/openfang-cli/src/tui/screens/init_wizard.rs:659— openfang_cli::tui::screens::init_wizard::run has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_cli::tui::screens::chat::draw_messages (cyclomatic 34) crates/openfang-cli/src/tui/screens/chat.rs:598— openfang_cli::tui::screens::chat::draw_messages 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.
openfang_cli::cmd_channel_setup (cyclomatic 30) crates/openfang-cli/src/main.rs:3956— openfang_cli::cmd_channel_setup 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.
openfang_cli::cmd_uninstall (cyclomatic 21) crates/openfang-cli/src/main.rs:6796— openfang_cli::cmd_uninstall 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.
openfang_cli::tui::screens::init_wizard::draw_complete (cyclomatic 20) crates/openfang-cli/src/tui/screens/init_wizard.rs:2475— openfang_cli::tui::screens::init_wizard::draw_complete 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.
openfang_cli::tui::screens::skills::draw_installed (cyclomatic 20) crates/openfang-cli/src/tui/screens/skills.rs:362— openfang_cli::tui::screens::skills::draw_installed 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.
openfang_cli::tui::screens::init_wizard::handle_routing_key (cyclomatic 18) crates/openfang-cli/src/tui/screens/init_wizard.rs:1224— openfang_cli::tui::screens::init_wizard::handle_routing_key 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.
openfang_cli::launcher::draw (cyclomatic 17) crates/openfang-cli/src/launcher.rs:304— openfang_cli::launcher::draw 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.
openfang_cli::tui::screens::chat::draw_model_picker (cyclomatic 17) crates/openfang-cli/src/tui/screens/chat.rs:478— openfang_cli::tui::screens::chat::draw_model_picker 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.
openfang_cli::cmd_skill_install (cyclomatic 16) crates/openfang-cli/src/main.rs:3564— openfang_cli::cmd_skill_install 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.
openfang_cli::launcher::run (cyclomatic 16) crates/openfang-cli/src/launcher.rs:187— openfang_cli::launcher::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.
openfang_cli::tui::screens::welcome::draw (cyclomatic 16) crates/openfang-cli/src/tui/screens/welcome.rs:217— openfang_cli::tui::screens::welcome::draw 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.
Duplicated block (14 lines × 2) crates/openfang-api/src/routes.rs:7681— crates/openfang-api/src/routes.rs:7681-7694 | crates/openfang-api/src/routes.rs:7846-7859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-channels/src/discord.rs:136— crates/openfang-channels/src/discord.rs:136-149 | crates/openfang-channels/src/discord.rs:221-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-channels/src/feishu.rs:408— crates/openfang-channels/src/feishu.rs:408-421 | crates/openfang-channels/src/feishu.rs:453-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-channels/src/flock.rs:196— crates/openfang-channels/src/flock.rs:196-209 | crates/openfang-channels/src/threema.rs:136-149 — before extracting anything, compare `crates/openfang-channels/src/flock.rs` and `crates/openfang-channels/src/threema.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/openfang-channels/src/messenger.rs:197— crates/openfang-channels/src/messenger.rs:197-210 | crates/openfang-channels/src/viber.rs:256-269 — before extracting anything, compare `crates/openfang-channels/src/messenger.rs` and `crates/openfang-channels/src/viber.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/openfang-cli/src/tui/screens/memory.rs:482— crates/openfang-cli/src/tui/screens/memory.rs:482-495 | crates/openfang-cli/src/tui/screens/memory.rs:514-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-runtime/src/agent_loop.rs:330— crates/openfang-runtime/src/agent_loop.rs:330-343 | crates/openfang-runtime/src/agent_loop.rs:1558-1571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1318— crates/openfang-runtime/src/agent_loop.rs:1318-1331 | crates/openfang-runtime/src/agent_loop.rs:1499-1512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:550— crates/openfang-runtime/src/drivers/openai.rs:550-563 | crates/openfang-runtime/src/drivers/openai.rs:977-990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:625— crates/openfang-runtime/src/drivers/openai.rs:625-638 | crates/openfang-runtime/src/drivers/openai.rs:1051-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-cli/src/main.rs:6355— crates/openfang-cli/src/main.rs:6355-6368 | crates/openfang-cli/src/main.rs:6409-6422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:1082— crates/openfang-runtime/src/drivers/gemini.rs:1082-1095 | crates/openfang-runtime/src/drivers/openai.rs:1347-1360 — 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 lines × 2) crates/openfang-channels/src/discourse.rs:333— crates/openfang-channels/src/discourse.rs:333-346 | crates/openfang-channels/src/linkedin.rs:350-363 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/openfang-channels/src/feishu.rs:332— crates/openfang-channels/src/feishu.rs:332-339 | crates/openfang-channels/src/feishu.rs:369-376 | crates/openfang-channels/src/feishu.rs:425-432 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-channels/src/line.rs:199— crates/openfang-channels/src/line.rs:199-206 | crates/openfang-channels/src/line.rs:242-249 | crates/openfang-channels/src/line.rs:489-496 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-cli/src/tui/screens/audit.rs:234— crates/openfang-cli/src/tui/screens/audit.rs:234-242 | crates/openfang-cli/src/tui/screens/memory.rs:371-378 | crates/openfang-cli/src/tui/screens/templates.rs:283-291 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/memory.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/openfang-kernel/src/kernel.rs:5812— crates/openfang-kernel/src/kernel.rs:5812-5819 | crates/openfang-kernel/src/kernel.rs:5933-5940 | crates/openfang-kernel/src/kernel.rs:6053-6060 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-migrate/src/openclaw.rs:2002— crates/openfang-migrate/src/openclaw.rs:2002-2009 | crates/openfang-migrate/src/openclaw.rs:2014-2021 | crates/openfang-migrate/src/openclaw.rs:2996-3003 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-cli/src/tui/event.rs:2409— crates/openfang-cli/src/tui/event.rs:2409-2418 | crates/openfang-cli/src/tui/event.rs:2446-2455 | crates/openfang-cli/src/tui/event.rs:2700-2707 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-cli/src/tui/screens/init_wizard.rs:1571— crates/openfang-cli/src/tui/screens/init_wizard.rs:1571-1579 | crates/openfang-cli/src/tui/screens/wizard.rs:614-621 | crates/openfang-cli/src/tui/screens/wizard.rs:662-669 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/openfang-wire/src/peer.rs:531— crates/openfang-wire/src/peer.rs:531-538 | crates/openfang-wire/src/peer.rs:549-556 | crates/openfang-wire/src/peer.rs:616-624 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-cli/src/tui/screens/comms.rs:426— crates/openfang-cli/src/tui/screens/comms.rs:426-433 | crates/openfang-cli/src/tui/screens/dashboard.rs:204-211 | crates/openfang-cli/src/tui/screens/usage.rs:220-227 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/comms.rs` and `crates/openfang-cli/src/tui/screens/dashboard.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/openfang-cli/src/tui/screens/hands.rs:405— crates/openfang-cli/src/tui/screens/hands.rs:405-412 | crates/openfang-cli/src/tui/screens/sessions.rs:275-282 | crates/openfang-cli/src/tui/screens/skills.rs:476-483 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/sessions.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/openfang-channels/src/dingtalk_stream.rs:136— crates/openfang-channels/src/dingtalk_stream.rs:136-143 | crates/openfang-channels/src/linkedin.rs:167-174 | crates/openfang-channels/src/webhook.rs:341-348 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/openfang-api/src/routes.rs:2977— crates/openfang-api/src/routes.rs:2977-2984 | crates/openfang-api/src/routes.rs:2992-2999 | crates/openfang-api/src/routes.rs:3008-3015 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/openfang-api/src/routes.rs:7671— crates/openfang-api/src/routes.rs:7671-7678 | crates/openfang-api/src/routes.rs:8006-8013 | crates/openfang-api/src/routes.rs:8113-8120 — 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.
openfang_api::channel_bridge::start_channel_bridge_with_config (cyclomatic 107) crates/openfang-api/src/channel_bridge.rs:1104— openfang_api::channel_bridge::start_channel_bridge_with_config has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_api::middleware::auth (cyclomatic 48) crates/openfang-api/src/middleware.rs:71— openfang_api::middleware::auth has cyclomatic complexity 48 (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.
openfang_api::routes::patch_agent_config (cyclomatic 35) crates/openfang-api/src/routes.rs:9712— openfang_api::routes::patch_agent_config has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_api::routes::is_channel_configured (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_api::ws::handle_command (cyclomatic 35) crates/openfang-api/src/ws.rs:1009— openfang_api::ws::handle_command has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_api::ws::handle_text_message (cyclomatic 33) crates/openfang-api/src/ws.rs:589— openfang_api::ws::handle_text_message 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.
openfang_api::routes::get_agent_session (cyclomatic 28) crates/openfang-api/src/routes.rs:452— openfang_api::routes::get_agent_session has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_api::routes::is_channel_configured (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_api::routes::install_hand_deps (cyclomatic 28) crates/openfang-api/src/routes.rs:4486— openfang_api::routes::install_hand_deps has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_api::routes::is_channel_configured (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_api::routes::clone_agent (cyclomatic 23) crates/openfang-api/src/routes.rs:9991— openfang_api::routes::clone_agent has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_api::routes::is_channel_configured (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_api::routes::audit_append (cyclomatic 20) crates/openfang-api/src/routes.rs:3777— openfang_api::routes::audit_append has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: openfang_api::routes::is_channel_configured (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_api::routes::create_schedule (cyclomatic 20) crates/openfang-api/src/routes.rs:9185— openfang_api::routes::create_schedule has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_api::routes::is_channel_configured (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_api::server::build_router (cyclomatic 17) crates/openfang-api/src/server.rs:37— openfang_api::server::build_router 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.
openfang_api::server::run_daemon (cyclomatic 16) crates/openfang-api/src/server.rs:803— openfang_api::server::run_daemon 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.
openfang_migrate::openclaw::migrate_channels_from_json (cognitive 170) crates/openfang-migrate/src/openclaw.rs:1424— openfang_migrate::openclaw::migrate_channels_from_json has cognitive complexity 170 (threshold 15). Drivers by points: if/else 68 (169 pts), loops 1 (nesting depth added 101). Of this number, 166 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_migrate::openclaw::scan_from_legacy_yaml (cognitive 62) crates/openfang-migrate/src/openclaw.rs:1129— openfang_migrate::openclaw::scan_from_legacy_yaml has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (51 pts), loops 4 (11 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_migrate::openclaw::migrate_memory_files (cognitive 54) crates/openfang-migrate/src/openclaw.rs:2174— openfang_migrate::openclaw::migrate_memory_files has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (47 pts), loops 3 (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.
openfang_migrate::openclaw::convert_agent_from_json (cognitive 48) crates/openfang-migrate/src/openclaw.rs:1975— openfang_migrate::openclaw::convert_agent_from_json has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (40 pts), loops 3 (8 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.
openfang_migrate::openclaw::migrate_workspace_dirs (cognitive 45) crates/openfang-migrate/src/openclaw.rs:2298— openfang_migrate::openclaw::migrate_workspace_dirs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_migrate::openclaw::scan_from_json5 (cognitive 42) crates/openfang-migrate/src/openclaw.rs:997— openfang_migrate::openclaw::scan_from_json5 has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 4 (10 pts), match/switch 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_migrate::openclaw::resolve_default_tools (cognitive 27) crates/openfang-migrate/src/openclaw.rs:2143— openfang_migrate::openclaw::resolve_default_tools has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 1 (4 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_migrate::openclaw::parse_legacy_channels (cognitive 26) crates/openfang-migrate/src/openclaw.rs:2654— openfang_migrate::openclaw::parse_legacy_channels has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_migrate::openclaw::convert_legacy_agent (cognitive 19) crates/openfang-migrate/src/openclaw.rs:2983— openfang_migrate::openclaw::convert_legacy_agent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_migrate::openclaw::detect_openclaw_home (cognitive 17) crates/openfang-migrate/src/openclaw.rs:928— openfang_migrate::openclaw::detect_openclaw_home has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_migrate::openclaw::report_skipped_features (cognitive 16) crates/openfang-migrate/src/openclaw.rs:2458— openfang_migrate::openclaw::report_skipped_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassTooLong: OpenFangKernel crates/openfang-kernel/src/kernel.rs:60— ClassTooLong — 4517 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 79 methods, 4 blocks, lines 60-7934. The bar is 400 significant lines; this is 4117 over it, 11.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: App crates/openfang-cli/src/tui/mod.rs:139— ClassTooLong — 1518 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 66 methods, 2 blocks, lines 139-2375. The bar is 400 significant lines; this is 1118 over it, 3.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.
ClassTooLong: OpenAIDriver crates/openfang-runtime/src/drivers/openai.rs:20— ClassTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 3 blocks, lines 20-1518. The bar is 400 significant lines; this is 364 over it, 1.91× 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: KernelBridgeAdapter crates/openfang-api/src/channel_bridge.rs:67— ClassTooLong — 717 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 2 blocks, lines 67-1018. The bar is 400 significant lines; this is 317 over it, 1.79× 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: KernelConfig crates/openfang-types/src/config.rs:1145— ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 5 blocks, lines 1145-3915. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AgentSelectState crates/openfang-cli/src/tui/screens/agents.rs:58— ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 2 blocks, lines 58-844. The bar is 400 significant lines; this is 101 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TelegramAdapter crates/openfang-channels/src/telegram.rs:41— ClassTooLong — 486 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 4 blocks, lines 41-817. The bar is 400 significant lines; this is 86 over it, 1.22× 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: StandaloneChat crates/openfang-cli/src/tui/chat_runner.rs:29— ClassTooLong — 482 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 2 blocks, lines 29-754. The bar is 400 significant lines; this is 82 over it, 1.21× 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: MemorySubstrate crates/openfang-memory/src/substrate.rs:30— ClassTooLong — 467 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 3 blocks, lines 30-729. The bar is 400 significant lines; this is 67 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.
ClassTooLong: DiscordAdapter crates/openfang-channels/src/discord.rs:55— ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 3 blocks, lines 55-745. The bar is 400 significant lines; this is 48 over it, 1.12× 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: WorkflowEngine crates/openfang-kernel/src/workflow.rs:201— ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 3 blocks, lines 201-804. The bar is 400 significant lines; this is 1 over it, 1.00× 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.
OpenFangKernel::boot_with_config (cyclomatic 96) crates/openfang-kernel/src/kernel.rs:590— OpenFangKernel::boot_with_config has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OpenFangKernel::start_background_agents (cyclomatic 47) crates/openfang-kernel/src/kernel.rs:4390— OpenFangKernel::start_background_agents 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.
OpenFangKernel::send_message_streaming (cyclomatic 37) crates/openfang-kernel/src/kernel.rs:1984— OpenFangKernel::send_message_streaming 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.
OpenFangKernel::referenced_providers (cyclomatic 33) crates/openfang-kernel/src/kernel.rs:5339— OpenFangKernel::referenced_providers 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.
OpenFangKernel::execute_llm_agent (cyclomatic 32) crates/openfang-kernel/src/kernel.rs:2631— OpenFangKernel::execute_llm_agent 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.
OpenFangKernel::spawn_agent_with_parent (cyclomatic 26) crates/openfang-kernel/src/kernel.rs:1601— OpenFangKernel::spawn_agent_with_parent 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.
OpenFangKernel::activate_hand (cyclomatic 25) crates/openfang-kernel/src/kernel.rs:3754— OpenFangKernel::activate_hand 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.
OpenFangKernel::resolve_driver (cyclomatic 25) crates/openfang-kernel/src/kernel.rs:5562— OpenFangKernel::resolve_driver 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.
OpenFangKernel::available_tools_with_registry (cyclomatic 22) crates/openfang-kernel/src/kernel.rs:6148— OpenFangKernel::available_tools_with_registry 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.
OpenFangKernel::start_heartbeat_monitor (cyclomatic 19) crates/openfang-kernel/src/kernel.rs:4832— OpenFangKernel::start_heartbeat_monitor 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.
Duplicated block (9 lines × 3) crates/openfang-channels/src/discord.rs:140— crates/openfang-channels/src/discord.rs:140-148 | crates/openfang-channels/src/discord.rs:183-192 | crates/openfang-channels/src/discord.rs:225-233 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/openfang-cli/src/tui/screens/init_wizard.rs:1459— crates/openfang-cli/src/tui/screens/init_wizard.rs:1459-1467 | crates/openfang-cli/src/tui/screens/welcome.rs:302-310 | crates/openfang-cli/src/tui/screens/wizard.rs:502-510 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/openfang-cli/src/tui/screens/triggers.rs:375— crates/openfang-cli/src/tui/screens/triggers.rs:375-383 | crates/openfang-cli/src/tui/screens/workflows.rs:470-478 | crates/openfang-cli/src/tui/screens/workflows.rs:590-598 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/triggers.rs` and `crates/openfang-cli/src/tui/screens/workflows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/openfang-migrate/src/openclaw.rs:2239— crates/openfang-migrate/src/openclaw.rs:2239-2248 | crates/openfang-migrate/src/openclaw.rs:2309-2318 | crates/openfang-migrate/src/openclaw.rs:3220-3228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/openfang-cli/src/templates.rs:72— crates/openfang-cli/src/templates.rs:72-80 | crates/openfang-migrate/src/openclaw.rs:1134-1145 | crates/openfang-migrate/src/openclaw.rs:2196-2207 — 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 (9 lines × 3) crates/openfang-cli/src/tui/screens/agents.rs:1052— crates/openfang-cli/src/tui/screens/agents.rs:1052-1060 | crates/openfang-cli/src/tui/screens/triggers.rs:323-331 | crates/openfang-cli/src/tui/screens/workflows.rs:352-360 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/agents.rs` and `crates/openfang-cli/src/tui/screens/triggers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/openfang-api/src/routes.rs:4865— crates/openfang-api/src/routes.rs:4865-4873 | crates/openfang-api/src/routes.rs:4882-4890 | crates/openfang-api/src/routes.rs:4899-4907 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/openfang-cli/src/tui/screens/comms.rs:585— crates/openfang-cli/src/tui/screens/comms.rs:585-593 | crates/openfang-cli/src/tui/screens/comms.rs:596-604 | crates/openfang-cli/src/tui/screens/comms.rs:660-668 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/openfang-channels/src/guilded.rs:312— crates/openfang-channels/src/guilded.rs:312-320 | crates/openfang-channels/src/twitch.rs:269-277 | crates/openfang-channels/src/webex.rs:440-448 — before extracting anything, compare `crates/openfang-channels/src/guilded.rs` and `crates/openfang-channels/src/webex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/openfang-kernel/src/kernel.rs:7698— crates/openfang-kernel/src/kernel.rs:7698-7706 | crates/openfang-kernel/src/kernel.rs:7763-7771 | crates/openfang-kernel/src/kernel.rs:7818-7826 — 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.
openfang_channels::bridge::dispatch_message (cyclomatic 84) crates/openfang-channels/src/bridge.rs:754— openfang_channels::bridge::dispatch_message has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_channels::bridge::handle_command (cyclomatic 56) crates/openfang-channels/src/bridge.rs:1934— openfang_channels::bridge::handle_command has cyclomatic complexity 56 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
openfang_channels::telegram::parse_telegram_update (cyclomatic 33) crates/openfang-channels/src/telegram.rs:843— openfang_channels::telegram::parse_telegram_update 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.
openfang_channels::discord::parse_discord_message (cyclomatic 24) crates/openfang-channels/src/discord.rs:819— openfang_channels::discord::parse_discord_message 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.
openfang_channels::slack::parse_slack_event (cyclomatic 23) crates/openfang-channels/src/slack.rs:455— openfang_channels::slack::parse_slack_event 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.
openfang_channels::formatter::markdown_to_telegram_html (cyclomatic 22) crates/openfang-channels/src/formatter.rs:32— openfang_channels::formatter::markdown_to_telegram_html 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.
openfang_channels::bridge::dispatch_with_blocks (cyclomatic 19) crates/openfang-channels/src/bridge.rs:1699— openfang_channels::bridge::dispatch_with_blocks 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.
openfang_channels::bridge::sanitize_agent_error (cyclomatic 17) crates/openfang-channels/src/bridge.rs:1457— openfang_channels::bridge::sanitize_agent_error 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.
openfang_channels::formatter::strip_inline_markdown (cyclomatic 17) crates/openfang-channels/src/formatter.rs:392— openfang_channels::formatter::strip_inline_markdown 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.
Change coupling: anthropic.rs ↔ openai.rs crates/openfang-runtime/src/drivers/anthropic.rs:1— `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/openai.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `7185ea88` cargo fmt; `2dedab2a` think persist; `9b749694` fix: resolve 7 more bugs (#825, #828, #856, #770, #774, #851/#808, #785) — run `git show` on any of them.
Change coupling: anthropic.rs ↔ model_catalog.rs crates/openfang-runtime/src/drivers/anthropic.rs:1— `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/model_catalog.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `7185ea88` cargo fmt; `9b749694` fix: resolve 7 more bugs (#825, #828, #856, #770, #774, #851/#808, #785); `98f8d1ca` fix community PRs (inspired by #438 @pandego, #433 @ozekimasaki, #417… — run `git show` on any of them.
Change coupling: main.rs ↔ registry.rs crates/openfang-cli/src/main.rs:1— `crates/openfang-cli/src/main.rs` and `crates/openfang-hands/src/registry.rs` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `e2b0a547` feat(cli): add hand config subcommand (#809) (#1074); `a26f7626` v0.5.7: multi-instance hands + 8 critical fixes; `604e4ea7` fix: resolve 6 open bugs (#834, #805, #820, #848, #826, #836) — run `git show` on any of them.
Change coupling: discord.rs ↔ kernel.rs crates/openfang-channels/src/discord.rs:1— `crates/openfang-channels/src/discord.rs` and `crates/openfang-kernel/src/kernel.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4c496be0` integration fixes; `a26f7626` v0.5.7: multi-instance hands + 8 critical fixes; `cc93ef45` community fixes — run `git show` on any of them.
Change coupling: kernel.rs ↔ gemini.rs crates/openfang-kernel/src/kernel.rs:1— `crates/openfang-kernel/src/kernel.rs` and `crates/openfang-runtime/src/drivers/gemini.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9b749694` fix: resolve 7 more bugs (#825, #828, #856, #770, #774, #851/#808, #785); `b6b8b4eb` fix community issues; `98f8d1ca` fix community PRs (inspired by #438 @pandego, #433 @ozekimasaki, #417… — run `git show` on any of them.
Change coupling: gemini.rs ↔ model_catalog.rs crates/openfang-runtime/src/drivers/gemini.rs:1— `crates/openfang-runtime/src/drivers/gemini.rs` and `crates/openfang-runtime/src/model_catalog.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9b749694` fix: resolve 7 more bugs (#825, #828, #856, #770, #774, #851/#808, #785); `b6b8b4eb` fix community issues; `98f8d1ca` fix community PRs (inspired by #438 @pandego, #433 @ozekimasaki, #417… — run `git show` on any of them.
Change coupling: metering.rs ↔ model_catalog.rs crates/openfang-kernel/src/metering.rs:1— `crates/openfang-kernel/src/metering.rs` and `crates/openfang-types/src/model_catalog.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `b00af5ed` add requesty; `a7a96a7b` community fixes; `f10eefdc` fix 6 issues — run `git show` on any of them.
Change coupling: metering.rs ↔ mod.rs crates/openfang-kernel/src/metering.rs:1— `crates/openfang-kernel/src/metering.rs` and `crates/openfang-runtime/src/drivers/mod.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `b00af5ed` add requesty; `a7a96a7b` community fixes; `f10eefdc` fix 6 issues — run `git show` on any of them.
Change coupling: routes.rs ↔ prompt_builder.rs crates/openfang-api/src/routes.rs:1— `crates/openfang-api/src/routes.rs` and `crates/openfang-runtime/src/prompt_builder.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `a7a96a7b` community fixes; `52bacf09` community fixes; `62e6e0f0` batch fixes — run `git show` on any of them.
Duplicated block (16 lines × 2) crates/openfang-api/src/routes.rs:5994— crates/openfang-api/src/routes.rs:5994-6009 | crates/openfang-api/src/routes.rs:6039-6054 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-channels/src/bridge.rs:1346— crates/openfang-channels/src/bridge.rs:1346-1361 | crates/openfang-channels/src/bridge.rs:1810-1825 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-channels/src/line.rs:263— crates/openfang-channels/src/line.rs:263-278 | crates/openfang-channels/src/viber.rs:223-238 — before extracting anything, compare `crates/openfang-channels/src/line.rs` and `crates/openfang-channels/src/viber.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/openfang-cli/src/main.rs:3231— crates/openfang-cli/src/main.rs:3231-3246 | crates/openfang-cli/src/main.rs:3331-3346 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-runtime/src/compactor.rs:451— crates/openfang-runtime/src/compactor.rs:451-466 | crates/openfang-runtime/src/compactor.rs:570-585 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:668— crates/openfang-runtime/src/drivers/gemini.rs:668-683 | crates/openfang-runtime/src/drivers/gemini.rs:754-769 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-wire/src/peer.rs:855— crates/openfang-wire/src/peer.rs:855-870 | crates/openfang-wire/src/peer.rs:887-902 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-runtime/src/agent_loop.rs:2485— crates/openfang-runtime/src/agent_loop.rs:2485-2501 | crates/openfang-runtime/src/agent_loop.rs:2753-2768 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/openfang-runtime/src/drivers/fallback.rs:58— crates/openfang-runtime/src/drivers/fallback.rs:58-73 | crates/openfang-runtime/src/drivers/fallback.rs:99-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
openfang_kernel::metering::estimate_cost_rates (cognitive 88) crates/openfang-kernel/src/metering.rs:236— openfang_kernel::metering::estimate_cost_rates has cognitive complexity 88 (threshold 15). Drivers by points: if/else 75 (76 pts), boolean chains 12 (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.
openfang_kernel::config::load_config (cognitive 54) crates/openfang-kernel/src/config.rs:18— openfang_kernel::config::load_config has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (39 pts), match/switch 3 (9 pts), loops 1 (6 pts) (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_kernel::whatsapp_gateway::start_whatsapp_gateway (cognitive 33) crates/openfang-kernel/src/whatsapp_gateway.rs:130— openfang_kernel::whatsapp_gateway::start_whatsapp_gateway has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 5 (9 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_kernel::kernel::infer_provider_from_model (cognitive 29) crates/openfang-kernel/src/kernel.rs:6876— openfang_kernel::kernel::infer_provider_from_model has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_kernel::config_reload::build_reload_plan (cognitive 25) crates/openfang-kernel/src/config_reload.rs:123— openfang_kernel::config_reload::build_reload_plan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. 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.
openfang_kernel::kernel::manifest_to_capabilities (cognitive 24) crates/openfang-kernel/src/kernel.rs:6757— openfang_kernel::kernel::manifest_to_capabilities has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
openfang_kernel::background::parse_cron_to_secs (cognitive 21) crates/openfang-kernel/src/background.rs:254— openfang_kernel::background::parse_cron_to_secs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (21 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.
openfang_kernel::config::resolve_config_includes (cognitive 21) crates/openfang-kernel/src/config.rs:130— openfang_kernel::config::resolve_config_includes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×8
Duplicated block (15 lines × 2) crates/openfang-api/src/routes.rs:4743— crates/openfang-api/src/routes.rs:4743-4757 | crates/openfang-api/src/routes.rs:4783-4797 — both copies are in the same file, so extract the 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) crates/openfang-api/src/routes.rs:8721— crates/openfang-api/src/routes.rs:8721-8735 | crates/openfang-migrate/src/openclaw.rs:473-487 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/openfang-channels/src/guilded.rs:141— crates/openfang-channels/src/guilded.rs:141-155 | crates/openfang-channels/src/webex.rs:251-265 — before extracting anything, compare `crates/openfang-channels/src/guilded.rs` and `crates/openfang-channels/src/webex.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1947— crates/openfang-cli/src/tui/screens/init_wizard.rs:1947-1961 | crates/openfang-cli/src/tui/screens/wizard.rs:522-536 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/openfang-kernel/src/kernel.rs:3562— crates/openfang-kernel/src/kernel.rs:3562-3576 | crates/openfang-kernel/src/kernel.rs:3644-3658 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:1940— crates/openfang-migrate/src/openclaw.rs:1940-1954 | crates/openfang-migrate/src/openclaw.rs:2948-2962 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/agent_loop.rs:1299— crates/openfang-runtime/src/agent_loop.rs:1299-1315 | crates/openfang-runtime/src/agent_loop.rs:1483-1497 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/screens/channels.rs:930— crates/openfang-cli/src/tui/screens/channels.rs:930-944 | crates/openfang-cli/src/tui/screens/security.rs:311-326 — 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.
openfang_migrate::openclaw::migrate_channels_from_json (cyclomatic 69) crates/openfang-migrate/src/openclaw.rs:1424— openfang_migrate::openclaw::migrate_channels_from_json has cyclomatic complexity 69 (threshold 15). Of this number, 66 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_migrate::openclaw::scan_from_json5 (cyclomatic 29) crates/openfang-migrate/src/openclaw.rs:997— openfang_migrate::openclaw::scan_from_json5 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.
openfang_migrate::openclaw::convert_agent_from_json (cyclomatic 24) crates/openfang-migrate/src/openclaw.rs:1975— openfang_migrate::openclaw::convert_agent_from_json 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 is NOT this file's highest cyclomatic complexity: openfang_migrate::openclaw::map_provider (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_migrate::openclaw::parse_legacy_channels (cyclomatic 24) crates/openfang-migrate/src/openclaw.rs:2654— openfang_migrate::openclaw::parse_legacy_channels 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 is NOT this file's highest cyclomatic complexity: openfang_migrate::openclaw::map_provider (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_migrate::openclaw::scan_from_legacy_yaml (cyclomatic 20) crates/openfang-migrate/src/openclaw.rs:1129— openfang_migrate::openclaw::scan_from_legacy_yaml has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_migrate::openclaw::map_provider (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_migrate::openclaw::migrate_memory_files (cyclomatic 19) crates/openfang-migrate/src/openclaw.rs:2174— openfang_migrate::openclaw::migrate_memory_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. This is NOT this file's highest cyclomatic complexity: openfang_migrate::openclaw::map_provider (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_migrate::openclaw::migrate_workspace_dirs (cyclomatic 16) crates/openfang-migrate/src/openclaw.rs:2298— openfang_migrate::openclaw::migrate_workspace_dirs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_migrate::openclaw::map_provider (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×7
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×7
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×7
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-api/src/routes.rs:5676— crates/openfang-api/src/routes.rs:5676-5734 | crates/openfang-api/src/routes.rs:7411-7437 | crates/openfang-api/src/routes.rs:7496-7534 | crates/openfang-api/src/routes.rs:7575-7619 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-api/src/routes.rs:7171— crates/openfang-api/src/routes.rs:7171-7200 | crates/openfang-api/src/routes.rs:7208-7228 | crates/openfang-api/src/routes.rs:7234-7260 | crates/openfang-api/src/routes.rs:7296-7347 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-api/src/routes.rs:9364— crates/openfang-api/src/routes.rs:9364-9451 | crates/openfang-api/src/routes.rs:9457-9481 | crates/openfang-api/src/routes.rs:9487-9534 | crates/openfang-api/src/routes.rs:9546-9581 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-channels/src/discord.rs:826— crates/openfang-channels/src/discord.rs:826-995 | crates/openfang-channels/src/irc.rs:156-218 | crates/openfang-channels/src/mattermost.rs:149-227 | crates/openfang-channels/src/slack.rs:461-601 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-cli/src/launcher.rs:289— crates/openfang-cli/src/launcher.rs:289-302 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1420-1481 | crates/openfang-cli/src/tui/screens/welcome.rs:217-433 | crates/openfang-cli/src/tui/screens/wizard.rs:456-519 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-cli/src/tui/chat_runner.rs:437— crates/openfang-cli/src/tui/chat_runner.rs:437-519 | crates/openfang-cli/src/tui/chat_runner.rs:523-545 | crates/openfang-cli/src/tui/mod.rs:1749-1775 | crates/openfang-cli/src/tui/mod.rs:1926-2010 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openfang-cli/src/tui/screens/hands.rs:225— crates/openfang-cli/src/tui/screens/hands.rs:225-241 | crates/openfang-cli/src/tui/screens/settings.rs:313-330 | crates/openfang-cli/src/tui/screens/skills.rs:343-360 | crates/openfang-cli/src/tui/screens/usage.rs:197-214 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (5 lines × 3) crates/openfang-api/src/channel_bridge.rs:1869— crates/openfang-api/src/channel_bridge.rs:1869-1873 | crates/openfang-cli/src/dotenv.rs:134-138 | crates/openfang-desktop/src/server.rs:181-185 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (5 lines × 3) crates/openfang-cli/src/tui/screens/init_wizard.rs:1716— crates/openfang-cli/src/tui/screens/init_wizard.rs:1716-1720 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1737-1741 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2603-2607 — 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 × 3) crates/openfang-kernel/src/kernel.rs:5841— crates/openfang-kernel/src/kernel.rs:5841-5846 | crates/openfang-kernel/src/kernel.rs:5953-5957 | crates/openfang-kernel/src/kernel.rs:6071-6075 — 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 × 3) crates/openfang-runtime/src/session_repair.rs:235— crates/openfang-runtime/src/session_repair.rs:235-239 | crates/openfang-runtime/src/session_repair.rs:319-323 | crates/openfang-runtime/src/session_repair.rs:399-403 — 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 × 3) crates/openfang-cli/src/main.rs:2960— crates/openfang-cli/src/main.rs:2960-2966 | crates/openfang-cli/src/main.rs:2973-2979 | crates/openfang-cli/src/main.rs:2996-3000 — 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 × 3) crates/openfang-channels/src/viber.rs:114— crates/openfang-channels/src/viber.rs:114-118 | crates/openfang-channels/src/viber.rs:154-160 | crates/openfang-channels/src/viber.rs:203-208 — 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 × 3) crates/openfang-channels/src/nextcloud.rs:83— crates/openfang-channels/src/nextcloud.rs:83-87 | crates/openfang-channels/src/nextcloud.rs:104-108 | crates/openfang-channels/src/rocketchat.rs:83-87 — before extracting anything, compare `crates/openfang-channels/src/nextcloud.rs` and `crates/openfang-channels/src/rocketchat.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2 locations) crates/openfang-api/static/js/pages/agents.js:9— crates/openfang-api/static/js/pages/agents.js:9 · crates/openfang-api/static/js/pages/wizard.js:6 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) crates/openfang-api/static/js/pages/approvals.js:35— crates/openfang-api/static/js/pages/approvals.js:35 · crates/openfang-api/static/js/pages/hands.js:39 — 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 (9 lines × 2 locations) crates/openfang-api/static/js/pages/chat.js:504— crates/openfang-api/static/js/pages/chat.js:504 · crates/openfang-api/static/js/pages/chat.js:518 — 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 (9 lines × 2 locations) crates/openfang-api/static/js/pages/hands.js:362— crates/openfang-api/static/js/pages/hands.js:362 · crates/openfang-api/static/js/pages/hands.js:398 — both copies are in the same file, so extract the 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 locations) crates/openfang-api/static/js/pages/overview.js:215— crates/openfang-api/static/js/pages/overview.js:215 · crates/openfang-api/static/js/pages/usage.js:78 — 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 (9 lines × 2 locations) crates/openfang-api/static/js/pages/wizard.js:361— crates/openfang-api/static/js/pages/wizard.js:361 · crates/openfang-api/static/js/pages/wizard.js:562 — 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 (9 lines × 2 locations) sdk/javascript/index.js:145— sdk/javascript/index.js:145 · sdk/javascript/index.js:369 — 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.
App::handle_slash_command (cognitive 78) crates/openfang-cli/src/tui/mod.rs:2014— App::handle_slash_command has cognitive complexity 78 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 7 (20 pts), loops 4 (16 pts) (nesting depth added 52). 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.
App::handle_event (cognitive 57) crates/openfang-cli/src/tui/mod.rs:227— App::handle_event has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (49 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 26). 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.
App::handle_key (cognitive 44) crates/openfang-cli/src/tui/mod.rs:617— App::handle_key has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 7 (16 pts), boolean chains 4 (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.
App::draw_tab_bar (cognitive 29) crates/openfang-cli/src/tui/mod.rs:2259— App::draw_tab_bar has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (24 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.
App::switch_model (cognitive 25) crates/openfang-cli/src/tui/mod.rs:1926— App::switch_model has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 3 (7 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.
App::handle_channel_action (cognitive 17) crates/openfang-cli/src/tui/mod.rs:1377— App::handle_channel_action has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 1 (5 pts), match/switch 1 (nesting depth added 11). 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.
Duplicated block (17 lines × 2) crates/openfang-api/src/routes.rs:10287— crates/openfang-api/src/routes.rs:10287-10303 | crates/openfang-api/src/routes.rs:10392-10408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:397— crates/openfang-cli/src/tui/chat_runner.rs:397-413 | crates/openfang-cli/src/tui/mod.rs:1886-1902 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1591— crates/openfang-cli/src/tui/screens/init_wizard.rs:1591-1607 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1780-1796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/openfang-runtime/src/drivers/claude_code.rs:694— crates/openfang-runtime/src/drivers/claude_code.rs:694-710 | crates/openfang-runtime/src/drivers/qwen_code.rs:397-413 — before extracting anything, compare `crates/openfang-runtime/src/drivers/claude_code.rs` and `crates/openfang-runtime/src/drivers/qwen_code.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/openfang-runtime/src/drivers/vertex.rs:498— crates/openfang-runtime/src/drivers/vertex.rs:498-514 | crates/openfang-runtime/src/drivers/vertex.rs:577-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/openfang-runtime/src/agent_loop.rs:668— crates/openfang-runtime/src/agent_loop.rs:668-684 | crates/openfang-runtime/src/agent_loop.rs:1908-1924 — both copies are in the same file, so extract the 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 × 3) crates/openfang-api/src/routes.rs:9586— crates/openfang-api/src/routes.rs:9586-9597 | crates/openfang-kernel/src/kernel.rs:6972-6983 | crates/openfang-runtime/src/tool_runner.rs:2270-2281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (12 lines × 3) crates/openfang-channels/src/irc.rs:190— crates/openfang-channels/src/irc.rs:190-201 | crates/openfang-channels/src/mattermost.rs:199-210 | crates/openfang-channels/src/slack.rs:526-537 — before extracting anything, compare `crates/openfang-channels/src/irc.rs` and `crates/openfang-channels/src/mattermost.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) crates/openfang-cli/src/launcher.rs:496— crates/openfang-cli/src/launcher.rs:496-507 | crates/openfang-cli/src/tui/screens/welcome.rs:404-415 | crates/openfang-cli/src/tui/screens/wizard.rs:553-564 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/welcome.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) crates/openfang-cli/src/main.rs:4997— crates/openfang-cli/src/main.rs:4997-5008 | crates/openfang-cli/src/main.rs:5035-5046 | crates/openfang-cli/src/main.rs:5158-5169 — 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 (12 lines × 3) crates/openfang-cli/src/tui/screens/init_wizard.rs:1428— crates/openfang-cli/src/tui/screens/init_wizard.rs:1428-1439 | crates/openfang-cli/src/tui/screens/welcome.rs:242-253 | crates/openfang-cli/src/tui/screens/wizard.rs:472-483 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) crates/openfang-cli/src/tui/screens/audit.rs:247— crates/openfang-cli/src/tui/screens/audit.rs:247-258 | crates/openfang-cli/src/tui/screens/logs.rs:346-357 | crates/openfang-cli/src/tui/screens/templates.rs:296-307 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/logs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/openfang-cli/src/tui/screens/channels.rs:488— crates/openfang-cli/src/tui/screens/channels.rs:488-497 | crates/openfang-cli/src/tui/screens/triggers.rs:105-114 | crates/openfang-cli/src/tui/screens/workflows.rs:117-126 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/channels.rs` and `crates/openfang-cli/src/tui/screens/triggers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/openfang-migrate/src/openclaw.rs:2924— crates/openfang-migrate/src/openclaw.rs:2924-2933 | crates/openfang-migrate/src/openclaw.rs:3113-3122 | crates/openfang-migrate/src/openclaw.rs:3165-3174 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crates/openfang-memory/src/usage.rs:114— crates/openfang-memory/src/usage.rs:114-123 | crates/openfang-memory/src/usage.rs:131-140 | crates/openfang-memory/src/usage.rs:148-157 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crates/openfang-migrate/src/openclaw.rs:1632— crates/openfang-migrate/src/openclaw.rs:1632-1641 | crates/openfang-migrate/src/openclaw.rs:1749-1758 | crates/openfang-migrate/src/openclaw.rs:1828-1837 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crates/openfang-channels/src/guilded.rs:67— crates/openfang-channels/src/guilded.rs:67-76 | crates/openfang-channels/src/pumble.rs:64-73 | crates/openfang-channels/src/webex.rs:71-80 — before extracting anything, compare `crates/openfang-channels/src/guilded.rs` and `crates/openfang-channels/src/pumble.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/openfang-cli/src/tui/event.rs:2396— crates/openfang-cli/src/tui/event.rs:2396-2405 | crates/openfang-cli/src/tui/event.rs:2433-2442 | crates/openfang-cli/src/tui/event.rs:2470-2479 — 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.
App::handle_event (cyclomatic 109) crates/openfang-cli/src/tui/mod.rs:227— App::handle_event has cyclomatic complexity 109 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
App::handle_key (cyclomatic 64) crates/openfang-cli/src/tui/mod.rs:617— App::handle_key has cyclomatic complexity 64 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
App::handle_slash_command (cyclomatic 34) crates/openfang-cli/src/tui/mod.rs:2014— App::handle_slash_command 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.
App::draw_tab_bar (cyclomatic 17) crates/openfang-cli/src/tui/mod.rs:2259— App::draw_tab_bar has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: App::draw (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
App::handle_agent_action (cyclomatic 16) crates/openfang-cli/src/tui/mod.rs:1303— App::handle_agent_action has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: App::draw (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
openfang_kernel::metering::estimate_cost_rates (cyclomatic 88) crates/openfang-kernel/src/metering.rs:236— openfang_kernel::metering::estimate_cost_rates has cyclomatic complexity 88 (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.
openfang_kernel::kernel::infer_provider_from_model (cyclomatic 27) crates/openfang-kernel/src/kernel.rs:6876— openfang_kernel::kernel::infer_provider_from_model has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_kernel::config_reload::build_reload_plan (cyclomatic 26) crates/openfang-kernel/src/config_reload.rs:123— openfang_kernel::config_reload::build_reload_plan has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openfang_kernel::kernel::manifest_to_capabilities (cyclomatic 20) crates/openfang-kernel/src/kernel.rs:6757— openfang_kernel::kernel::manifest_to_capabilities 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.
openfang_kernel::whatsapp_gateway::start_whatsapp_gateway (cyclomatic 16) crates/openfang-kernel/src/whatsapp_gateway.rs:130— openfang_kernel::whatsapp_gateway::start_whatsapp_gateway 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.
TooManyFields: OpenFangKernel crates/openfang-kernel/src/kernel.rs:60— TooManyFields — 51 stored fields beside 79 methods. The bar is 30 stored fields; this is 21 over it, 1.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: KernelConfig crates/openfang-types/src/config.rs:1145— TooManyFields — 47 stored fields beside 4 methods. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ChannelsConfig crates/openfang-types/src/config.rs:1822— TooManyFields — 43 stored fields. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: State crates/openfang-cli/src/tui/screens/init_wizard.rs:363— TooManyFields — 35 stored fields beside 10 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: App crates/openfang-cli/src/tui/mod.rs:139— TooManyFields — 34 stored fields beside 66 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (22 lines × 2) crates/openfang-api/src/routes.rs:9638— crates/openfang-api/src/routes.rs:9638-9659 | crates/openfang-api/src/routes.rs:9764-9785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/openfang-kernel/src/kernel.rs:2182— crates/openfang-kernel/src/kernel.rs:2182-2203 | crates/openfang-kernel/src/kernel.rs:2765-2786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/openfang-migrate/src/openclaw.rs:2320— crates/openfang-migrate/src/openclaw.rs:2320-2341 | crates/openfang-migrate/src/openclaw.rs:3186-3207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1257— crates/openfang-runtime/src/agent_loop.rs:1257-1278 | crates/openfang-runtime/src/agent_loop.rs:1441-1462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:787— crates/openfang-runtime/src/drivers/gemini.rs:787-808 | crates/openfang-runtime/src/drivers/vertex.rs:607-628 — before extracting anything, compare `crates/openfang-runtime/src/drivers/gemini.rs` and `crates/openfang-runtime/src/drivers/vertex.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) crates/openfang-api/src/routes.rs:8072— crates/openfang-api/src/routes.rs:8072-8084 | crates/openfang-api/src/routes.rs:8585-8597 | crates/openfang-api/src/routes.rs:8762-8774 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/openfang-channels/src/dingtalk_stream.rs:504— crates/openfang-channels/src/dingtalk_stream.rs:504-516 | crates/openfang-channels/src/feishu.rs:1304-1316 | crates/openfang-channels/src/mastodon.rs:215-227 — before extracting anything, compare `crates/openfang-channels/src/dingtalk_stream.rs` and `crates/openfang-channels/src/mastodon.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) crates/openfang-skills/src/loader.rs:121— crates/openfang-skills/src/loader.rs:121-133 | crates/openfang-skills/src/loader.rs:222-234 | crates/openfang-skills/src/loader.rs:367-379 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/openfang-cli/src/main.rs:6351— crates/openfang-cli/src/main.rs:6351-6363 | crates/openfang-cli/src/main.rs:6405-6417 | crates/openfang-cli/src/main.rs:6447-6459 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/openfang-runtime/src/agent_loop.rs:2575— crates/openfang-runtime/src/agent_loop.rs:2575-2587 | crates/openfang-runtime/src/agent_loop.rs:2622-2634 | crates/openfang-runtime/src/agent_loop.rs:2877-2889 — 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 (12–13 lines × 2) crates/openfang-channels/src/teams.rs:290— crates/openfang-channels/src/teams.rs:290-302 | crates/openfang-channels/src/wecom.rs:356-367 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) crates/openfang-kernel/src/background.rs:108— crates/openfang-kernel/src/background.rs:108-120 | crates/openfang-kernel/src/background.rs:168-179 — both copies are in the same file, so extract the 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) crates/openfang-kernel/src/kernel.rs:5832— crates/openfang-kernel/src/kernel.rs:5832-5844 | crates/openfang-kernel/src/kernel.rs:6062-6073 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:1135— crates/openfang-migrate/src/openclaw.rs:1135-1146 | crates/openfang-migrate/src/openclaw.rs:2930-2942 — both copies are in the same file, so extract the 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) crates/openfang-migrate/src/openclaw.rs:2197— crates/openfang-migrate/src/openclaw.rs:2197-2208 | crates/openfang-migrate/src/openclaw.rs:3119-3131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 4) crates/openfang-api/src/routes.rs:9365— crates/openfang-api/src/routes.rs:9365-9374 | crates/openfang-api/src/routes.rs:9458-9467 | crates/openfang-api/src/routes.rs:9488-9497 | crates/openfang-api/src/routes.rs:9547-9556 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) crates/openfang-cli/src/tui/screens/hands.rs:302— crates/openfang-cli/src/tui/screens/hands.rs:302-311 | crates/openfang-cli/src/tui/screens/settings.rs:577-586 | crates/openfang-cli/src/tui/screens/skills.rs:457-466 | crates/openfang-cli/src/tui/screens/skills.rs:646-655 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/settings.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/openfang-channels/src/flock.rs:50— crates/openfang-channels/src/flock.rs:50-59 | crates/openfang-channels/src/gitter.rs:47-56 | crates/openfang-channels/src/guilded.rs:53-62 | crates/openfang-channels/src/pumble.rs:50-59 — before extracting anything, compare `crates/openfang-channels/src/flock.rs` and `crates/openfang-channels/src/guilded.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/openfang-runtime/src/agent_loop.rs:2570— crates/openfang-runtime/src/agent_loop.rs:2570-2580 | crates/openfang-runtime/src/agent_loop.rs:2618-2627 | crates/openfang-runtime/src/agent_loop.rs:2830-2839 | crates/openfang-runtime/src/agent_loop.rs:2873-2882 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) crates/openfang-migrate/src/openclaw.rs:1483— crates/openfang-migrate/src/openclaw.rs:1483-1492 | crates/openfang-migrate/src/openclaw.rs:1510-1519 | crates/openfang-migrate/src/openclaw.rs:1546-1555 | crates/openfang-migrate/src/openclaw.rs:1603-1612 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/openfang-channels/src/formatter.rs:190— crates/openfang-channels/src/formatter.rs:190-196 | crates/openfang-channels/src/formatter.rs:201-212 | crates/openfang-channels/src/formatter.rs:295-301 — 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 (7 lines × 3) crates/openfang-channels/src/feishu.rs:327— crates/openfang-channels/src/feishu.rs:327-333 | crates/openfang-channels/src/feishu.rs:364-370 | crates/openfang-channels/src/feishu.rs:940-949 — 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 (7 lines × 3) crates/openfang-channels/src/flock.rs:144— crates/openfang-channels/src/flock.rs:144-150 | crates/openfang-channels/src/line.rs:245-253 | crates/openfang-channels/src/signal.rs:64-70 — before extracting anything, compare `crates/openfang-channels/src/flock.rs` and `crates/openfang-channels/src/signal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/openfang-migrate/src/openclaw.rs:2709— crates/openfang-migrate/src/openclaw.rs:2709-2715 | crates/openfang-migrate/src/openclaw.rs:2728-2734 | crates/openfang-migrate/src/openclaw.rs:2750-2756 — 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 (7 lines × 3) crates/openfang-runtime/src/copilot_oauth.rs:59— crates/openfang-runtime/src/copilot_oauth.rs:59-65 | crates/openfang-runtime/src/drivers/copilot.rs:342-348 | crates/openfang-runtime/src/drivers/copilot.rs:425-431 — 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 (7 lines × 2 locations) crates/openfang-api/static/js/pages/agents.js:199— crates/openfang-api/static/js/pages/agents.js:199 · crates/openfang-api/static/js/pages/settings.js:415 — 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 (7 lines × 2 locations) crates/openfang-api/static/js/pages/chat.js:886— crates/openfang-api/static/js/pages/chat.js:886 · crates/openfang-api/static/js/pages/chat.js:901 — 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 (7 lines × 2 locations) crates/openfang-api/static/js/pages/comms.js:148— crates/openfang-api/static/js/pages/comms.js:148 · crates/openfang-api/static/js/pages/overview.js:236 — 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 (7 lines × 2 locations) crates/openfang-api/static/js/pages/settings.js:331— crates/openfang-api/static/js/pages/settings.js:331 · crates/openfang-api/static/js/pages/settings.js:415 — 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 (7 lines × 2 locations) REDACTED:149— REDACTED:149 · REDACTED:162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/openfang-cli/src/launcher.rs:401— crates/openfang-cli/src/launcher.rs:401-426 | crates/openfang-cli/src/tui/screens/welcome.rs:317-342 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/welcome.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:479— crates/openfang-cli/src/tui/chat_runner.rs:479-504 | crates/openfang-cli/src/tui/mod.rs:1968-1993 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) crates/openfang-kernel/src/kernel.rs:2204— crates/openfang-kernel/src/kernel.rs:2204-2229 | crates/openfang-kernel/src/kernel.rs:2787-2812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/openfang-kernel/src/workflow.rs:484— crates/openfang-kernel/src/workflow.rs:484-509 | crates/openfang-kernel/src/workflow.rs:660-685 — both copies are in the same file, so extract the 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 (20 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1432— crates/openfang-cli/src/tui/screens/init_wizard.rs:1432-1451 | crates/openfang-cli/src/tui/screens/wizard.rs:476-495 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1127— crates/openfang-runtime/src/agent_loop.rs:1127-1146 | crates/openfang-runtime/src/agent_loop.rs:2346-2365 — both copies are in the same file, so extract the 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 (20 lines × 2) crates/openfang-wire/src/peer.rs:661— crates/openfang-wire/src/peer.rs:661-680 | crates/openfang-wire/src/peer.rs:753-772 — both copies are in the same file, so extract the 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 (20 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1682— crates/openfang-cli/src/tui/screens/init_wizard.rs:1682-1701 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2254-2274 — both copies are in the same file, so extract the 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–15 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:2143— crates/openfang-cli/src/tui/screens/init_wizard.rs:2143-2156 | crates/openfang-cli/src/tui/screens/wizard.rs:600-614 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:640— crates/openfang-runtime/src/drivers/openai.rs:640-654 | crates/openfang-runtime/src/drivers/openai.rs:1066-1079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/openfang-runtime/src/process_manager.rs:103— crates/openfang-runtime/src/process_manager.rs:103-117 | crates/openfang-runtime/src/process_manager.rs:119-132 — both copies are in the same file, so extract the 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–15 lines × 2) crates/openfang-runtime/src/session_repair.rs:342— crates/openfang-runtime/src/session_repair.rs:342-355 | crates/openfang-runtime/src/session_repair.rs:442-456 — both copies are in the same file, so extract the 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 × 5) crates/openfang-channels/src/linkedin.rs:166— crates/openfang-channels/src/linkedin.rs:166-172 | crates/openfang-channels/src/nextcloud.rs:140-146 | crates/openfang-channels/src/revolt.rs:143-149 | crates/openfang-channels/src/revolt.rs:183-189 | crates/openfang-channels/src/rocketchat.rs:111-117 — before extracting anything, compare `crates/openfang-channels/src/nextcloud.rs` and `crates/openfang-channels/src/revolt.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) crates/openfang-cli/src/tui/screens/audit.rs:170— crates/openfang-cli/src/tui/screens/audit.rs:170-176 | crates/openfang-cli/src/tui/screens/logs.rs:217-223 | crates/openfang-cli/src/tui/screens/peers.rs:68-74 | crates/openfang-cli/src/tui/screens/sessions.rs:136-142 | crates/openfang-cli/src/tui/screens/templates.rs:200-206 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/logs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) crates/openfang-kernel/src/workflow.rs:524— crates/openfang-kernel/src/workflow.rs:524-530 | crates/openfang-kernel/src/workflow.rs:602-608 | crates/openfang-kernel/src/workflow.rs:615-621 | crates/openfang-kernel/src/workflow.rs:694-700 | crates/openfang-kernel/src/workflow.rs:767-773 — 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 (7 lines × 5) crates/openfang-migrate/src/openclaw.rs:1132— crates/openfang-migrate/src/openclaw.rs:1132-1138 | crates/openfang-migrate/src/openclaw.rs:2194-2200 | crates/openfang-migrate/src/openclaw.rs:2237-2245 | crates/openfang-migrate/src/openclaw.rs:2307-2315 | crates/openfang-migrate/src/openclaw.rs:2348-2354 — 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 (6 lines × 3) crates/openfang-api/src/ws.rs:1469— crates/openfang-api/src/ws.rs:1469-1474 | crates/openfang-api/src/ws.rs:1477-1482 | crates/openfang-api/src/ws.rs:1485-1490 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/openfang-channels/src/feishu.rs:350— crates/openfang-channels/src/feishu.rs:350-355 | crates/openfang-channels/src/reddit.rs:148-153 | crates/openfang-channels/src/teams.rs:121-126 — before extracting anything, compare `crates/openfang-channels/src/reddit.rs` and `crates/openfang-channels/src/teams.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/openfang-channels/src/google_chat.rs:162— crates/openfang-channels/src/google_chat.rs:162-169 | crates/openfang-channels/src/line.rs:370-375 | crates/openfang-channels/src/messenger.rs:275-280 — before extracting anything, compare `crates/openfang-channels/src/line.rs` and `crates/openfang-channels/src/messenger.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/openfang-cli/src/tui/screens/sessions.rs:139— crates/openfang-cli/src/tui/screens/sessions.rs:139-144 | crates/openfang-cli/src/tui/screens/templates.rs:203-208 | crates/openfang-cli/src/tui/screens/workflows.rs:123-128 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/sessions.rs` and `crates/openfang-cli/src/tui/screens/templates.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/openfang-channels/src/dingtalk_stream.rs:168— crates/openfang-channels/src/dingtalk_stream.rs:168-172 | crates/openfang-channels/src/discourse.rs:186-190 | crates/openfang-channels/src/keybase.rs:211-215 | crates/openfang-channels/src/linkedin.rs:233-237 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/openfang-channels/src/flock.rs:97— crates/openfang-channels/src/flock.rs:97-102 | crates/openfang-channels/src/messenger.rs:112-117 | crates/openfang-channels/src/messenger.rs:394-398 | crates/openfang-channels/src/signal.rs:60-65 — before extracting anything, compare `crates/openfang-channels/src/flock.rs` and `crates/openfang-channels/src/signal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/openfang-cli/src/tui/chat_runner.rs:460— crates/openfang-cli/src/tui/chat_runner.rs:460-464 | crates/openfang-cli/src/tui/chat_runner.rs:534-538 | crates/openfang-cli/src/tui/mod.rs:1758-1762 | crates/openfang-cli/src/tui/mod.rs:1947-1951 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/openfang-cli/src/tui/screens/channels.rs:511— crates/openfang-cli/src/tui/screens/channels.rs:511-515 | crates/openfang-cli/src/tui/screens/channels.rs:526-530 | crates/openfang-cli/src/tui/screens/channels.rs:537-541 | crates/openfang-cli/src/tui/screens/channels.rs:549-553 — 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.
Off the main sequence: openfang-types — openfang-types: abstractness 0.01, instability 0.00, distance 0.99 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
Off the main sequence: openfang-skills — openfang-skills: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: openfang-extensions — openfang-extensions: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: openfang-memory — openfang-memory: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
X2 · Cancellation propagation· Async function without AbortSignal · ×4
Async function without AbortSignal: _request sdk/javascript/index.js:52— `_request` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: _stream sdk/javascript/index.js:71— `_stream` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: upload sdk/javascript/index.js:253— `upload` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: loadTranslations crates/openfang-api/static/i18n/i18n.js:26— `loadTranslations` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
openfang_skills::openclaw_compat::convert_skillmd (cognitive 21) crates/openfang-skills/src/openclaw_compat.rs:174— openfang_skills::openclaw_compat::convert_skillmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_skills::openclaw_compat::convert_skillmd_str (cognitive 19) crates/openfang-skills/src/openclaw_compat.rs:286— openfang_skills::openclaw_compat::convert_skillmd_str has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_skills::config_injection::resolve_skill_config (cognitive 16) crates/openfang-skills/src/config_injection.rs:65— openfang_skills::config_injection::resolve_skill_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyMethods: OpenFangKernel crates/openfang-kernel/src/kernel.rs:60— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× 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: App crates/openfang-cli/src/tui/mod.rs:139— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MemorySubstrate crates/openfang-memory/src/substrate.rs:30— 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.
Near-duplicate member pair (37 shared lines) crates/openfang-channels/src/discourse.rs:179— crates/openfang-channels/src/discourse.rs:179-346 | crates/openfang-channels/src/linkedin.rs:228-363 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (37 shared lines) crates/openfang-channels/src/reddit.rs:108— crates/openfang-channels/src/reddit.rs:108-153 | crates/openfang-channels/src/teams.rs:81-126 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (37 shared lines) crates/openfang-migrate/src/openclaw.rs:1979— crates/openfang-migrate/src/openclaw.rs:1979-2141 | crates/openfang-migrate/src/openclaw.rs:2986-3103 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/openfang-cli/src/main.rs:4536— crates/openfang-cli/src/main.rs:4536-4555 | crates/openfang-cli/src/main.rs:4557-4579 | crates/openfang-cli/src/main.rs:4581-4597 | crates/openfang-cli/src/main.rs:4599-4615 | crates/openfang-cli/src/main.rs:6015-6032 | crates/openfang-cli/src/main.rs:6151-6168 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/openfang-cli/src/main.rs:5707— crates/openfang-cli/src/main.rs:5707-5785 | crates/openfang-cli/src/main.rs:5980-6013 | crates/openfang-cli/src/main.rs:6034-6080 | crates/openfang-cli/src/main.rs:6170-6207 | crates/openfang-cli/src/main.rs:6507-6539 | crates/openfang-cli/src/main.rs:6585-6617 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/openfang-memory/src/session.rs:146— crates/openfang-memory/src/session.rs:146-183 | crates/openfang-memory/src/session.rs:264-298 | crates/openfang-memory/src/structured.rs:417-439 | crates/openfang-memory/src/substrate.rs:322-347 | crates/openfang-memory/src/usage.rs:234-265 | crates/openfang-memory/src/usage.rs:268-303 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (20–21 lines × 2) crates/openfang-api/src/routes.rs:3176— crates/openfang-api/src/routes.rs:3176-3196 | crates/openfang-api/src/routes.rs:3223-3242 — both copies are in the same file, so extract the 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 (20–21 lines × 2) crates/openfang-cli/src/main.rs:3602— crates/openfang-cli/src/main.rs:3602-3622 | crates/openfang-cli/src/main.rs:3682-3701 — both copies are in the same file, so extract the 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 (20–21 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1184— crates/openfang-runtime/src/agent_loop.rs:1184-1204 | crates/openfang-runtime/src/agent_loop.rs:1372-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:446— crates/openfang-cli/src/tui/chat_runner.rs:446-465 | crates/openfang-cli/src/tui/mod.rs:1934-1952 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–20 lines × 2) crates/openfang-runtime/src/agent_loop.rs:556— crates/openfang-runtime/src/agent_loop.rs:556-575 | crates/openfang-runtime/src/agent_loop.rs:1800-1818 — both copies are in the same file, so extract the 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 (19–20 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:892— crates/openfang-runtime/src/drivers/gemini.rs:892-911 | crates/openfang-runtime/src/drivers/gemini.rs:988-1006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:789— crates/openfang-cli/src/tui/chat_runner.rs:789-806 | crates/openfang-cli/src/tui/mod.rs:2420-2438 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) crates/openfang-runtime/src/agent_loop.rs:646— crates/openfang-runtime/src/agent_loop.rs:646-664 | crates/openfang-runtime/src/agent_loop.rs:1887-1904 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:936— crates/openfang-runtime/src/drivers/gemini.rs:936-953 | crates/openfang-runtime/src/drivers/gemini.rs:1035-1053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) crates/openfang-channels/src/bridge.rs:1806— crates/openfang-channels/src/bridge.rs:1806-1822 | crates/openfang-channels/src/bridge.rs:1844-1861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) crates/openfang-channels/src/reddit.rs:111— crates/openfang-channels/src/reddit.rs:111-127 | crates/openfang-channels/src/teams.rs:84-101 — before extracting anything, compare `crates/openfang-channels/src/reddit.rs` and `crates/openfang-channels/src/teams.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:711— crates/openfang-runtime/src/drivers/openai.rs:711-728 | crates/openfang-runtime/src/drivers/openai.rs:1147-1163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/openfang-cli/src/tui/screens/comms.rs:550— crates/openfang-cli/src/tui/screens/comms.rs:550-567 | crates/openfang-cli/src/tui/screens/comms.rs:625-642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1206— crates/openfang-runtime/src/agent_loop.rs:1206-1223 | crates/openfang-runtime/src/agent_loop.rs:1393-1410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/openfang-skills/src/registry.rs:235— crates/openfang-skills/src/registry.rs:235-252 | crates/openfang-skills/src/registry.rs:420-437 — both copies are in the same file, so extract the 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–16 lines × 2) crates/openfang-channels/src/bridge.rs:1123— crates/openfang-channels/src/bridge.rs:1123-1137 | crates/openfang-channels/src/bridge.rs:1760-1775 — both copies are in the same file, so extract the 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–16 lines × 2) crates/openfang-cli/src/tui/screens/agents.rs:1065— crates/openfang-cli/src/tui/screens/agents.rs:1065-1079 | crates/openfang-cli/src/tui/screens/triggers.rs:335-350 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/agents.rs` and `crates/openfang-cli/src/tui/screens/triggers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1225— crates/openfang-runtime/src/agent_loop.rs:1225-1240 | crates/openfang-runtime/src/agent_loop.rs:1412-1426 — both copies are in the same file, so extract the 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) crates/openfang-channels/src/formatter.rs:448— crates/openfang-channels/src/formatter.rs:448-457 | crates/openfang-channels/src/formatter.rs:526-534 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/tui/chat_runner.rs:764— crates/openfang-cli/src/tui/chat_runner.rs:764-772 | crates/openfang-cli/src/tui/mod.rs:2395-2404 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) crates/openfang-memory/src/structured.rs:211— crates/openfang-memory/src/structured.rs:211-219 | crates/openfang-memory/src/structured.rs:374-383 — both copies are in the same file, so extract the 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 × 4) crates/openfang-cli/src/tui/screens/hands.rs:316— crates/openfang-cli/src/tui/screens/hands.rs:316-324 | crates/openfang-cli/src/tui/screens/hands.rs:413-421 | crates/openfang-cli/src/tui/screens/sessions.rs:283-291 | crates/openfang-cli/src/tui/screens/skills.rs:484-492 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/sessions.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) crates/openfang-cli/src/main.rs:1782— crates/openfang-cli/src/main.rs:1782-1791 | crates/openfang-cli/src/main.rs:2040-2049 | crates/openfang-cli/src/main.rs:5789-5797 | crates/openfang-cli/src/main.rs:5831-5839 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) crates/openfang-api/src/routes.rs:7192— crates/openfang-api/src/routes.rs:7192-7200 | crates/openfang-api/src/routes.rs:7220-7228 | crates/openfang-api/src/routes.rs:7252-7260 | crates/openfang-api/src/routes.rs:7339-7347 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) crates/openfang-cli/src/main.rs:2959— crates/openfang-cli/src/main.rs:2959-2966 | crates/openfang-cli/src/main.rs:2972-2980 — both copies are in the same file, so extract the 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–9 lines × 2) crates/openfang-migrate/src/openclaw.rs:1998— crates/openfang-migrate/src/openclaw.rs:1998-2005 | crates/openfang-migrate/src/openclaw.rs:2151-2159 — both copies are in the same file, so extract the 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–9 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:464— crates/openfang-runtime/src/drivers/openai.rs:464-472 | crates/openfang-runtime/src/drivers/openai.rs:919-926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2 locations) crates/openfang-api/static/js/app.js:29— crates/openfang-api/static/js/app.js:29 · crates/openfang-api/static/js/app.js:41 — 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 (10 lines × 2 locations) crates/openfang-api/static/js/pages/approvals.js:70— crates/openfang-api/static/js/pages/approvals.js:70 · crates/openfang-api/static/js/pages/comms.js:143 — 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 (10 lines × 2 locations) sdk/javascript/index.js:54— sdk/javascript/index.js:54 · sdk/javascript/index.js:74 — both copies are in the same file, so extract the 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 locations) crates/openfang-api/static/js/pages/chat.js:832— crates/openfang-api/static/js/pages/chat.js:832 · crates/openfang-api/static/js/pages/chat.js:873 — 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 (8 lines × 2 locations) crates/openfang-api/static/js/pages/chat.js:872— crates/openfang-api/static/js/pages/chat.js:872 · crates/openfang-api/static/js/pages/chat.js:883 — 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 (8 lines × 2 locations) crates/openfang-api/static/js/pages/hands.js:494— crates/openfang-api/static/js/pages/hands.js:494 · crates/openfang-api/static/js/pages/settings.js:482 — 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 (6 lines × 2 locations) crates/openfang-api/static/js/pages/chat.js:574— crates/openfang-api/static/js/pages/chat.js:574 · crates/openfang-api/static/js/pages/chat.js:582 — 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 (6 lines × 2 locations) REDACTED:478— REDACTED:478 · REDACTED:544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2 locations) crates/openfang-api/static/js/pages/workflows.js:35— crates/openfang-api/static/js/pages/workflows.js:35 · crates/openfang-api/static/js/pages/workflows.js:118 — 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.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×2
Focus outline removed in CSS without a :focus replacement crates/openfang-api/static/css/components.css:1008— `.model-switcher-search 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 crates/openfang-api/static/css/components.css:1187— `.search-input 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.
OpenAIDriver::stream (cyclomatic 92) crates/openfang-runtime/src/drivers/openai.rs:903— OpenAIDriver::stream has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OpenAIDriver::complete (cyclomatic 63) crates/openfang-runtime/src/drivers/openai.rs:452— OpenAIDriver::complete has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openfang_desktop::tray::setup_tray (cyclomatic 20) crates/openfang-desktop/src/tray.rs:29— openfang_desktop::tray::setup_tray 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.
openfang_desktop::server::load_dotenv_files (cyclomatic 16) crates/openfang-desktop/src/server.rs:156— openfang_desktop::server::load_dotenv_files 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.
ClaudeCodeDriver::stream (cyclomatic 20) crates/openfang-runtime/src/drivers/claude_code.rs:498— ClaudeCodeDriver::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.
ClaudeCodeDriver::complete (cyclomatic 17) crates/openfang-runtime/src/drivers/claude_code.rs:307— ClaudeCodeDriver::complete 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.
OpenAIDriver::stream (cognitive 273) crates/openfang-runtime/src/drivers/openai.rs:903— OpenAIDriver::stream has cognitive complexity 273 (threshold 15). Drivers by points: if/else 56 (188 pts), loops 12 (40 pts), match/switch 8 (28 pts), boolean chains 17 (nesting depth added 180). 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.
OpenAIDriver::complete (cognitive 122) crates/openfang-runtime/src/drivers/openai.rs:452— OpenAIDriver::complete has cognitive complexity 122 (threshold 15). Drivers by points: if/else 38 (88 pts), boolean chains 13, match/switch 4 (11 pts), loops 5 (10 pts) (nesting depth added 62). 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.
GeminiDriver::stream (cognitive 220) crates/openfang-runtime/src/drivers/gemini.rs:749— GeminiDriver::stream has cognitive complexity 220 (threshold 15). Drivers by points: if/else 33 (156 pts), loops 8 (32 pts), match/switch 5 (26 pts), boolean chains 6 (nesting depth added 168). 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.
GeminiDriver::complete (cognitive 20) crates/openfang-runtime/src/drivers/gemini.rs:667— GeminiDriver::complete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicDriver::stream (cognitive 152) crates/openfang-runtime/src/drivers/anthropic.rs:304— AnthropicDriver::stream has cognitive complexity 152 (threshold 15). Drivers by points: if/else 26 (109 pts), match/switch 7 (29 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 112). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicDriver::complete (cognitive 17) crates/openfang-runtime/src/drivers/anthropic.rs:199— AnthropicDriver::complete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 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.
WorkflowEngine::execute_run (cognitive 108) crates/openfang-kernel/src/workflow.rs:434— WorkflowEngine::execute_run has cognitive complexity 108 (threshold 15). Drivers by points: if/else 20 (79 pts), match/switch 5 (16 pts), loops 5 (13 pts) (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowEngine::execute_step_with_error_mode (cognitive 16) crates/openfang-kernel/src/workflow.rs:352— WorkflowEngine::execute_step_with_error_mode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 10). 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.
openfang_types::tool::normalize_schema_recursive (cognitive 53) crates/openfang-types/src/tool.rs:56— openfang_types::tool::normalize_schema_recursive has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 3 (9 pts), boolean chains 3, match/switch 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openfang_types::commands::render_help (cognitive 17) crates/openfang-types/src/commands.rs:417— openfang_types::commands::render_help has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (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.
SkillRegistry::load_all (cognitive 48) crates/openfang-skills/src/registry.rs:182— SkillRegistry::load_all has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 3 (13 pts), match/switch 2 (6 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillRegistry::load_workspace_skills (cognitive 33) crates/openfang-skills/src/registry.rs:378— SkillRegistry::load_workspace_skills has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelState::handle_list (cognitive 46) crates/openfang-cli/src/tui/screens/channels.rs:465— ChannelState::handle_list has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (43 pts), match/switch 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelState::handle_setup (cognitive 21) crates/openfang-cli/src/tui/screens/channels.rs:567— ChannelState::handle_setup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClaudeCodeDriver::stream (cognitive 44) crates/openfang-runtime/src/drivers/claude_code.rs:498— ClaudeCodeDriver::stream has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeCodeDriver::complete (cognitive 19) crates/openfang-runtime/src/drivers/claude_code.rs:307— ClaudeCodeDriver::complete has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2, match/switch 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.
ClawHubClient::install_with_options (cognitive 43) crates/openfang-skills/src/clawhub.rs:523— ClawHubClient::install_with_options has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 2 (6 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClawHubClient::get_with_retry (cognitive 33) crates/openfang-skills/src/clawhub.rs:277— ClawHubClient::get_with_retry has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (29 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_desktop::server::load_dotenv_files (cognitive 34) crates/openfang-desktop/src/server.rs:156— openfang_desktop::server::load_dotenv_files has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_desktop::tray::setup_tray (cognitive 25) crates/openfang-desktop/src/tray.rs:29— openfang_desktop::tray::setup_tray has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openfang_hands::registry::check_chromium_available (cognitive 32) crates/openfang-hands/src/registry.rs:659— openfang_hands::registry::check_chromium_available has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 15). 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.
openfang_hands::resolve_settings (cognitive 20) crates/openfang-hands/src/lib.rs:209— openfang_hands::resolve_settings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneChat::switch_model (cognitive 25) crates/openfang-cli/src/tui/chat_runner.rs:437— StandaloneChat::switch_model has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 3 (7 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.
StandaloneChat::handle_slash_command (cognitive 22) crates/openfang-cli/src/tui/chat_runner.rs:263— StandaloneChat::handle_slash_command has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 4 (9 pts) (nesting depth added 13). 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.
State::auto_select_routing_models (cognitive 19) crates/openfang-cli/src/tui/screens/init_wizard.rs:585— State::auto_select_routing_models has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::build_provider_order (cognitive 18) crates/openfang-cli/src/tui/screens/init_wizard.rs:463— State::build_provider_order has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openfang-channels/src/telegram.rs:184— crates/openfang-channels/src/telegram.rs:184-236 | crates/openfang-channels/src/telegram.rs:245-266 | crates/openfang-channels/src/telegram.rs:275-297 | crates/openfang-channels/src/telegram.rs:347-364 | crates/openfang-channels/src/telegram.rs:373-395 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openfang-cli/src/tui/screens/hands.rs:243— crates/openfang-cli/src/tui/screens/hands.rs:243-332 | crates/openfang-cli/src/tui/screens/settings.rs:546-589 | crates/openfang-cli/src/tui/screens/skills.rs:362-500 | crates/openfang-cli/src/tui/screens/skills.rs:571-666 | crates/openfang-cli/src/tui/screens/templates.rs:235-392 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (37 lines × 2) crates/openfang-api/src/routes.rs:939— crates/openfang-api/src/routes.rs:939-975 | crates/openfang-api/src/routes.rs:1162-1198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) crates/openfang-runtime/src/agent_loop.rs:608— crates/openfang-runtime/src/agent_loop.rs:608-644 | crates/openfang-runtime/src/agent_loop.rs:1849-1885 — both copies are in the same file, so extract the 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 (24–26 lines × 2) crates/openfang-cli/src/main.rs:3575— crates/openfang-cli/src/main.rs:3575-3600 | crates/openfang-cli/src/main.rs:3657-3680 — both copies are in the same file, so extract the 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 (24–26 lines × 2) crates/openfang-runtime/src/agent_loop.rs:518— crates/openfang-runtime/src/agent_loop.rs:518-541 | crates/openfang-runtime/src/agent_loop.rs:1755-1780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) crates/openfang-api/src/routes.rs:11521— crates/openfang-api/src/routes.rs:11521-11545 | crates/openfang-api/src/routes.rs:11580-11604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) crates/openfang-kernel/src/kernel.rs:2139— crates/openfang-kernel/src/kernel.rs:2139-2163 | crates/openfang-kernel/src/kernel.rs:2714-2738 — both copies are in the same file, so extract the 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 (24–25 lines × 2) crates/openfang-migrate/src/openclaw.rs:1388— crates/openfang-migrate/src/openclaw.rs:1388-1411 | crates/openfang-migrate/src/openclaw.rs:2621-2645 — both copies are in the same file, so extract the 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 (24–25 lines × 2) crates/openfang-runtime/src/drivers/copilot.rs:653— crates/openfang-runtime/src/drivers/copilot.rs:653-677 | crates/openfang-runtime/src/drivers/copilot.rs:703-726 — both copies are in the same file, so extract the 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) crates/openfang-cli/src/launcher.rs:431— crates/openfang-cli/src/launcher.rs:431-453 | crates/openfang-cli/src/tui/screens/welcome.rs:347-369 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/welcome.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1748— crates/openfang-cli/src/tui/screens/init_wizard.rs:1748-1770 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2318-2340 — both copies are in the same file, so extract the 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 (20–22 lines × 2) crates/openfang-runtime/src/drivers/anthropic.rs:205— crates/openfang-runtime/src/drivers/anthropic.rs:205-226 | crates/openfang-runtime/src/drivers/anthropic.rs:314-333 — both copies are in the same file, so extract the 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 (20–22 lines × 2) crates/openfang-runtime/src/drivers/claude_code.rs:317— crates/openfang-runtime/src/drivers/claude_code.rs:317-338 | crates/openfang-runtime/src/drivers/claude_code.rs:513-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–21 lines × 2) crates/openfang-api/src/routes.rs:8425— crates/openfang-api/src/routes.rs:8425-8445 | crates/openfang-api/src/routes.rs:8527-8544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–21 lines × 2) crates/openfang-memory/src/semantic.rs:472— crates/openfang-memory/src/semantic.rs:472-489 | crates/openfang-runtime/src/embedding.rs:256-276 — before extracting anything, compare `crates/openfang-memory/src/semantic.rs` and `crates/openfang-runtime/src/embedding.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) crates/openfang-runtime/src/agent_loop.rs:852— crates/openfang-runtime/src/agent_loop.rs:852-870 | crates/openfang-runtime/src/agent_loop.rs:2061-2079 — both copies are in the same file, so extract the 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 (19 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:701— crates/openfang-runtime/src/drivers/gemini.rs:701-719 | crates/openfang-runtime/src/drivers/vertex.rs:528-546 — before extracting anything, compare `crates/openfang-runtime/src/drivers/gemini.rs` and `crates/openfang-runtime/src/drivers/vertex.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 3) crates/openfang-channels/src/whatsapp.rs:256— crates/openfang-channels/src/whatsapp.rs:256-273 | crates/openfang-channels/src/whatsapp.rs:283-300 | crates/openfang-channels/src/whatsapp.rs:310-327 — 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 lines × 3) crates/openfang-migrate/src/openclaw.rs:2211— crates/openfang-migrate/src/openclaw.rs:2211-2228 | crates/openfang-migrate/src/openclaw.rs:2259-2276 | crates/openfang-migrate/src/openclaw.rs:3134-3151 — 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 (11–14 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:690— crates/openfang-runtime/src/drivers/openai.rs:690-703 | crates/openfang-runtime/src/drivers/openai.rs:1117-1127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–14 lines × 2) crates/openfang-runtime/src/drivers/vertex.rs:457— crates/openfang-runtime/src/drivers/vertex.rs:457-467 | crates/openfang-runtime/src/drivers/vertex.rs:672-685 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1163— crates/openfang-runtime/src/agent_loop.rs:1163-1173 | crates/openfang-runtime/src/agent_loop.rs:1348-1360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:586— crates/openfang-runtime/src/drivers/openai.rs:586-598 | crates/openfang-runtime/src/drivers/openai.rs:1013-1023 — both copies are in the same file, so extract the 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 × 5) crates/openfang-channels/src/gitter.rs:110— crates/openfang-channels/src/gitter.rs:110-121 | crates/openfang-channels/src/mattermost.rs:114-125 | crates/openfang-channels/src/mattermost.rs:446-457 | crates/openfang-channels/src/twist.rs:192-203 | crates/openfang-channels/src/twist.rs:226-237 — before extracting anything, compare `crates/openfang-channels/src/gitter.rs` and `crates/openfang-channels/src/twist.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 5) crates/openfang-channels/src/guilded.rs:95— crates/openfang-channels/src/guilded.rs:95-106 | crates/openfang-channels/src/pumble.rs:97-108 | crates/openfang-channels/src/pumble.rs:333-344 | crates/openfang-channels/src/webex.rs:129-140 | crates/openfang-channels/src/webex.rs:163-174 — before extracting anything, compare `crates/openfang-channels/src/guilded.rs` and `crates/openfang-channels/src/pumble.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/openfang-channels/src/discord.rs:897— crates/openfang-channels/src/discord.rs:897-907 | crates/openfang-channels/src/irc.rs:189-199 | crates/openfang-channels/src/mattermost.rs:198-208 | crates/openfang-channels/src/slack.rs:525-535 — before extracting anything, compare `crates/openfang-channels/src/irc.rs` and `crates/openfang-channels/src/mattermost.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/openfang-channels/src/whatsapp.rs:98— crates/openfang-channels/src/whatsapp.rs:98-108 | crates/openfang-channels/src/whatsapp.rs:260-270 | crates/openfang-channels/src/whatsapp.rs:287-297 | crates/openfang-channels/src/whatsapp.rs:314-324 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 2) crates/openfang-channels/src/flock.rs:251— crates/openfang-channels/src/flock.rs:251-260 | crates/openfang-channels/src/pumble.rs:227-237 — before extracting anything, compare `crates/openfang-channels/src/flock.rs` and `crates/openfang-channels/src/pumble.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) crates/openfang-channels/src/matrix.rs:324— crates/openfang-channels/src/matrix.rs:324-333 | crates/openfang-channels/src/matrix.rs:346-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 6) crates/openfang-channels/src/guilded.rs:97— crates/openfang-channels/src/guilded.rs:97-106 | crates/openfang-channels/src/pumble.rs:99-108 | crates/openfang-channels/src/pumble.rs:335-344 | crates/openfang-channels/src/webex.rs:131-140 | crates/openfang-channels/src/webex.rs:165-174 | crates/openfang-channels/src/webex.rs:206-215 — before extracting anything, compare `crates/openfang-channels/src/guilded.rs` and `crates/openfang-channels/src/pumble.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) crates/openfang-cli/src/main.rs:4539— crates/openfang-cli/src/main.rs:4539-4548 | crates/openfang-cli/src/main.rs:4560-4569 | crates/openfang-cli/src/main.rs:4584-4593 | crates/openfang-cli/src/main.rs:4602-4611 | crates/openfang-cli/src/main.rs:6019-6028 | crates/openfang-cli/src/main.rs:6155-6164 — 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.
Duplicated block (9 lines × 5) crates/openfang-cli/src/tui/screens/audit.rs:295— crates/openfang-cli/src/tui/screens/audit.rs:295-303 | crates/openfang-cli/src/tui/screens/channels.rs:729-737 | crates/openfang-cli/src/tui/screens/logs.rs:376-384 | crates/openfang-cli/src/tui/screens/peers.rs:183-191 | crates/openfang-cli/src/tui/screens/sessions.rs:263-271 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/logs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) crates/openfang-memory/src/session.rs:148— crates/openfang-memory/src/session.rs:148-157 | crates/openfang-memory/src/session.rs:223-231 | crates/openfang-memory/src/session.rs:266-275 | crates/openfang-memory/src/session.rs:366-374 | crates/openfang-memory/src/usage.rs:236-248 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) crates/openfang-runtime/src/agent_loop.rs:2653— crates/openfang-runtime/src/agent_loop.rs:2653-2659 | crates/openfang-runtime/src/agent_loop.rs:2703-2709 | crates/openfang-runtime/src/agent_loop.rs:2790-2796 | crates/openfang-runtime/src/agent_loop.rs:2904-2910 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) crates/openfang-memory/src/session.rs:41— crates/openfang-memory/src/session.rs:41-47 | crates/openfang-memory/src/structured.rs:23-29 | crates/openfang-memory/src/structured.rs:84-90 | crates/openfang-memory/src/structured.rs:418-424 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) crates/openfang-migrate/src/openclaw.rs:1472— crates/openfang-migrate/src/openclaw.rs:1472-1477 | crates/openfang-migrate/src/openclaw.rs:1592-1597 | crates/openfang-migrate/src/openclaw.rs:1666-1671 | crates/openfang-migrate/src/openclaw.rs:1789-1794 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) crates/openfang-channels/src/guilded.rs:138— crates/openfang-channels/src/guilded.rs:138-143 | crates/openfang-channels/src/mastodon.rs:322-327 | crates/openfang-channels/src/nextcloud.rs:177-182 | crates/openfang-channels/src/twist.rs:273-278 — before extracting anything, compare `crates/openfang-channels/src/guilded.rs` and `crates/openfang-channels/src/nextcloud.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) crates/openfang-runtime/src/agent_loop.rs:2677— crates/openfang-runtime/src/agent_loop.rs:2677-2688 | crates/openfang-runtime/src/agent_loop.rs:2708-2719 | crates/openfang-runtime/src/agent_loop.rs:2795-2806 | crates/openfang-runtime/src/agent_loop.rs:2909-2920 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) crates/openfang-channels/src/bridge.rs:2025— crates/openfang-channels/src/bridge.rs:2025-2036 | crates/openfang-channels/src/bridge.rs:2039-2050 | crates/openfang-channels/src/bridge.rs:2077-2088 | crates/openfang-channels/src/bridge.rs:2091-2102 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/openfang-memory/src/usage.rs:161— crates/openfang-memory/src/usage.rs:161-171 | crates/openfang-memory/src/usage.rs:178-188 | crates/openfang-memory/src/usage.rs:321-331 — 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 (11 lines × 3) crates/openfang-api/src/routes.rs:7236— crates/openfang-api/src/routes.rs:7236-7246 | crates/openfang-api/src/routes.rs:12432-12442 | crates/openfang-api/src/routes.rs:12449-12459 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) crates/openfang-memory/src/semantic.rs:391— crates/openfang-memory/src/semantic.rs:391-398 | crates/openfang-memory/src/session.rs:105-112 | crates/openfang-memory/src/session.rs:119-126 | crates/openfang-memory/src/session.rs:133-140 | crates/openfang-memory/src/structured.rs:244-251 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 5) crates/openfang-cli/src/tui/event.rs:1264— crates/openfang-cli/src/tui/event.rs:1264-1271 | crates/openfang-cli/src/tui/event.rs:1395-1402 | crates/openfang-cli/src/tui/event.rs:2059-2066 | crates/openfang-cli/src/tui/event.rs:2374-2381 | crates/openfang-cli/src/tui/event.rs:2675-2682 — 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.
Low cohesion: MemorySubstrate (LCOM4 6) crates/openfang-memory/src/substrate.rs:30— MemorySubstrate's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: OpenFangKernel (LCOM4 5) crates/openfang-kernel/src/kernel.rs:60— OpenFangKernel'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.
Sync-over-async blocking packages/whatsapp-gateway/index.js:92— `fs.existsSync` in `ev.on("connection.update")` 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 packages/whatsapp-gateway/index.js:93— `fs.rmSync` in `ev.on("connection.update")` 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.
Duplicated block (15 lines × 2 locations) crates/openfang-api/static/js/pages/overview.js:14— crates/openfang-api/static/js/pages/overview.js:14 · crates/openfang-api/static/js/pages/settings.js:162 — 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 (15 lines × 2 locations) sdk/javascript/index.js:425— sdk/javascript/index.js:425 · sdk/javascript/index.js:447 — 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) crates/openfang-api/static/js/pages/agents.js:675— crates/openfang-api/static/js/pages/agents.js:675 · crates/openfang-api/static/js/pages/agents.js:696 — both copies are in the same file, so extract the 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 locations) crates/openfang-api/static/js/pages/chat.js:976— crates/openfang-api/static/js/pages/chat.js:976 · crates/openfang-api/static/js/pages/chat.js:995 — 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 (13 matched lines × 2 locations) · ×2
Duplicated block with local edits (13 matched lines × 2 locations) crates/openfang-api/static/js/pages/agents.js:181— crates/openfang-api/static/js/pages/agents.js:181 · crates/openfang-api/static/js/pages/channels.js:46 — the two spans are one implementation copied and then locally edited — 66 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 with local edits (13 matched lines × 2 locations) crates/openfang-api/static/js/pages/sessions.js:98— crates/openfang-api/static/js/pages/sessions.js:98 · crates/openfang-api/static/js/pages/sessions.js:142 — the two spans are one implementation copied and then locally edited — 100 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 (5 lines × 2 locations) crates/openfang-api/static/js/pages/channels.js:183— crates/openfang-api/static/js/pages/channels.js:183 · crates/openfang-api/static/js/pages/hands.js:546 — 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 (5 lines × 2 locations) crates/openfang-api/static/js/pages/logs.js:216— crates/openfang-api/static/js/pages/logs.js:216 · crates/openfang-api/static/js/pages/overview.js:285 — 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.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
chat.chatPage.handleWsMessage (cyclomatic 123) crates/openfang-api/static/js/pages/chat.js:747— chat.chatPage.handleWsMessage has cyclomatic complexity 123 (threshold 15). Of this number, 113 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.
chatPage.handleWsMessage (cyclomatic 123) crates/openfang-api/static/js/pages/chat.js:747— chatPage.handleWsMessage has cyclomatic complexity 123 (threshold 15). Of this number, 110 points are the body's own statements and 13 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KernelConfig::validate (cyclomatic 94) crates/openfang-types/src/config.rs:3382— KernelConfig::validate has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chatPage.executeSlashCommand (cyclomatic 75) crates/openfang-api/static/js/pages/chat.js:439— chatPage.executeSlashCommand has cyclomatic complexity 75 (threshold 15). Of this number, 54 points are the body's own statements and 21 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat.chatPage.executeSlashCommand (cyclomatic 67) crates/openfang-api/static/js/pages/chat.js:439— chat.chatPage.executeSlashCommand has cyclomatic complexity 67 (threshold 15). Of this number, 46 points are the body's own statements and 21 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GeminiDriver::stream (cyclomatic 56) crates/openfang-runtime/src/drivers/gemini.rs:749— GeminiDriver::stream 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.
wizard.wizardPage (cyclomatic 54) crates/openfang-api/static/js/pages/wizard.js:14— wizard.wizardPage has cyclomatic complexity 54 (threshold 15). Of this number, 53 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AnthropicDriver::stream (cyclomatic 53) crates/openfang-runtime/src/drivers/anthropic.rs:304— AnthropicDriver::stream has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiscordAdapter::start (cyclomatic 47) crates/openfang-channels/src/discord.rs:279— DiscordAdapter::start 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.
app.document.addEventListener("alpine:init") (cyclomatic 40) crates/openfang-api/static/js/app.js:123— app.document.addEventListener("alpine:init") has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 40) crates/openfang-api/static/js/app.js:123— (anonymous) has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 2 of the 40 points are its own statements and the rest belongs to 13 function items inside it that branch (checkAuth, checkOnboarding, refreshApprovals, …). 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.
ChatState::handle_key (cyclomatic 38) crates/openfang-cli/src/tui/screens/chat.rs:252— ChatState::handle_key has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MatrixAdapter::start (cyclomatic 37) crates/openfang-channels/src/matrix.rs:370— MatrixAdapter::start 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.
WorkflowEngine::execute_run (cyclomatic 37) crates/openfang-kernel/src/workflow.rs:434— WorkflowEngine::execute_run 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.
hands.handsPage._renderCharts (cyclomatic 37) crates/openfang-api/static/js/pages/hands.js:740— hands.handsPage._renderCharts has cyclomatic complexity 37 (threshold 15). Of this number, 35 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.
handsPage._renderCharts (cyclomatic 37) crates/openfang-api/static/js/pages/hands.js:740— handsPage._renderCharts has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
settings.settingsPage (cyclomatic 34) crates/openfang-api/static/js/pages/settings.js:4— settings.settingsPage has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 408, 326, 390, …). 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.
workflow-builder.workflowBuilder.generateToml (cyclomatic 34) REDACTED:472— workflow-builder.workflowBuilder.generateToml has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.startConnection (cyclomatic 34) packages/whatsapp-gateway/index.js:37— index.startConnection has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 119, 62). 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.
workflowBuilder.generateToml (cyclomatic 34) REDACTED:472— workflowBuilder.generateToml has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs 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.
chat.chatPage (cyclomatic 33) crates/openfang-api/static/js/pages/chat.js:4— chat.chatPage has cyclomatic complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
chatPage.init (cyclomatic 31) crates/openfang-api/static/js/pages/chat.js:134— chatPage.init has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 170, 149, 223, …). 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.
chat.chatPage.init (cyclomatic 30) crates/openfang-api/static/js/pages/chat.js:134— chat.chatPage.init 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 8 function literals inside it that branch (lines 170, 149, 216, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workflow-builder.workflowBuilder.renderCanvas (cyclomatic 29) REDACTED:75— workflow-builder.workflowBuilder.renderCanvas 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.
workflowBuilder.renderCanvas (cyclomatic 29) REDACTED:75— workflowBuilder.renderCanvas 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.
IrcAdapter::start (cyclomatic 28) crates/openfang-channels/src/irc.rs:230— IrcAdapter::start 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.
ChannelState::handle_list (cyclomatic 28) crates/openfang-cli/src/tui/screens/channels.rs:465— ChannelState::handle_list 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.
hands.handsPage._applyKvToData (cyclomatic 27) crates/openfang-api/static/js/pages/hands.js:690— hands.handsPage._applyKvToData 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.
handsPage._applyKvToData (cyclomatic 27) crates/openfang-api/static/js/pages/hands.js:690— handsPage._applyKvToData 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.
SlackAdapter::start (cyclomatic 26) crates/openfang-channels/src/slack.rs:182— SlackAdapter::start 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.
scheduler.schedulerPage.describeCron (cyclomatic 26) crates/openfang-api/static/js/pages/scheduler.js:529— scheduler.schedulerPage.describeCron 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.
schedulerPage.describeCron (cyclomatic 26) crates/openfang-api/static/js/pages/scheduler.js:529— schedulerPage.describeCron 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.
ZulipAdapter::start (cyclomatic 25) crates/openfang-channels/src/zulip.rs:190— ZulipAdapter::start 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.
MastodonAdapter::start (cyclomatic 24) crates/openfang-channels/src/mastodon.rs:316— MastodonAdapter::start 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.
WebexAdapter::start (cyclomatic 24) crates/openfang-channels/src/webex.rs:241— WebexAdapter::start 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.
openfang_types::tool::normalize_schema_recursive (cyclomatic 24) crates/openfang-types/src/tool.rs:56— openfang_types::tool::normalize_schema_recursive 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.
GuildedAdapter::start (cyclomatic 23) crates/openfang-channels/src/guilded.rs:132— GuildedAdapter::start 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.
NostrAdapter::start (cyclomatic 23) crates/openfang-channels/src/nostr.rs:163— NostrAdapter::start 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.
RevoltAdapter::start (cyclomatic 23) crates/openfang-channels/src/revolt.rs:309— RevoltAdapter::start 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.
NextcloudAdapter::start (cyclomatic 22) crates/openfang-channels/src/nextcloud.rs:171— NextcloudAdapter::start 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.
usage.analyticsPage._extractProvider (cyclomatic 22) crates/openfang-api/static/js/pages/usage.js:149— usage.analyticsPage._extractProvider 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.
analyticsPage._extractProvider (cyclomatic 22) crates/openfang-api/static/js/pages/usage.js:149— analyticsPage._extractProvider 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.
GoogleChatAdapter::start (cyclomatic 21) crates/openfang-channels/src/google_chat.rs:151— GoogleChatAdapter::start 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.
MumbleAdapter::start (cyclomatic 21) crates/openfang-channels/src/mumble.rs:283— MumbleAdapter::start 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.
TwitchAdapter::start (cyclomatic 21) crates/openfang-channels/src/twitch.rs:115— TwitchAdapter::start 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.
SessionsState::handle_key (cyclomatic 21) crates/openfang-cli/src/tui/screens/sessions.rs:85— SessionsState::handle_key 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.
SetupWizard::build_plan (cyclomatic 21) crates/openfang-kernel/src/wizard.rs:55— SetupWizard::build_plan 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.
VertexAIDriver::stream (cyclomatic 21) crates/openfang-runtime/src/drivers/vertex.rs:572— VertexAIDriver::stream 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.
app.toolIcon (cyclomatic 21) crates/openfang-api/static/js/app.js:81— app.toolIcon 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.
RocketChatAdapter::start (cyclomatic 20) crates/openfang-channels/src/rocketchat.rs:142— RocketChatAdapter::start 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.
TwistAdapter::start (cyclomatic 20) crates/openfang-channels/src/twist.rs:267— TwistAdapter::start 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.
WebFetchEngine::fetch_with_options (cyclomatic 20) crates/openfang-runtime/src/web_fetch.rs:46— WebFetchEngine::fetch_with_options 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.
ClawHubClient::install_with_options (cyclomatic 20) crates/openfang-skills/src/clawhub.rs:523— ClawHubClient::install_with_options 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.
hands.handsPage (cyclomatic 20) crates/openfang-api/static/js/pages/hands.js:4— hands.handsPage 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.
skills.skillsPage (cyclomatic 20) crates/openfang-api/static/js/pages/skills.js:4— skills.skillsPage has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
skillsPage.categories (cyclomatic 20) crates/openfang-api/static/js/pages/skills.js:48— skillsPage.categories has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BlueskyAdapter::start (cyclomatic 19) crates/openfang-channels/src/bluesky.rs:348— BlueskyAdapter::start 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.
MattermostAdapter::start (cyclomatic 19) crates/openfang-channels/src/mattermost.rs:239— MattermostAdapter::start 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.
NtfyAdapter::start (cyclomatic 19) crates/openfang-channels/src/ntfy.rs:150— NtfyAdapter::start 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.
RedditAdapter::start (cyclomatic 19) crates/openfang-channels/src/reddit.rs:319— RedditAdapter::start 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.
AuditLog::with_db (cyclomatic 19) crates/openfang-runtime/src/audit.rs:109— AuditLog::with_db has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
scheduler.schedulerPage.validateTarget (cyclomatic 19) crates/openfang-api/static/js/pages/scheduler.js:313— scheduler.schedulerPage.validateTarget 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.
schedulerPage.validateTarget (cyclomatic 19) crates/openfang-api/static/js/pages/scheduler.js:313— schedulerPage.validateTarget 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.
DiscourseAdapter::start (cyclomatic 18) crates/openfang-channels/src/discourse.rs:176— DiscourseAdapter::start 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.
GitterAdapter::start (cyclomatic 18) crates/openfang-channels/src/gitter.rs:159— GitterAdapter::start 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.
GotifyAdapter::start (cyclomatic 18) crates/openfang-channels/src/gotify.rs:155— GotifyAdapter::start 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.
KeybaseAdapter::start (cyclomatic 18) crates/openfang-channels/src/keybase.rs:204— KeybaseAdapter::start 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.
TelegramAdapter::start (cyclomatic 18) crates/openfang-channels/src/telegram.rs:569— TelegramAdapter::start 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.
app.app.init (cyclomatic 18) crates/openfang-api/static/js/app.js:305— app.app.init has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 343, handleHash, a function literal at line 309). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runtime.document.addEventListener("alpine:init") (cyclomatic 18) crates/openfang-api/static/js/pages/runtime.js:2— runtime.document.addEventListener("alpine:init") has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 3, 49). 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.
wizard.wizardPage.createAgent (cyclomatic 18) crates/openfang-api/static/js/pages/wizard.js:492— wizard.wizardPage.createAgent 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.
index.server (cyclomatic 18) packages/whatsapp-gateway/index.js:275— index.server has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous) (cyclomatic 18) packages/whatsapp-gateway/index.js:275— (anonymous) has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous)._doConnect (cyclomatic 18) crates/openfang-api/static/js/api.js:223— (anonymous)._doConnect has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (onclose, onopen, onmessage, …). 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.init (cyclomatic 18) crates/openfang-api/static/js/app.js:305— app.init has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 343, handleHash, a function literal at line 309, …). 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.
wizardPage.createAgent (cyclomatic 18) crates/openfang-api/static/js/pages/wizard.js:492— wizardPage.createAgent 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.
KernelBridgeAdapter::manage_schedule_text (cyclomatic 17) crates/openfang-api/src/channel_bridge.rs:496— KernelBridgeAdapter::manage_schedule_text has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: KernelBridgeAdapter::channel_overrides (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
ThreemaAdapter::start (cyclomatic 17) crates/openfang-channels/src/threema.rs:187— ThreemaAdapter::start 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.
AgentSelectState::handle_agent_list (cyclomatic 17) crates/openfang-cli/src/tui/screens/agents.rs:375— AgentSelectState::handle_agent_list has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: openfang_cli::tui::screens::agents::draw (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
LogsState::handle_key (cyclomatic 17) crates/openfang-cli/src/tui/screens/logs.rs:183— LogsState::handle_key has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
UsageState::handle_key (cyclomatic 17) crates/openfang-cli/src/tui/screens/usage.rs:83— UsageState::handle_key has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
openfang_hands::registry::check_chromium_available (cyclomatic 17) crates/openfang-hands/src/registry.rs:659— openfang_hands::registry::check_chromium_available 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.
ImageGenRequest::validate (cyclomatic 17) crates/openfang-types/src/media.rs:306— ImageGenRequest::validate 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.
chat.chatPage.sendMessage (cyclomatic 17) crates/openfang-api/static/js/pages/chat.js:1071— chat.chatPage.sendMessage has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
hands.handsPage.installDeps (cyclomatic 17) crates/openfang-api/static/js/pages/hands.js:151— hands.handsPage.installDeps has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
hands.handsPage.getInstallCmd (cyclomatic 17) crates/openfang-api/static/js/pages/hands.js:254— hands.handsPage.getInstallCmd 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.
usage.analyticsPage.modelTier (cyclomatic 17) crates/openfang-api/static/js/pages/usage.js:304— usage.analyticsPage.modelTier 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.
(anonymous).request (cyclomatic 17) crates/openfang-api/static/js/api.js:158— (anonymous).request has cyclomatic complexity 17 (threshold 15). 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 literals inside it that branch (lines 161, 175, 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.
chatPage.sendMessage (cyclomatic 17) crates/openfang-api/static/js/pages/chat.js:1071— chatPage.sendMessage has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs 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.
handsPage.installDeps (cyclomatic 17) crates/openfang-api/static/js/pages/hands.js:151— handsPage.installDeps has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
handsPage.getInstallCmd (cyclomatic 17) crates/openfang-api/static/js/pages/hands.js:254— handsPage.getInstallCmd 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.
analyticsPage.modelTier (cyclomatic 17) crates/openfang-api/static/js/pages/usage.js:304— analyticsPage.modelTier 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.
wizardPage.suggestedMessages (cyclomatic 17) crates/openfang-api/static/js/pages/wizard.js:179— wizardPage.suggestedMessages 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.
WeComAdapter::start (cyclomatic 16) crates/openfang-channels/src/wecom.rs:348— WeComAdapter::start 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.
StandaloneChat::handle_slash_command (cyclomatic 16) crates/openfang-cli/src/tui/chat_runner.rs:263— StandaloneChat::handle_slash_command has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MemoryState::handle_kv_browser (cyclomatic 16) crates/openfang-cli/src/tui/screens/memory.rs:137— MemoryState::handle_kv_browser 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.
SkillsState::handle_clawhub (cyclomatic 16) crates/openfang-cli/src/tui/screens/skills.rs:227— SkillsState::handle_clawhub 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.
TriggerState::handle_create (cyclomatic 16) crates/openfang-cli/src/tui/screens/triggers.rs:144— TriggerState::handle_create has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CronJob::validate_action (cyclomatic 16) crates/openfang-types/src/scheduler.rs:322— CronJob::validate_action 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.
chat.chatPage.loadSession (cyclomatic 16) crates/openfang-api/static/js/pages/chat.js:643— chat.chatPage.loadSession has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
hands.handsPage._fetchDashboardData (cyclomatic 16) crates/openfang-api/static/js/pages/hands.js:620— hands.handsPage._fetchDashboardData 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.settingsPage.formatConfigValue (cyclomatic 16) crates/openfang-api/static/js/pages/settings.js:666— settings.settingsPage.formatConfigValue 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.
chatPage.loadSession (cyclomatic 16) crates/openfang-api/static/js/pages/chat.js:643— chatPage.loadSession has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 655, 661, 652, …). 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.
handsPage._fetchDashboardData (cyclomatic 16) crates/openfang-api/static/js/pages/hands.js:620— handsPage._fetchDashboardData 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.
(anonymous)::(anonymous)::loadData (cyclomatic 16) crates/openfang-api/static/js/pages/runtime.js:18— (anonymous)::(anonymous)::loadData 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.
settingsPage.formatConfigValue (cyclomatic 16) crates/openfang-api/static/js/pages/settings.js:666— settingsPage.formatConfigValue 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.
chat.chatPage.handleWsMessage (cognitive 214) crates/openfang-api/static/js/pages/chat.js:747— chat.chatPage.handleWsMessage has cognitive complexity 214 (threshold 15). Drivers by points: if/else 47 (123 pts), boolean chains 43, ternaries 11 (29 pts), error handling 2 (12 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 108). Of this number, 202 points are the body's own statements and 12 belong to 4 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
chatPage.handleWsMessage (cognitive 213) crates/openfang-api/static/js/pages/chat.js:747— chatPage.handleWsMessage has cognitive complexity 213 (threshold 15). Drivers by points: if/else 47 (123 pts), boolean chains 42, ternaries 11 (29 pts), error handling 2 (12 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 108). Of this number, 198 points are the body's own statements and 15 belong to 8 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MatrixAdapter::start (cognitive 147) crates/openfang-channels/src/matrix.rs:370— MatrixAdapter::start has cognitive complexity 147 (threshold 15). Drivers by points: if/else 30 (119 pts), loops 4 (13 pts), match/switch 4 (13 pts), boolean chains 2 (nesting depth added 107). 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.
KernelConfig::validate (cognitive 141) crates/openfang-types/src/config.rs:3382— KernelConfig::validate has cognitive complexity 141 (threshold 15). Drivers by points: if/else 86 (135 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiscordAdapter::start (cognitive 132) crates/openfang-channels/src/discord.rs:279— DiscordAdapter::start has cognitive complexity 132 (threshold 15). Drivers by points: if/else 23 (91 pts), match/switch 9 (31 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chatPage.executeSlashCommand (cognitive 106) crates/openfang-api/static/js/pages/chat.js:439— chatPage.executeSlashCommand has cognitive complexity 106 (threshold 15). Drivers by points: if/else 24 (41 pts), ternaries 10 (25 pts), error handling 9 (23 pts), boolean chains 16, match/switch 1 (nesting depth added 46). Of this number, 80 points are the body's own statements and 26 belong to 19 function items inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MastodonAdapter::start (cognitive 80) crates/openfang-channels/src/mastodon.rs:316— MastodonAdapter::start has cognitive complexity 80 (threshold 15). Drivers by points: if/else 14 (56 pts), loops 4 (12 pts), match/switch 4 (12 pts) (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ZulipAdapter::start (cognitive 78) crates/openfang-channels/src/zulip.rs:190— ZulipAdapter::start has cognitive complexity 78 (threshold 15). Drivers by points: if/else 19 (60 pts), match/switch 5 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 51). 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.
IrcAdapter::start (cognitive 75) crates/openfang-channels/src/irc.rs:230— IrcAdapter::start has cognitive complexity 75 (threshold 15). Drivers by points: if/else 12 (49 pts), match/switch 5 (17 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MumbleAdapter::start (cognitive 75) crates/openfang-channels/src/mumble.rs:283— MumbleAdapter::start has cognitive complexity 75 (threshold 15). Drivers by points: if/else 16 (64 pts), loops 2 (6 pts), match/switch 2 (5 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat.chatPage.executeSlashCommand (cognitive 73) crates/openfang-api/static/js/pages/chat.js:439— chat.chatPage.executeSlashCommand has cognitive complexity 73 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 22, ternaries 3 (7 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 22). Of this number, 48 points are the body's own statements and 25 belong to 9 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
handsPage._renderCharts (cognitive 70) crates/openfang-api/static/js/pages/hands.js:740— handsPage._renderCharts has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 15 (40 pts), if/else 8 (11 pts), boolean chains 10, loops 3 (9 pts) (nesting depth added 34). Of this number, 64 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VertexAIDriver::stream (cognitive 68) crates/openfang-runtime/src/drivers/vertex.rs:572— VertexAIDriver::stream has cognitive complexity 68 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 4 (13 pts), match/switch 1 (8 pts), boolean chains 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NostrAdapter::start (cognitive 65) crates/openfang-channels/src/nostr.rs:163— NostrAdapter::start has cognitive complexity 65 (threshold 15). Drivers by points: if/else 12 (39 pts), match/switch 5 (19 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TwistAdapter::start (cognitive 65) crates/openfang-channels/src/twist.rs:267— TwistAdapter::start has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (44 pts), match/switch 4 (11 pts), loops 4 (10 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitterAdapter::start (cognitive 63) crates/openfang-channels/src/gitter.rs:159— GitterAdapter::start has cognitive complexity 63 (threshold 15). Drivers by points: if/else 10 (45 pts), match/switch 3 (9 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NtfyAdapter::start (cognitive 62) crates/openfang-channels/src/ntfy.rs:150— NtfyAdapter::start has cognitive complexity 62 (threshold 15). Drivers by points: if/else 11 (44 pts), match/switch 3 (9 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextcloudAdapter::start (cognitive 59) crates/openfang-channels/src/nextcloud.rs:171— NextcloudAdapter::start has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (39 pts), match/switch 5 (13 pts), loops 4 (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.
SlackAdapter::start (cognitive 59) crates/openfang-channels/src/slack.rs:182— SlackAdapter::start has cognitive complexity 59 (threshold 15). Drivers by points: if/else 9 (33 pts), match/switch 8 (21 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflow-builder.workflowBuilder.generateToml (cognitive 59) REDACTED:472— workflow-builder.workflowBuilder.generateToml has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 14, loops 3 (7 pts), ternaries 1 (5 pts) (nesting depth added 26). Of this number, 58 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.
workflowBuilder.generateToml (cognitive 59) REDACTED:472— workflowBuilder.generateToml has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 14, loops 3 (7 pts), ternaries 1 (5 pts) (nesting depth added 26). Of this number, 58 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
startConnection (cognitive 57) packages/whatsapp-gateway/index.js:37— startConnection has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (29 pts), ternaries 5 (16 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (nesting depth added 23). None of this is in the body itself: all 57 points belong to 3 function literals inside it that branch (lines 119, 62, 104). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WebexAdapter::start (cognitive 54) crates/openfang-channels/src/webex.rs:241— WebexAdapter::start has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 7 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RocketChatAdapter::start (cognitive 52) crates/openfang-channels/src/rocketchat.rs:142— RocketChatAdapter::start has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (32 pts), match/switch 5 (13 pts), loops 4 (7 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wizard.wizardPage (cognitive 52) crates/openfang-api/static/js/pages/wizard.js:14— wizard.wizardPage has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 29, ternaries 19, if/else 4. Of this number, 51 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KeybaseAdapter::start (cognitive 51) crates/openfang-channels/src/keybase.rs:204— KeybaseAdapter::start has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (37 pts), match/switch 3 (7 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GotifyAdapter::start (cognitive 50) crates/openfang-channels/src/gotify.rs:155— GotifyAdapter::start has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (33 pts), match/switch 4 (14 pts), loops 2 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedditAdapter::start (cognitive 50) crates/openfang-channels/src/reddit.rs:319— RedditAdapter::start has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 6 (16 pts), loops 4 (9 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RevoltAdapter::start (cognitive 50) crates/openfang-channels/src/revolt.rs:309— RevoltAdapter::start has cognitive complexity 50 (threshold 15). Drivers by points: if/else 6 (27 pts), match/switch 5 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TwitchAdapter::start (cognitive 49) crates/openfang-channels/src/twitch.rs:115— TwitchAdapter::start has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (34 pts), match/switch 3 (8 pts), loops 3 (5 pts), boolean chains 2 (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.
GuildedAdapter::start (cognitive 47) crates/openfang-channels/src/guilded.rs:132— GuildedAdapter::start has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 6 (16 pts), loops 2 (3 pts), boolean chains 2 (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.
GoogleChatAdapter::start (cognitive 46) crates/openfang-channels/src/google_chat.rs:151— GoogleChatAdapter::start has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 4 (8 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlueskyAdapter::start (cognitive 45) crates/openfang-channels/src/bluesky.rs:348— BlueskyAdapter::start has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 6 (13 pts), 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.
MattermostAdapter::start (cognitive 43) crates/openfang-channels/src/mattermost.rs:239— MattermostAdapter::start has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 5 (14 pts), loops 2 (3 pts), boolean chains 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.
(anonymous) (cognitive 42) crates/openfang-api/static/js/app.js:123— (anonymous) has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 14, error handling 8, ternaries 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 13 function items inside it that branch (checkAuth, checkOnboarding, refreshApprovals, …). 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.document.addEventListener("alpine:init") (cognitive 40) crates/openfang-api/static/js/app.js:123— app.document.addEventListener("alpine:init") has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 13, error handling 8, 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.
hands.handsPage._renderCharts (cognitive 40) crates/openfang-api/static/js/pages/hands.js:740— hands.handsPage._renderCharts has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, ternaries 5 (10 pts), loops 3 (9 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.
DiscourseAdapter::start (cognitive 39) crates/openfang-channels/src/discourse.rs:176— DiscourseAdapter::start has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreemaAdapter::start (cognitive 37) crates/openfang-channels/src/threema.rs:187— ThreemaAdapter::start has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflow-builder.workflowBuilder.renderCanvas (cognitive 37) REDACTED:75— workflow-builder.workflowBuilder.renderCanvas has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, ternaries 4 (8 pts), loops 5 (7 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.
chatPage.init (cognitive 37) crates/openfang-api/static/js/pages/chat.js:134— chatPage.init has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 11, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 170, 223, 149, …). 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.
workflowBuilder.renderCanvas (cognitive 37) REDACTED:75— workflowBuilder.renderCanvas has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, ternaries 4 (8 pts), loops 5 (7 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.
SetupWizard::build_plan (cognitive 36) crates/openfang-kernel/src/wizard.rs:55— SetupWizard::build_plan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (12 pts), match/switch 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.
TelegramAdapter::start (cognitive 34) crates/openfang-channels/src/telegram.rs:569— TelegramAdapter::start has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 7 (13 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings.settingsPage (cognitive 34) crates/openfang-api/static/js/pages/settings.js:4— settings.settingsPage has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 14 (16 pts), ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 408, 326, 390, …). 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.
StreamingThinkFilter::process (cognitive 32) crates/openfang-runtime/src/think_filter.rs:52— StreamingThinkFilter::process has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (31 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.
CronJob::validate_action (cognitive 32) crates/openfang-types/src/scheduler.rs:322— CronJob::validate_action has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 1 (nesting depth added 18). 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.
ChatState::handle_key (cognitive 31) crates/openfang-cli/src/tui/screens/chat.rs:252— ChatState::handle_key has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QwenCodeDriver::stream (cognitive 31) crates/openfang-runtime/src/drivers/qwen_code.rs:292— QwenCodeDriver::stream has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 2 (5 pts), loops 2 (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.
LoopGuard::count_ping_pong_repeats (cognitive 31) crates/openfang-runtime/src/loop_guard.rs:448— LoopGuard::count_ping_pong_repeats has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinkedInAdapter::start (cognitive 30) crates/openfang-channels/src/linkedin.rs:225— LinkedInAdapter::start has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignalAdapter::start (cognitive 29) crates/openfang-channels/src/signal.rs:104— SignalAdapter::start has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelCatalog::detect_auth (cognitive 29) crates/openfang-runtime/src/model_catalog.rs:57— ModelCatalog::detect_auth has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat.chatPage (cognitive 29) crates/openfang-api/static/js/pages/chat.js:4— chat.chatPage has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, if/else 10, ternaries 3 (4 pts), match/switch 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 12 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handsPage._applyKvToData (cognitive 28) crates/openfang-api/static/js/pages/hands.js:690— handsPage._applyKvToData has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat.chatPage.init (cognitive 27) crates/openfang-api/static/js/pages/chat.js:134— chat.chatPage.init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 11 (nesting depth added 2). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 170, 223, 216, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
hands.handsPage._applyKvToData (cognitive 27) crates/openfang-api/static/js/pages/hands.js:690— hands.handsPage._applyKvToData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionStore::append_canonical (cognitive 26) crates/openfang-memory/src/session.rs:415— SessionStore::append_canonical has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebFetchEngine::fetch_with_options (cognitive 26) crates/openfang-runtime/src/web_fetch.rs:46— WebFetchEngine::fetch_with_options has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentsPage.spawnAgent (cognitive 25) crates/openfang-api/static/js/pages/agents.js:514— agentsPage.spawnAgent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 3 (7 pts), boolean chains 2, 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.
KernelBridgeAdapter::manage_schedule_text (cognitive 24) crates/openfang-api/src/channel_bridge.rs:496— KernelBridgeAdapter::manage_schedule_text has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 8 (18 pts), if/else 3 (6 pts) (nesting depth added 13). 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.
HandsState::handle_active (cognitive 24) crates/openfang-cli/src/tui/screens/hands.rs:136— HandsState::handle_active has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionsState::handle_key (cognitive 24) crates/openfang-cli/src/tui/screens/sessions.rs:85— SessionsState::handle_key has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillsState::handle_installed (cognitive 24) crates/openfang-cli/src/tui/screens/skills.rs:177— SkillsState::handle_installed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scheduler.schedulerPage.validateTarget (cognitive 24) crates/openfang-api/static/js/pages/scheduler.js:313— scheduler.schedulerPage.validateTarget has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chatPage.sendMessage (cognitive 24) crates/openfang-api/static/js/pages/chat.js:1071— chatPage.sendMessage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 23 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schedulerPage.validateTarget (cognitive 24) crates/openfang-api/static/js/pages/scheduler.js:313— schedulerPage.validateTarget has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WeComAdapter::start (cognitive 23) crates/openfang-channels/src/wecom.rs:348— WeComAdapter::start has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentSelectState::handle_agent_list (cognitive 23) crates/openfang-cli/src/tui/screens/agents.rs:375— AgentSelectState::handle_agent_list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (6 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.
scheduler.schedulerPage.describeCron (cognitive 23) crates/openfang-api/static/js/pages/scheduler.js:529— scheduler.schedulerPage.describeCron has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (9 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.
(anonymous).request (cognitive 23) crates/openfang-api/static/js/api.js:158— (anonymous).request has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 4 (7 pts), boolean chains 5 (nesting depth added 7). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 161, 175, 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.
wizardPage.createAgent (cognitive 23) crates/openfang-api/static/js/pages/wizard.js:492— wizardPage.createAgent has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 7, if/else 5, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DingTalkStreamAdapter::start (cognitive 22) crates/openfang-channels/src/dingtalk_stream.rs:163— DingTalkStreamAdapter::start has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). 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.
chat.chatPage.sendMessage (cognitive 22) crates/openfang-api/static/js/pages/chat.js:1071— chat.chatPage.sendMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 7). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handsPage.installDeps (cognitive 22) crates/openfang-api/static/js/pages/hands.js:151— handsPage.installDeps has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 2 (5 pts), error handling 1, ternaries 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 2 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.
schedulerPage.describeCron (cognitive 22) crates/openfang-api/static/js/pages/scheduler.js:529— schedulerPage.describeCron has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (8 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmailAdapter::start (cognitive 21) crates/openfang-channels/src/email.rs:317— EmailAdapter::start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemoryState::handle_kv_browser (cognitive 21) crates/openfang-cli/src/tui/screens/memory.rs:137— MemoryState::handle_kv_browser has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 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.
BackgroundExecutor::start_agent (cognitive 21) crates/openfang-kernel/src/background.rs:48— BackgroundExecutor::start_agent has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 2 (6 pts), loops 2 (4 pts) (nesting depth added 12). 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.
StreamingDirectiveAccumulator::consume (cognitive 21) crates/openfang-runtime/src/reply_directives.rs:53— StreamingDirectiveAccumulator::consume has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hands.handsPage.installDeps (cognitive 21) crates/openfang-api/static/js/pages/hands.js:151— hands.handsPage.installDeps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 2 (5 pts), error handling 1 (nesting depth added 6). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_stream (cognitive 21) sdk/javascript/index.js:71— _stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StructuredStore::load_all_agents (cognitive 20) crates/openfang-memory/src/structured.rs:262— StructuredStore::load_all_agents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 4 (8 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.
OpenFang._stream (cognitive 20) REDACTED:82— OpenFang._stream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (5 pts), loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app.toolIcon (cognitive 20) crates/openfang-api/static/js/app.js:81— app.toolIcon has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
hands.handsPage (cognitive 20) crates/openfang-api/static/js/pages/hands.js:4— hands.handsPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsState::handle_providers (cognitive 19) crates/openfang-cli/src/tui/screens/settings.rs:174— SettingsState::handle_providers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (nesting depth added 10). 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.
SemanticStore::recall_with_embedding (cognitive 19) crates/openfang-memory/src/semantic.rs:186— SemanticStore::recall_with_embedding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageGenRequest::validate (cognitive 19) crates/openfang-types/src/media.rs:306— ImageGenRequest::validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, match/switch 3 (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.
agents.agentsPage.spawnAgent (cognitive 19) crates/openfang-api/static/js/pages/agents.js:514— agents.agentsPage.spawnAgent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skills.skillsPage (cognitive 19) crates/openfang-api/static/js/pages/skills.js:4— skills.skillsPage has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 18, 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.
index.server (cognitive 19) packages/whatsapp-gateway/index.js:275— index.server has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(anonymous) (cognitive 19) packages/whatsapp-gateway/index.js:275— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
handsPage.launchHand (cognitive 19) crates/openfang-api/static/js/pages/hands.js:392— handsPage.launchHand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skillsPage.categories (cognitive 19) crates/openfang-api/static/js/pages/skills.js:48— skillsPage.categories has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 18, 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.
AgentRouter::binding_matches (cognitive 18) crates/openfang-channels/src/router.rs:326— AgentRouter::binding_matches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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.
UsageState::handle_key (cognitive 18) crates/openfang-cli/src/tui/screens/usage.rs:83— UsageState::handle_key has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (6 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.
WelcomeState::handle_key (cognitive 18) crates/openfang-cli/src/tui/screens/welcome.rs:153— WelcomeState::handle_key has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hands.handsPage.launchHand (cognitive 18) crates/openfang-api/static/js/pages/hands.js:392— hands.handsPage.launchHand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
logsPage.startStreaming (cognitive 18) crates/openfang-api/static/js/pages/logs.js:30— logsPage.startStreaming has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (onmessage, a function literal at line 71, onerror, …). 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.
WizardState::handle_provider (cognitive 17) crates/openfang-cli/src/tui/screens/wizard.rs:277— WizardState::handle_provider has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PairingManager::notify_devices (cognitive 17) crates/openfang-kernel/src/pairing.rs:188— PairingManager::notify_devices has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (11 pts), loops 2 (6 pts) (nesting depth added 9). 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.
AuditLog::with_db (cognitive 17) crates/openfang-runtime/src/audit.rs:109— AuditLog::with_db has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (4 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)._doConnect (cognitive 17) crates/openfang-api/static/js/api.js:223— (anonymous)._doConnect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (onclose, onopen, onmessage, …). 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.
chatPage.loadSession (cognitive 17) crates/openfang-api/static/js/pages/chat.js:643— chatPage.loadSession has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (6 pts), error handling 1, if/else 1 (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 5 function literals inside it that branch (lines 655, 661, 652, …). 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.
handsPage.openSetupWizard (cognitive 17) crates/openfang-api/static/js/pages/hands.js:95— handsPage.openSetupWizard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, loops 2 (4 pts), 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.
handsPage._fetchDashboardData (cognitive 17) crates/openfang-api/static/js/pages/hands.js:620— handsPage._fetchDashboardData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamChunker::try_flush (cognitive 16) crates/openfang-api/src/stream_chunker.rs:56— StreamChunker::try_flush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 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.
TemplatesState::handle_key (cognitive 16) crates/openfang-cli/src/tui/screens/templates.rs:190— TemplatesState::handle_key has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserSession::find_page_ws (cognitive 16) crates/openfang-runtime/src/browser.rs:370— BrowserSession::find_page_ws has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockDriver::complete (cognitive 16) crates/openfang-runtime/src/drivers/bedrock.rs:693— BedrockDriver::complete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillVerifier::security_scan (cognitive 16) crates/openfang-skills/src/verify.rs:46— SkillVerifier::security_scan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agents.agentsPage (cognitive 16) crates/openfang-api/static/js/pages/agents.js:19— agents.agentsPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 183, 196, 177). 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.
hands.handsPage.openSetupWizard (cognitive 16) crates/openfang-api/static/js/pages/hands.js:95— hands.handsPage.openSetupWizard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, loops 2 (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.
hands.handsPage._fetchDashboardData (cognitive 16) crates/openfang-api/static/js/pages/hands.js:620— hands.handsPage._fetchDashboardData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
scheduler.schedulerPage.sanitizeTarget (cognitive 16) crates/openfang-api/static/js/pages/scheduler.js:332— scheduler.schedulerPage.sanitizeTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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.
usage.analyticsPage._extractProvider (cognitive 16) crates/openfang-api/static/js/pages/usage.js:149— usage.analyticsPage._extractProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 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.
app.init (cognitive 16) crates/openfang-api/static/js/app.js:305— app.init has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 1 (2 pts) (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function items inside it that branch (a function literal at line 343, a function literal at line 309, handleHash, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cognitive 16) crates/openfang-api/static/js/pages/runtime.js:2— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 4, error handling 1, ternaries 1. None of this is in the body itself: all 16 points belong to 3 function items inside it that branch ((anonymous)::loadData, a function literal at line 49, a function literal at line 3). 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.
schedulerPage.sanitizeTarget (cognitive 16) crates/openfang-api/static/js/pages/scheduler.js:332— schedulerPage.sanitizeTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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.
analyticsPage._extractProvider (cognitive 16) crates/openfang-api/static/js/pages/usage.js:149— analyticsPage._extractProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 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.
wizardPage.suggestedMessages (cognitive 16) crates/openfang-api/static/js/pages/wizard.js:179— wizardPage.suggestedMessages has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 15, 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.
D4 · Code Duplication· Near-duplicate member family (3 members, 53 shared lines) · ×1
Near-duplicate member family (3 members, 53 shared lines) crates/openfang-skills/src/loader.rs:59— crates/openfang-skills/src/loader.rs:59-157 | crates/openfang-skills/src/loader.rs:165-256 | crates/openfang-skills/src/loader.rs:311-403 — These 3 members are variants of one another: a block of 53 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
Near-duplicate member pair (732 shared lines) crates/openfang-runtime/src/agent_loop.rs:315— crates/openfang-runtime/src/agent_loop.rs:315-1146 | crates/openfang-runtime/src/agent_loop.rs:1543-2365 — These two members are variants of one another: 732 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.
Near-duplicate member pair (160 shared lines) crates/openfang-kernel/src/kernel.rs:1995— crates/openfang-kernel/src/kernel.rs:1995-2480 | crates/openfang-kernel/src/kernel.rs:2640-3031 — These two members are variants of one another: 160 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.
Near-duplicate member pair (154 shared lines) crates/openfang-channels/src/bridge.rs:761— crates/openfang-channels/src/bridge.rs:761-1455 | crates/openfang-channels/src/bridge.rs:1711-1925 — These two members are variants of one another: 154 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.
Near-duplicate member pair (146 shared lines) crates/openfang-runtime/src/drivers/openai.rs:452— crates/openfang-runtime/src/drivers/openai.rs:452-901 | crates/openfang-runtime/src/drivers/openai.rs:907-1517 — These two members are variants of one another: 146 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.
Near-duplicate member pair (130 shared lines) crates/openfang-runtime/src/agent_loop.rs:1161— crates/openfang-runtime/src/agent_loop.rs:1161-1331 | crates/openfang-runtime/src/agent_loop.rs:1346-1512 — These two members are variants of one another: 130 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.
Near-duplicate member pair (66 shared lines) crates/openfang-cli/src/launcher.rs:304— crates/openfang-cli/src/launcher.rs:304-533 | crates/openfang-cli/src/tui/screens/welcome.rs:217-433 — These two members are variants of one another: 66 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.
Near-duplicate member pair (61 shared lines) crates/openfang-api/src/routes.rs:911— crates/openfang-api/src/routes.rs:911-1007 | crates/openfang-api/src/routes.rs:1124-1222 — These two members are variants of one another: 61 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.
Near-duplicate member pair (50 shared lines) crates/openfang-cli/src/tui/screens/init_wizard.rs:1609— crates/openfang-cli/src/tui/screens/init_wizard.rs:1609-1777 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2253-2347 — These two members are variants of one another: 50 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.
Near-duplicate member pair (42 shared lines) crates/openfang-wire/src/peer.rs:235— crates/openfang-wire/src/peer.rs:235-352 | crates/openfang-wire/src/peer.rs:365-458 — These two members are variants of one another: 42 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.
Near-duplicate member pair (39 shared lines) crates/openfang-cli/src/tui/screens/comms.rs:544— crates/openfang-cli/src/tui/screens/comms.rs:544-617 | crates/openfang-cli/src/tui/screens/comms.rs:619-695 — These two members are variants of one another: 39 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.
Near-duplicate member pair (36 shared lines) crates/openfang-cli/src/tui/chat_runner.rs:379— crates/openfang-cli/src/tui/chat_runner.rs:379-435 | crates/openfang-cli/src/tui/mod.rs:1870-1924 — These two members are variants of one another: 36 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· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) crates/openfang-channels/src/router.rs:163— crates/openfang-channels/src/router.rs:163-205 | crates/openfang-channels/src/router.rs:214-239 — 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· Members sharing a duplicated core (26 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (26 members, 50+ identical tokens) crates/openfang-cli/src/tui/screens/audit.rs:191— crates/openfang-cli/src/tui/screens/audit.rs:191-334 | crates/openfang-cli/src/tui/screens/channels.rs:649-744 | crates/openfang-cli/src/tui/screens/channels.rs:869-944 | crates/openfang-cli/src/tui/screens/comms.rs:422-494 | crates/openfang-cli/src/tui/screens/dashboard.rs:200-258 | crates/openfang-cli/src/tui/screens/extensions.rs:346-420 | crates/openfang-cli/src/tui/screens/hands.rs:243-332 | crates/openfang-cli/src/tui/screens/hands.rs:334-429 | crates/openfang-cli/src/tui/screens/logs.rs:250-394 | crates/openfang-cli/src/tui/screens/memory.rs:272-337 | crates/openfang-cli/src/tui/screens/memory.rs:339-435 | crates/openfang-cli/src/tui/screens/peers.rs:84-201 | crates/openfang-cli/src/tui/screens/security.rs:198-326 | crates/openfang-cli/src/tui/screens/sessions.rs:170-299 | crates/openfang-cli/src/tui/screens/settings.rs:332-467 | crates/openfang-cli/src/tui/screens/settings.rs:469-544 | crates/openfang-cli/src/tui/screens/skills.rs:362-500 | crates/openfang-cli/src/tui/screens/skills.rs:571-666 | crates/openfang-cli/src/tui/screens/skills.rs:668-735 | crates/openfang-cli/src/tui/screens/templates.rs:235-392 | crates/openfang-cli/src/tui/screens/triggers.rs:268-357 | crates/openfang-cli/src/tui/screens/usage.rs:216-265 | crates/openfang-cli/src/tui/screens/usage.rs:292-356 | crates/openfang-cli/src/tui/screens/usage.rs:358-418 | crates/openfang-cli/src/tui/screens/workflows.rs:303-369 | crates/openfang-cli/src/tui/screens/workflows.rs:638-694 — These 26 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 26 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 26 times.
D4 · Code Duplication· Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (16 members, 50+ identical tokens) crates/openfang-cli/src/tui/event.rs:533— crates/openfang-cli/src/tui/event.rs:533-586 | crates/openfang-cli/src/tui/event.rs:589-639 | crates/openfang-cli/src/tui/event.rs:642-687 | crates/openfang-cli/src/tui/event.rs:690-722 | crates/openfang-cli/src/tui/event.rs:729-763 | crates/openfang-cli/src/tui/event.rs:771-803 | crates/openfang-cli/src/tui/event.rs:812-845 | crates/openfang-cli/src/tui/event.rs:848-880 | crates/openfang-cli/src/tui/event.rs:891-926 | crates/openfang-cli/src/tui/event.rs:929-957 | crates/openfang-cli/src/tui/event.rs:960-1001 | crates/openfang-cli/src/tui/event.rs:1004-1061 | crates/openfang-cli/src/tui/event.rs:1068-1134 | crates/openfang-cli/src/tui/event.rs:1142-1176 | crates/openfang-cli/src/tui/event.rs:1184-1220 | crates/openfang-cli/src/tui/event.rs:2085-2135 — These 16 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 16 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 16 times.
D4 · Code Duplication· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (12 members, 50+ identical tokens) crates/openfang-channels/src/bluesky.rs:259— crates/openfang-channels/src/bluesky.rs:259-336 | crates/openfang-channels/src/dingtalk_stream.rs:470-557 | crates/openfang-channels/src/feishu.rs:1235-1351 | crates/openfang-channels/src/flock.rs:158-231 | crates/openfang-channels/src/line.rs:261-350 | crates/openfang-channels/src/mastodon.rs:175-262 | crates/openfang-channels/src/messenger.rs:161-255 | crates/openfang-channels/src/pumble.rs:122-207 | crates/openfang-channels/src/reddit.rs:228-307 | crates/openfang-channels/src/revolt.rs:209-297 | crates/openfang-channels/src/threema.rs:120-175 | crates/openfang-channels/src/viber.rs:221-298 — These 12 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 12 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 12 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/openfang-cli/src/tui/screens/audit.rs:160— crates/openfang-cli/src/tui/screens/audit.rs:160-186 | crates/openfang-cli/src/tui/screens/channels.rs:465-565 | crates/openfang-cli/src/tui/screens/logs.rs:183-245 | crates/openfang-cli/src/tui/screens/peers.rs:59-79 | crates/openfang-cli/src/tui/screens/sessions.rs:85-165 | crates/openfang-cli/src/tui/screens/templates.rs:190-230 | crates/openfang-cli/src/tui/screens/triggers.rs:102-142 | crates/openfang-cli/src/tui/screens/workflows.rs:114-159 — These 8 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 8 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 8 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/openfang-runtime/src/drivers/anthropic.rs:199— crates/openfang-runtime/src/drivers/anthropic.rs:199-302 | crates/openfang-runtime/src/drivers/anthropic.rs:308-656 | crates/openfang-runtime/src/drivers/bedrock.rs:693-775 | crates/openfang-runtime/src/drivers/gemini.rs:667-747 | crates/openfang-runtime/src/drivers/gemini.rs:753-1184 | crates/openfang-runtime/src/drivers/vertex.rs:497-570 | crates/openfang-runtime/src/drivers/vertex.rs:576-730 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (116–125 lines × 2) crates/openfang-runtime/src/agent_loop.rs:345— crates/openfang-runtime/src/agent_loop.rs:345-469 | crates/openfang-runtime/src/agent_loop.rs:1573-1688 — both copies are in the same file, so extract the 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 (85–88 lines × 2) crates/openfang-runtime/src/agent_loop.rs:998— crates/openfang-runtime/src/agent_loop.rs:998-1085 | crates/openfang-runtime/src/agent_loop.rs:2222-2306 — both copies are in the same file, so extract the 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 (78 lines × 2) crates/openfang-channels/src/bridge.rs:1378— crates/openfang-channels/src/bridge.rs:1378-1455 | crates/openfang-channels/src/bridge.rs:1848-1925 — both copies are in the same file, so extract the 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 (72 lines × 2) crates/openfang-runtime/src/agent_loop.rs:886— crates/openfang-runtime/src/agent_loop.rs:886-957 | crates/openfang-runtime/src/agent_loop.rs:2095-2166 — both copies are in the same file, so extract the 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 (63–69 lines × 2) crates/openfang-runtime/src/agent_loop.rs:781— crates/openfang-runtime/src/agent_loop.rs:781-849 | crates/openfang-runtime/src/agent_loop.rs:1997-2059 — both copies are in the same file, so extract the 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 (62–64 lines × 2) crates/openfang-kernel/src/kernel.rs:2231— crates/openfang-kernel/src/kernel.rs:2231-2294 | crates/openfang-kernel/src/kernel.rs:2814-2875 — both copies are in the same file, so extract the 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 (45–50 lines × 2) crates/openfang-skills/src/openclaw_compat.rs:183— crates/openfang-skills/src/openclaw_compat.rs:183-232 | crates/openfang-skills/src/openclaw_compat.rs:291-335 — both copies are in the same file, so extract the 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 (40–45 lines × 2) crates/openfang-runtime/src/agent_loop.rs:702— crates/openfang-runtime/src/agent_loop.rs:702-746 | crates/openfang-runtime/src/agent_loop.rs:1923-1962 — both copies are in the same file, so extract the 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 (39 lines × 2) crates/openfang-cli/src/tui/chat_runner.rs:123— crates/openfang-cli/src/tui/chat_runner.rs:123-161 | crates/openfang-cli/src/tui/mod.rs:1158-1196 — before extracting anything, compare `crates/openfang-cli/src/tui/chat_runner.rs` and `crates/openfang-cli/src/tui/mod.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (36 lines × 2) crates/openfang-runtime/src/agent_loop.rs:471— crates/openfang-runtime/src/agent_loop.rs:471-506 | crates/openfang-runtime/src/agent_loop.rs:1690-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 (35 lines × 2) crates/openfang-cli/src/main.rs:5040— crates/openfang-cli/src/main.rs:5040-5074 | crates/openfang-cli/src/main.rs:5163-5197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34–35 lines × 2) crates/openfang-runtime/src/drivers/claude_code.rs:462— crates/openfang-runtime/src/drivers/claude_code.rs:462-496 | crates/openfang-runtime/src/drivers/qwen_code.rs:257-290 — before extracting anything, compare `crates/openfang-runtime/src/drivers/claude_code.rs` and `crates/openfang-runtime/src/drivers/qwen_code.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (34 lines × 2) crates/openfang-channels/src/bridge.rs:1222— crates/openfang-channels/src/bridge.rs:1222-1255 | crates/openfang-channels/src/bridge.rs:1721-1754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33–34 lines × 2) crates/openfang-runtime/src/agent_loop.rs:1087— crates/openfang-runtime/src/agent_loop.rs:1087-1120 | crates/openfang-runtime/src/agent_loop.rs:2308-2340 — both copies are in the same file, so extract the 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 (32 lines × 2) crates/openfang-runtime/src/agent_loop.rs:748— crates/openfang-runtime/src/agent_loop.rs:748-779 | crates/openfang-runtime/src/agent_loop.rs:1964-1995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28–30 lines × 2) crates/openfang-runtime/src/agent_loop.rs:577— crates/openfang-runtime/src/agent_loop.rs:577-606 | crates/openfang-runtime/src/agent_loop.rs:1820-1847 — both copies are in the same file, so extract the 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) crates/openfang-runtime/src/drivers/gemini.rs:846— crates/openfang-runtime/src/drivers/gemini.rs:846-873 | crates/openfang-runtime/src/drivers/openai.rs:1186-1210 — 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 (26–27 lines × 3) crates/openfang-api/src/routes.rs:10235— crates/openfang-api/src/routes.rs:10235-10261 | crates/openfang-api/src/routes.rs:10305-10330 | crates/openfang-api/src/routes.rs:10419-10444 — 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 (26–27 lines × 2) crates/openfang-channels/src/bridge.rs:961— crates/openfang-channels/src/bridge.rs:961-986 | crates/openfang-channels/src/bridge.rs:995-1021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crates/openfang-runtime/src/agent_loop.rs:970— crates/openfang-runtime/src/agent_loop.rs:970-996 | crates/openfang-runtime/src/agent_loop.rs:2179-2205 — both copies are in the same file, so extract the 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 (19–26 lines × 2) crates/openfang-channels/src/router.rs:180— crates/openfang-channels/src/router.rs:180-205 | crates/openfang-channels/src/router.rs:221-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–25 lines × 3) crates/openfang-skills/src/loader.rs:88— crates/openfang-skills/src/loader.rs:88-112 | crates/openfang-skills/src/loader.rs:193-214 | crates/openfang-skills/src/loader.rs:337-360 — 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 (22–25 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:913— crates/openfang-runtime/src/drivers/gemini.rs:913-934 | crates/openfang-runtime/src/drivers/gemini.rs:1009-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–24 lines × 2) crates/openfang-wire/src/peer.rs:268— crates/openfang-wire/src/peer.rs:268-291 | crates/openfang-wire/src/peer.rs:401-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–23 lines × 4) crates/openfang-cli/src/tui/screens/hands.rs:198— crates/openfang-cli/src/tui/screens/hands.rs:198-219 | crates/openfang-cli/src/tui/screens/settings.rs:268-289 | crates/openfang-cli/src/tui/screens/skills.rs:315-336 | crates/openfang-cli/src/tui/screens/usage.rs:160-182 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/settings.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22–23 lines × 2) crates/openfang-api/src/routes.rs:3152— crates/openfang-api/src/routes.rs:3152-3174 | crates/openfang-api/src/routes.rs:3200-3221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/openfang-cli/src/tui/screens/sessions.rs:183— crates/openfang-cli/src/tui/screens/sessions.rs:183-204 | crates/openfang-cli/src/tui/screens/skills.rs:572-592 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/sessions.rs` and `crates/openfang-cli/src/tui/screens/skills.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–22 lines × 2) crates/openfang-skills/src/registry.rs:190— crates/openfang-skills/src/registry.rs:190-211 | crates/openfang-skills/src/registry.rs:394-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 3) crates/openfang-kernel/src/kernel.rs:7661— crates/openfang-kernel/src/kernel.rs:7661-7681 | crates/openfang-kernel/src/kernel.rs:7723-7743 | crates/openfang-kernel/src/kernel.rs:7790-7810 — 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 (11–21 lines × 2) crates/openfang-runtime/src/loop_guard.rs:386— crates/openfang-runtime/src/loop_guard.rs:386-396 | crates/openfang-runtime/src/loop_guard.rs:415-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) crates/openfang-channels/src/bridge.rs:1287— crates/openfang-channels/src/bridge.rs:1287-1306 | crates/openfang-channels/src/bridge.rs:1768-1785 — both copies are in the same file, so extract the 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–20 lines × 2) crates/openfang-channels/src/bridge.rs:1344— crates/openfang-channels/src/bridge.rs:1344-1358 | crates/openfang-channels/src/bridge.rs:1372-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–20 lines × 2) crates/openfang-runtime/src/subprocess_sandbox.rs:266— crates/openfang-runtime/src/subprocess_sandbox.rs:266-282 | crates/openfang-runtime/src/subprocess_sandbox.rs:296-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 4) crates/openfang-api/src/routes.rs:5677— crates/openfang-api/src/routes.rs:5677-5695 | crates/openfang-api/src/routes.rs:7412-7429 | crates/openfang-api/src/routes.rs:7497-7514 | crates/openfang-api/src/routes.rs:7576-7593 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–19 lines × 3) crates/openfang-cli/src/tui/screens/audit.rs:199— crates/openfang-cli/src/tui/screens/audit.rs:199-214 | crates/openfang-cli/src/tui/screens/comms.rs:329-347 | crates/openfang-cli/src/tui/screens/peers.rs:92-107 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/comms.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 3) crates/openfang-skills/src/loader.rs:139— crates/openfang-skills/src/loader.rs:139-157 | crates/openfang-skills/src/loader.rs:239-256 | crates/openfang-skills/src/loader.rs:385-403 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–18 lines × 3) crates/openfang-api/src/routes.rs:797— crates/openfang-api/src/routes.rs:797-814 | crates/openfang-api/src/routes.rs:1475-1491 | crates/openfang-api/src/routes.rs:10227-10243 — 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–18 lines × 2) crates/openfang-cli/src/tui/screens/workflows.rs:372— crates/openfang-cli/src/tui/screens/workflows.rs:372-387 | crates/openfang-cli/src/tui/screens/workflows.rs:568-585 — both copies are in the same file, so extract the 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 (16–17 lines × 4) crates/openfang-cli/src/tui/screens/hands.rs:226— crates/openfang-cli/src/tui/screens/hands.rs:226-241 | crates/openfang-cli/src/tui/screens/settings.rs:314-330 | crates/openfang-cli/src/tui/screens/skills.rs:344-360 | crates/openfang-cli/src/tui/screens/usage.rs:198-214 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/settings.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–17 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1720— crates/openfang-cli/src/tui/screens/init_wizard.rs:1720-1736 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1925-1938 — both copies are in the same file, so extract the 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 (16–17 lines × 2) crates/openfang-runtime/src/drivers/gemini.rs:236— crates/openfang-runtime/src/drivers/gemini.rs:236-252 | crates/openfang-runtime/src/drivers/vertex.rs:327-342 — before extracting anything, compare `crates/openfang-runtime/src/drivers/gemini.rs` and `crates/openfang-runtime/src/drivers/vertex.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–16 lines × 14) crates/openfang-cli/src/tui/screens/agents.rs:1100— crates/openfang-cli/src/tui/screens/agents.rs:1100-1111 | crates/openfang-cli/src/tui/screens/audit.rs:197-209 | crates/openfang-cli/src/tui/screens/comms.rs:327-342 | crates/openfang-cli/src/tui/screens/dashboard.rs:96-109 | crates/openfang-cli/src/tui/screens/extensions.rs:272-284 | crates/openfang-cli/src/tui/screens/hands.rs:196-208 | crates/openfang-cli/src/tui/screens/logs.rs:256-268 | crates/openfang-cli/src/tui/screens/peers.rs:90-102 | crates/openfang-cli/src/tui/screens/security.rs:204-216 | crates/openfang-cli/src/tui/screens/sessions.rs:176-188 | crates/openfang-cli/src/tui/screens/settings.rs:266-279 | crates/openfang-cli/src/tui/screens/skills.rs:313-325 | crates/openfang-cli/src/tui/screens/templates.rs:241-254 | crates/openfang-cli/src/tui/screens/usage.rs:158-171 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/agents.rs` and `crates/openfang-cli/src/tui/screens/audit.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 6) crates/openfang-runtime/src/drivers/anthropic.rs:266— crates/openfang-runtime/src/drivers/anthropic.rs:266-280 | crates/openfang-runtime/src/drivers/anthropic.rs:373-387 | crates/openfang-runtime/src/drivers/gemini.rs:707-721 | crates/openfang-runtime/src/drivers/gemini.rs:795-810 | crates/openfang-runtime/src/drivers/vertex.rs:534-548 | crates/openfang-runtime/src/drivers/vertex.rs:615-630 — before extracting anything, compare `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–15 lines × 3) crates/openfang-channels/src/bridge.rs:1279— crates/openfang-channels/src/bridge.rs:1279-1290 | crates/openfang-channels/src/bridge.rs:1344-1356 | crates/openfang-channels/src/bridge.rs:1375-1389 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–15 lines × 3) crates/openfang-kernel/src/workflow.rs:502— crates/openfang-kernel/src/workflow.rs:502-516 | crates/openfang-kernel/src/workflow.rs:584-596 | crates/openfang-kernel/src/workflow.rs:678-690 — 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 (12–14 lines × 2) crates/openfang-channels/src/dingtalk_stream.rs:74— crates/openfang-channels/src/dingtalk_stream.rs:74-87 | crates/openfang-channels/src/dingtalk_stream.rs:312-323 — both copies are in the same file, so extract the 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–14 lines × 2) crates/openfang-runtime/src/drivers/openai.rs:1245— crates/openfang-runtime/src/drivers/openai.rs:1245-1258 | crates/openfang-runtime/src/drivers/openai.rs:1333-1341 — both copies are in the same file, so extract the 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 × 7) crates/openfang-channels/src/bluesky.rs:292— crates/openfang-channels/src/bluesky.rs:292-303 | crates/openfang-channels/src/line.rs:304-316 | crates/openfang-channels/src/messenger.rs:195-207 | crates/openfang-channels/src/pumble.rs:172-184 | crates/openfang-channels/src/reddit.rs:263-274 | crates/openfang-channels/src/revolt.rs:244-256 | crates/openfang-channels/src/viber.rs:254-266 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/line.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 5) crates/openfang-channels/src/bluesky.rs:234— crates/openfang-channels/src/bluesky.rs:234-246 | crates/openfang-channels/src/feishu.rs:410-422 | crates/openfang-channels/src/feishu.rs:455-467 | crates/openfang-channels/src/google_chat.rs:114-126 | crates/openfang-channels/src/teams.rs:151-163 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/google_chat.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 4) crates/openfang-api/src/routes.rs:704— crates/openfang-api/src/routes.rs:704-715 | crates/openfang-api/src/routes.rs:795-806 | crates/openfang-api/src/routes.rs:1473-1483 | crates/openfang-api/src/routes.rs:10225-10235 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 3) crates/openfang-channels/src/nextcloud.rs:180— crates/openfang-channels/src/nextcloud.rs:180-191 | crates/openfang-channels/src/rocketchat.rs:152-162 | crates/openfang-channels/src/twist.rs:276-287 — before extracting anything, compare `crates/openfang-channels/src/nextcloud.rs` and `crates/openfang-channels/src/rocketchat.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–11 lines × 6) crates/openfang-runtime/src/drivers/anthropic.rs:256— crates/openfang-runtime/src/drivers/anthropic.rs:256-264 | crates/openfang-runtime/src/drivers/anthropic.rs:363-371 | crates/openfang-runtime/src/drivers/gemini.rs:697-705 | crates/openfang-runtime/src/drivers/gemini.rs:783-793 | crates/openfang-runtime/src/drivers/vertex.rs:524-532 | crates/openfang-runtime/src/drivers/vertex.rs:603-613 — before extracting anything, compare `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 3) crates/openfang-cli/src/tui/screens/init_wizard.rs:1748— crates/openfang-cli/src/tui/screens/init_wizard.rs:1748-1757 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2318-2327 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2637-2647 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 10) crates/openfang-channels/src/bluesky.rs:290— crates/openfang-channels/src/bluesky.rs:290-299 | crates/openfang-channels/src/dingtalk_stream.rs:502-511 | crates/openfang-channels/src/feishu.rs:1302-1311 | crates/openfang-channels/src/line.rs:302-311 | crates/openfang-channels/src/mastodon.rs:213-222 | crates/openfang-channels/src/messenger.rs:193-202 | crates/openfang-channels/src/pumble.rs:170-179 | crates/openfang-channels/src/reddit.rs:261-270 | crates/openfang-channels/src/revolt.rs:242-251 | crates/openfang-channels/src/viber.rs:252-261 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/line.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 3) crates/openfang-cli/src/tui/screens/init_wizard.rs:2144— crates/openfang-cli/src/tui/screens/init_wizard.rs:2144-2152 | crates/openfang-cli/src/tui/screens/wizard.rs:601-610 | crates/openfang-cli/src/tui/screens/wizard.rs:649-658 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/init_wizard.rs` and `crates/openfang-cli/src/tui/screens/wizard.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 3) crates/openfang-migrate/src/openclaw.rs:1131— crates/openfang-migrate/src/openclaw.rs:1131-1138 | crates/openfang-migrate/src/openclaw.rs:2236-2245 | crates/openfang-migrate/src/openclaw.rs:2347-2354 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 7) crates/openfang-runtime/src/drivers/anthropic.rs:256— crates/openfang-runtime/src/drivers/anthropic.rs:256-264 | crates/openfang-runtime/src/drivers/anthropic.rs:363-371 | crates/openfang-runtime/src/drivers/bedrock.rs:722-730 | crates/openfang-runtime/src/drivers/gemini.rs:697-705 | crates/openfang-runtime/src/drivers/gemini.rs:783-791 | crates/openfang-runtime/src/drivers/vertex.rs:524-532 | crates/openfang-runtime/src/drivers/vertex.rs:603-611 — before extracting anything, compare `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 4) crates/openfang-cli/src/tui/screens/channels.rs:635— crates/openfang-cli/src/tui/screens/channels.rs:635-642 | crates/openfang-cli/src/tui/screens/memory.rs:257-265 | crates/openfang-cli/src/tui/screens/triggers.rs:254-262 | crates/openfang-cli/src/tui/screens/workflows.rs:286-294 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/channels.rs` and `crates/openfang-cli/src/tui/screens/triggers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 6) crates/openfang-memory/src/session.rs:176— crates/openfang-memory/src/session.rs:176-183 | crates/openfang-memory/src/session.rs:291-298 | crates/openfang-memory/src/structured.rs:433-439 | crates/openfang-memory/src/substrate.rs:341-347 | crates/openfang-memory/src/usage.rs:258-265 | crates/openfang-memory/src/usage.rs:296-303 — there are 6 copies across 4 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7–8 lines × 5) crates/openfang-cli/src/tui/screens/hands.rs:315— crates/openfang-cli/src/tui/screens/hands.rs:315-322 | crates/openfang-cli/src/tui/screens/hands.rs:413-419 | crates/openfang-cli/src/tui/screens/sessions.rs:283-289 | crates/openfang-cli/src/tui/screens/settings.rs:459-466 | crates/openfang-cli/src/tui/screens/skills.rs:484-490 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/hands.rs` and `crates/openfang-cli/src/tui/screens/sessions.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 4) crates/openfang-cli/src/launcher.rs:295— crates/openfang-cli/src/launcher.rs:295-302 | crates/openfang-cli/src/tui/screens/init_wizard.rs:1432-1438 | crates/openfang-cli/src/tui/screens/welcome.rs:246-252 | crates/openfang-cli/src/tui/screens/wizard.rs:476-482 — before extracting anything, compare `crates/openfang-cli/src/launcher.rs` and `crates/openfang-cli/src/tui/screens/welcome.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) crates/openfang-kernel/src/workflow.rs:525— crates/openfang-kernel/src/workflow.rs:525-532 | crates/openfang-kernel/src/workflow.rs:616-623 | crates/openfang-kernel/src/workflow.rs:695-702 | crates/openfang-kernel/src/workflow.rs:768-775 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 2) crates/openfang-cli/src/tui/screens/init_wizard.rs:1711— crates/openfang-cli/src/tui/screens/init_wizard.rs:1711-1717 | crates/openfang-cli/src/tui/screens/init_wizard.rs:2597-2604 — both copies are in the same file, so extract the 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 × 19) crates/openfang-cli/src/tui/screens/agents.rs:948— crates/openfang-cli/src/tui/screens/agents.rs:948-954 | crates/openfang-cli/src/tui/screens/agents.rs:1099-1105 | crates/openfang-cli/src/tui/screens/audit.rs:196-202 | crates/openfang-cli/src/tui/screens/chat.rs:498-504 | crates/openfang-cli/src/tui/screens/comms.rs:326-332 | crates/openfang-cli/src/tui/screens/dashboard.rs:95-101 | crates/openfang-cli/src/tui/screens/extensions.rs:271-277 | crates/openfang-cli/src/tui/screens/hands.rs:195-201 | crates/openfang-cli/src/tui/screens/logs.rs:255-261 | crates/openfang-cli/src/tui/screens/memory.rs:257-263 | crates/openfang-cli/src/tui/screens/peers.rs:89-95 | crates/openfang-cli/src/tui/screens/security.rs:203-209 | crates/openfang-cli/src/tui/screens/sessions.rs:175-181 | crates/openfang-cli/src/tui/screens/settings.rs:265-271 | crates/openfang-cli/src/tui/screens/skills.rs:312-318 | crates/openfang-cli/src/tui/screens/templates.rs:240-246 | crates/openfang-cli/src/tui/screens/triggers.rs:254-260 | crates/openfang-cli/src/tui/screens/usage.rs:157-163 | crates/openfang-cli/src/tui/screens/workflows.rs:286-292 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/agents.rs` and `crates/openfang-cli/src/tui/screens/audit.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 14) crates/openfang-cli/src/tui/screens/audit.rs:235— crates/openfang-cli/src/tui/screens/audit.rs:235-242 | crates/openfang-cli/src/tui/screens/channels.rs:686-692 | crates/openfang-cli/src/tui/screens/extensions.rs:362-368 | crates/openfang-cli/src/tui/screens/hands.rs:259-265 | crates/openfang-cli/src/tui/screens/hands.rs:350-356 | crates/openfang-cli/src/tui/screens/memory.rs:287-293 | crates/openfang-cli/src/tui/screens/memory.rs:372-378 | crates/openfang-cli/src/tui/screens/skills.rs:681-687 | crates/openfang-cli/src/tui/screens/templates.rs:284-291 | crates/openfang-cli/src/tui/screens/triggers.rs:284-290 | crates/openfang-cli/src/tui/screens/usage.rs:307-313 | crates/openfang-cli/src/tui/screens/usage.rs:373-379 | crates/openfang-cli/src/tui/screens/workflows.rs:316-322 | crates/openfang-cli/src/tui/screens/workflows.rs:653-659 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/extensions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 9) crates/openfang-channels/src/gitter.rs:116— crates/openfang-channels/src/gitter.rs:116-122 | crates/openfang-channels/src/guilded.rs:101-107 | crates/openfang-channels/src/line.rs:200-206 | crates/openfang-channels/src/line.rs:243-249 | crates/openfang-channels/src/pumble.rs:103-109 | crates/openfang-channels/src/pumble.rs:339-345 | crates/openfang-channels/src/twist.rs:198-204 | crates/openfang-channels/src/webex.rs:169-175 | crates/openfang-channels/src/webex.rs:210-216 — before extracting anything, compare `crates/openfang-channels/src/gitter.rs` and `crates/openfang-channels/src/guilded.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 5) crates/openfang-channels/src/telegram.rs:216— crates/openfang-channels/src/telegram.rs:216-222 | crates/openfang-channels/src/telegram.rs:255-260 | crates/openfang-channels/src/telegram.rs:286-291 | crates/openfang-channels/src/telegram.rs:353-358 | crates/openfang-channels/src/telegram.rs:384-389 — 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 (5–6 lines × 2) crates/openfang-kernel/src/kernel.rs:5953— crates/openfang-kernel/src/kernel.rs:5953-5958 | crates/openfang-kernel/src/kernel.rs:6071-6075 — both copies are in the same file, so extract the 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 × 16) crates/openfang-cli/src/tui/event.rs:534— crates/openfang-cli/src/tui/event.rs:534-538 | crates/openfang-cli/src/tui/event.rs:590-594 | crates/openfang-cli/src/tui/event.rs:643-647 | crates/openfang-cli/src/tui/event.rs:691-695 | crates/openfang-cli/src/tui/event.rs:730-734 | crates/openfang-cli/src/tui/event.rs:772-776 | crates/openfang-cli/src/tui/event.rs:813-817 | crates/openfang-cli/src/tui/event.rs:849-853 | crates/openfang-cli/src/tui/event.rs:892-896 | crates/openfang-cli/src/tui/event.rs:930-934 | crates/openfang-cli/src/tui/event.rs:961-965 | crates/openfang-cli/src/tui/event.rs:1005-1009 | crates/openfang-cli/src/tui/event.rs:1069-1073 | crates/openfang-cli/src/tui/event.rs:1143-1147 | crates/openfang-cli/src/tui/event.rs:1185-1189 | crates/openfang-cli/src/tui/event.rs:2086-2090 — all 16 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 × 12) crates/openfang-channels/src/bluesky.rs:288— crates/openfang-channels/src/bluesky.rs:288-292 | crates/openfang-channels/src/dingtalk_stream.rs:500-504 | crates/openfang-channels/src/feishu.rs:1300-1304 | crates/openfang-channels/src/flock.rs:194-198 | crates/openfang-channels/src/line.rs:300-304 | crates/openfang-channels/src/mastodon.rs:211-215 | crates/openfang-channels/src/messenger.rs:191-195 | crates/openfang-channels/src/pumble.rs:168-172 | crates/openfang-channels/src/reddit.rs:259-263 | crates/openfang-channels/src/revolt.rs:240-244 | crates/openfang-channels/src/threema.rs:134-138 | crates/openfang-channels/src/viber.rs:250-254 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/line.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 11) crates/openfang-channels/src/flock.rs:316— crates/openfang-channels/src/flock.rs:316-327 | crates/openfang-channels/src/google_chat.rs:338-349 | crates/openfang-channels/src/guilded.rs:326-337 | crates/openfang-channels/src/matrix.rs:658-669 | crates/openfang-channels/src/nextcloud.rs:412-423 | crates/openfang-channels/src/nostr.rs:402-413 | crates/openfang-channels/src/pumble.rs:301-312 | crates/openfang-channels/src/rocketchat.rs:356-367 | crates/openfang-channels/src/signal.rs:222-233 | crates/openfang-channels/src/threema.rs:317-328 | crates/openfang-channels/src/webex.rs:454-465 — before extracting anything, compare `crates/openfang-channels/src/flock.rs` and `crates/openfang-channels/src/guilded.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 15) crates/openfang-cli/src/tui/screens/agents.rs:1493— crates/openfang-cli/src/tui/screens/agents.rs:1493-1502 | crates/openfang-cli/src/tui/screens/audit.rs:336-345 | crates/openfang-cli/src/tui/screens/chat.rs:885-894 | crates/openfang-cli/src/tui/screens/comms.rs:743-752 | crates/openfang-cli/src/tui/screens/dashboard.rs:272-281 | crates/openfang-cli/src/tui/screens/logs.rs:396-405 | crates/openfang-cli/src/tui/screens/memory.rs:538-547 | crates/openfang-cli/src/tui/screens/peers.rs:203-212 | crates/openfang-cli/src/tui/screens/sessions.rs:301-310 | crates/openfang-cli/src/tui/screens/settings.rs:591-600 | crates/openfang-cli/src/tui/screens/skills.rs:737-746 | crates/openfang-cli/src/tui/screens/templates.rs:394-403 | crates/openfang-cli/src/tui/screens/triggers.rs:544-553 | crates/openfang-cli/src/tui/screens/usage.rs:430-439 | crates/openfang-cli/src/tui/screens/workflows.rs:696-705 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/agents.rs` and `crates/openfang-cli/src/tui/screens/audit.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–18 lines × 4) crates/openfang-channels/src/formatter.rs:310— crates/openfang-channels/src/formatter.rs:310-327 | crates/openfang-channels/src/formatter.rs:396-399 | crates/openfang-channels/src/formatter.rs:415-418 | crates/openfang-channels/src/formatter.rs:547-564 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 4) crates/openfang-cli/src/tui/screens/memory.rs:273— crates/openfang-cli/src/tui/screens/memory.rs:273-285 | crates/openfang-cli/src/tui/screens/triggers.rs:360-374 | crates/openfang-cli/src/tui/screens/workflows.rs:453-469 | crates/openfang-cli/src/tui/screens/workflows.rs:639-651 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/memory.rs` and `crates/openfang-cli/src/tui/screens/triggers.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) crates/openfang-runtime/src/agent_loop.rs:2487— crates/openfang-runtime/src/agent_loop.rs:2487-2501 | crates/openfang-runtime/src/agent_loop.rs:2534-2547 | crates/openfang-runtime/src/agent_loop.rs:2755-2768 — 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 (12 lines × 7) crates/openfang-runtime/src/drivers/anthropic.rs:266— crates/openfang-runtime/src/drivers/anthropic.rs:266-277 | crates/openfang-runtime/src/drivers/anthropic.rs:373-384 | crates/openfang-runtime/src/drivers/bedrock.rs:732-743 | crates/openfang-runtime/src/drivers/gemini.rs:707-718 | crates/openfang-runtime/src/drivers/gemini.rs:794-807 | crates/openfang-runtime/src/drivers/vertex.rs:534-545 | crates/openfang-runtime/src/drivers/vertex.rs:614-627 — before extracting anything, compare `crates/openfang-runtime/src/drivers/anthropic.rs` and `crates/openfang-runtime/src/drivers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 6) crates/openfang-cli/src/main.rs:5715— crates/openfang-cli/src/main.rs:5715-5726 | crates/openfang-cli/src/main.rs:5984-5995 | crates/openfang-cli/src/main.rs:6038-6050 | crates/openfang-cli/src/main.rs:6178-6189 | crates/openfang-cli/src/main.rs:6511-6522 | crates/openfang-cli/src/main.rs:6589-6600 — 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.
Duplicated block (11 lines × 5) crates/openfang-runtime/src/agent_loop.rs:2677— crates/openfang-runtime/src/agent_loop.rs:2677-2687 | crates/openfang-runtime/src/agent_loop.rs:2708-2718 | crates/openfang-runtime/src/agent_loop.rs:2795-2805 | crates/openfang-runtime/src/agent_loop.rs:2909-2919 | crates/openfang-runtime/src/agent_loop.rs:2938-2948 — 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 (10 lines × 5) crates/openfang-cli/src/main.rs:4561— crates/openfang-cli/src/main.rs:4561-4570 | crates/openfang-cli/src/main.rs:4585-4594 | crates/openfang-cli/src/main.rs:4603-4612 | crates/openfang-cli/src/main.rs:6020-6029 | crates/openfang-cli/src/main.rs:6156-6165 — 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 (5 lines × 7) crates/openfang-channels/src/discourse.rs:86— crates/openfang-channels/src/discourse.rs:86-90 | crates/openfang-channels/src/discourse.rs:117-123 | crates/openfang-channels/src/gitter.rs:66-74 | crates/openfang-channels/src/gitter.rs:91-97 | crates/openfang-channels/src/gotify.rs:71-75 | crates/openfang-channels/src/linkedin.rs:87-91 | crates/openfang-channels/src/linkedin.rs:123-129 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 18) crates/openfang-channels/src/bluesky.rs:244— crates/openfang-channels/src/bluesky.rs:244-252 | crates/openfang-channels/src/gitter.rs:120-128 | crates/openfang-channels/src/google_chat.rs:124-132 | crates/openfang-channels/src/guilded.rs:105-113 | crates/openfang-channels/src/keybase.rs:177-185 | crates/openfang-channels/src/line.rs:204-212 | crates/openfang-channels/src/messenger.rs:116-124 | crates/openfang-channels/src/nextcloud.rs:144-152 | crates/openfang-channels/src/ntfy.rs:129-137 | crates/openfang-channels/src/pumble.rs:107-115 | crates/openfang-channels/src/pumble.rs:343-351 | crates/openfang-channels/src/revolt.rs:147-155 | crates/openfang-channels/src/rocketchat.rs:115-123 | crates/openfang-channels/src/threema.rs:101-109 | crates/openfang-channels/src/twist.rs:202-210 | crates/openfang-channels/src/webex.rs:173-181 | crates/openfang-channels/src/webex.rs:214-222 | crates/openfang-channels/src/zulip.rs:163-171 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/google_chat.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–8 lines × 3) crates/openfang-cli/src/tui/screens/dashboard.rs:143— crates/openfang-cli/src/tui/screens/dashboard.rs:143-146 | crates/openfang-cli/src/tui/screens/dashboard.rs:158-165 | crates/openfang-cli/src/tui/screens/dashboard.rs:176-183 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 14) crates/openfang-channels/src/bluesky.rs:104— crates/openfang-channels/src/bluesky.rs:104-108 | crates/openfang-channels/src/line.rs:138-145 | crates/openfang-channels/src/mastodon.rs:77-84 | crates/openfang-channels/src/mattermost.rs:72-79 | crates/openfang-channels/src/messenger.rs:78-82 | crates/openfang-channels/src/reddit.rs:131-138 | crates/openfang-channels/src/reddit.rs:162-166 | crates/openfang-channels/src/revolt.rs:112-116 | crates/openfang-channels/src/teams.rs:104-111 | crates/openfang-channels/src/twist.rs:233-240 | crates/openfang-channels/src/viber.rs:104-111 | crates/openfang-channels/src/viber.rs:144-151 | crates/openfang-channels/src/webex.rs:136-143 | crates/openfang-channels/src/zulip.rs:92-99 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/line.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 32) crates/openfang-channels/src/bluesky.rs:241— crates/openfang-channels/src/bluesky.rs:241-248 | crates/openfang-channels/src/dingtalk.rs:294-298 | crates/openfang-channels/src/dingtalk_stream.rs:136-143 | crates/openfang-channels/src/flock.rs:101-105 | crates/openfang-channels/src/flock.rs:144-148 | crates/openfang-channels/src/gitter.rs:117-124 | crates/openfang-channels/src/google_chat.rs:121-128 | crates/openfang-channels/src/guilded.rs:102-109 | crates/openfang-channels/src/keybase.rs:174-181 | crates/openfang-channels/src/line.rs:201-208 | crates/openfang-channels/src/line.rs:244-251 | crates/openfang-channels/src/linkedin.rs:167-174 | crates/openfang-channels/src/mastodon.rs:123-130 | crates/openfang-channels/src/messenger.rs:116-120 | crates/openfang-channels/src/nextcloud.rs:141-148 | crates/openfang-channels/src/ntfy.rs:129-133 | crates/openfang-channels/src/pumble.rs:104-111 | crates/openfang-channels/src/pumble.rs:340-347 | crates/openfang-channels/src/reddit.rs:198-205 | crates/openfang-channels/src/revolt.rs:144-151 | crates/openfang-channels/src/rocketchat.rs:112-119 | crates/openfang-channels/src/signal.rs:64-68 | crates/openfang-channels/src/threema.rs:101-105 | crates/openfang-channels/src/twist.rs:199-206 | crates/openfang-channels/src/viber.rs:194-201 | crates/openfang-channels/src/webex.rs:170-177 | crates/openfang-channels/src/webex.rs:211-218 | crates/openfang-channels/src/webhook.rs:341-348 | crates/openfang-channels/src/whatsapp.rs:266-272 | crates/openfang-channels/src/whatsapp.rs:293-299 | crates/openfang-channels/src/whatsapp.rs:320-326 | crates/openfang-channels/src/zulip.rs:160-167 — before extracting anything, compare `crates/openfang-channels/src/bluesky.rs` and `crates/openfang-channels/src/google_chat.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–6 lines × 7) crates/openfang-channels/src/discourse.rs:181— crates/openfang-channels/src/discourse.rs:181-186 | crates/openfang-channels/src/linkedin.rs:230-235 | crates/openfang-channels/src/rocketchat.rs:148-153 | crates/openfang-channels/src/signal.rs:108-111 | crates/openfang-channels/src/slack.rs:189-195 | crates/openfang-channels/src/webex.rs:247-252 | crates/openfang-channels/src/zulip.rs:203-206 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 23) crates/openfang-cli/src/tui/screens/audit.rs:242— crates/openfang-cli/src/tui/screens/audit.rs:242-247 | crates/openfang-cli/src/tui/screens/channels.rs:692-697 | crates/openfang-cli/src/tui/screens/channels.rs:901-907 | crates/openfang-cli/src/tui/screens/extensions.rs:368-373 | crates/openfang-cli/src/tui/screens/hands.rs:265-270 | crates/openfang-cli/src/tui/screens/hands.rs:356-361 | crates/openfang-cli/src/tui/screens/logs.rs:341-346 | crates/openfang-cli/src/tui/screens/memory.rs:293-298 | crates/openfang-cli/src/tui/screens/memory.rs:378-383 | crates/openfang-cli/src/tui/screens/peers.rs:128-133 | crates/openfang-cli/src/tui/screens/security.rs:270-275 | crates/openfang-cli/src/tui/screens/sessions.rs:230-235 | crates/openfang-cli/src/tui/screens/settings.rs:351-356 | crates/openfang-cli/src/tui/screens/settings.rs:490-495 | crates/openfang-cli/src/tui/screens/skills.rs:398-403 | crates/openfang-cli/src/tui/screens/skills.rs:615-620 | crates/openfang-cli/src/tui/screens/skills.rs:687-692 | crates/openfang-cli/src/tui/screens/templates.rs:291-296 | crates/openfang-cli/src/tui/screens/triggers.rs:290-295 | crates/openfang-cli/src/tui/screens/usage.rs:313-318 | crates/openfang-cli/src/tui/screens/usage.rs:379-384 | crates/openfang-cli/src/tui/screens/workflows.rs:322-327 | crates/openfang-cli/src/tui/screens/workflows.rs:659-664 — before extracting anything, compare `crates/openfang-cli/src/tui/screens/audit.rs` and `crates/openfang-cli/src/tui/screens/extensions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) crates/openfang-channels/src/discourse.rs:180— crates/openfang-channels/src/discourse.rs:180-185 | crates/openfang-channels/src/guilded.rs:137-142 | crates/openfang-channels/src/linkedin.rs:229-234 | crates/openfang-channels/src/nextcloud.rs:176-181 | crates/openfang-channels/src/revolt.rs:314-319 | crates/openfang-channels/src/rocketchat.rs:147-152 — before extracting anything, compare `crates/openfang-channels/src/discourse.rs` and `crates/openfang-channels/src/linkedin.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplicated block (19 lines × 2 locations) crates/openfang-api/static/js/pages/usage.js:189— crates/openfang-api/static/js/pages/usage.js:189 · crates/openfang-api/static/js/pages/usage.js:243 — 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 (16 matched lines × 2 locations) · ×1
Duplicated block with local edits (16 matched lines × 2 locations) crates/openfang-api/static/js/pages/agents.js:376— crates/openfang-api/static/js/pages/agents.js:376 · crates/openfang-api/static/js/pages/chat.js:1199 — the two spans are one implementation copied and then locally edited — 66 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 (15 matched lines × 2 locations) · ×1
Duplicated block with local edits (15 matched lines × 2 locations) crates/openfang-api/static/js/pages/skills.js:300— crates/openfang-api/static/js/pages/skills.js:300 · crates/openfang-api/static/js/pages/skills.js:331 — the two spans are one implementation copied and then locally edited — 78 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 × 2 locations) crates/openfang-api/static/js/pages/hands.js:174— crates/openfang-api/static/js/pages/hands.js:174 · crates/openfang-api/static/js/pages/hands.js:232 — both copies are in the same file, so extract the 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) crates/openfang-api/static/js/pages/agents.js:753— crates/openfang-api/static/js/pages/agents.js:753 · crates/openfang-api/static/js/pages/agents.js:767 — 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 (11 lines × 2 locations) crates/openfang-api/static/js/pages/settings.js:708— crates/openfang-api/static/js/pages/settings.js:708 · crates/openfang-api/static/js/pages/skills.js:95 — 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 (11 matched lines × 2 locations) · ×1
Duplicated block with local edits (11 matched lines × 2 locations) crates/openfang-api/static/js/pages/usage.js:26— crates/openfang-api/static/js/pages/usage.js:26 · crates/openfang-api/static/js/pages/workflows.js:20 — the two spans are one implementation copied and then locally edited — 51 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 (10 matched lines × 2 locations) · ×1
Duplicated block with local edits (10 matched lines × 2 locations) crates/openfang-api/static/js/pages/agents.js:794— crates/openfang-api/static/js/pages/agents.js:794 · crates/openfang-api/static/js/pages/wizard.js:511 — 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.
Duplicated block (8 lines × 3 locations) crates/openfang-api/static/js/pages/channels.js:85— crates/openfang-api/static/js/pages/channels.js:85 · crates/openfang-api/static/js/pages/settings.js:708 · crates/openfang-api/static/js/pages/skills.js:95 — 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.
R10 · Code Duplication· Duplicated block with local edits (7 matched lines × 2 locations) · ×1
Duplicated block with local edits (7 matched lines × 2 locations) REDACTED:438— REDACTED:438 · REDACTED:449 — the two spans are one implementation copied and then locally edited — 112 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 (5 lines × 4 locations) crates/openfang-api/static/js/pages/approvals.js:76— crates/openfang-api/static/js/pages/approvals.js:76 · crates/openfang-api/static/js/pages/comms.js:149 · crates/openfang-api/static/js/pages/overview.js:237 · crates/openfang-api/static/js/pages/scheduler.js:620 — the 4 copies are spread across 4 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.
Complex function handleWsMessage (cyclomatic 110, cognitive 198) crates/openfang-api/static/js/pages/chat.js:747— handleWsMessage has cyclomatic complexity 110 and cognitive complexity 198; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 executeSlashCommand (cyclomatic 54, cognitive 80) crates/openfang-api/static/js/pages/chat.js:439— executeSlashCommand has cyclomatic complexity 54 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 _renderCharts (cyclomatic 35, cognitive 64) crates/openfang-api/static/js/pages/hands.js:740— _renderCharts has cyclomatic complexity 35 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 generateToml (cyclomatic 33, cognitive 58) REDACTED:472— generateToml has cyclomatic complexity 33 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 renderCanvas (cyclomatic 29, cognitive 37) REDACTED:75— renderCanvas has cyclomatic complexity 29 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 (anonymous) (cyclomatic 27, cognitive 45) packages/whatsapp-gateway/index.js:119— (anonymous) has cyclomatic complexity 27 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 _applyKvToData (cyclomatic 27, cognitive 28) crates/openfang-api/static/js/pages/hands.js:690— _applyKvToData has cyclomatic complexity 27 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 describeCron (cyclomatic 26, cognitive 22) crates/openfang-api/static/js/pages/scheduler.js:529— describeCron has cyclomatic complexity 26 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 _extractProvider (cyclomatic 22, cognitive 16) crates/openfang-api/static/js/pages/usage.js:149— _extractProvider has cyclomatic complexity 22 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 toolIcon (cyclomatic 21, cognitive 20) crates/openfang-api/static/js/app.js:81— toolIcon has cyclomatic complexity 21 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 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 categories (cyclomatic 20, cognitive 19) crates/openfang-api/static/js/pages/skills.js:48— categories 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 validateTarget (cyclomatic 19, cognitive 24) crates/openfang-api/static/js/pages/scheduler.js:313— validateTarget has cyclomatic complexity 19 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 createAgent (cyclomatic 18, cognitive 23) crates/openfang-api/static/js/pages/wizard.js:492— createAgent has cyclomatic complexity 18 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 (anonymous) (cyclomatic 18, cognitive 19) packages/whatsapp-gateway/index.js:275— (anonymous) has cyclomatic complexity 18 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 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 suggestedMessages (cyclomatic 17, cognitive 16) crates/openfang-api/static/js/pages/wizard.js:179— suggestedMessages has cyclomatic complexity 17 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 getInstallCmd (cyclomatic 17, cognitive 10) crates/openfang-api/static/js/pages/hands.js:254— getInstallCmd has cyclomatic complexity 17 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 modelTier (cyclomatic 17, cognitive 9) crates/openfang-api/static/js/pages/usage.js:304— modelTier has cyclomatic complexity 17 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 sendMessage (cyclomatic 16, cognitive 23) crates/openfang-api/static/js/pages/chat.js:1071— sendMessage has cyclomatic complexity 16 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 _fetchDashboardData (cyclomatic 16, cognitive 17) crates/openfang-api/static/js/pages/hands.js:620— _fetchDashboardData has cyclomatic complexity 16 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 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 loadData (cyclomatic 16, cognitive 15) crates/openfang-api/static/js/pages/runtime.js:18— loadData has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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.
R3 · Large Files· crates/openfang-api/static/js/pages/chat.js · ×1
crates/openfang-api/static/js/pages/chat.js: 1346 lines of code crates/openfang-api/static/js/pages/chat.js:1— crates/openfang-api/static/js/pages/chat.js has 1346 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· crates/openfang-api/static/js/pages/hands.js · ×1
crates/openfang-api/static/js/pages/hands.js: 888 lines of code crates/openfang-api/static/js/pages/hands.js:1— crates/openfang-api/static/js/pages/hands.js has 888 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· crates/openfang-api/static/js/pages/settings.js · ×1
crates/openfang-api/static/js/pages/settings.js: 758 lines of code crates/openfang-api/static/js/pages/settings.js:1— crates/openfang-api/static/js/pages/settings.js has 758 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· crates/openfang-api/static/js/pages/agents.js · ×1
crates/openfang-api/static/js/pages/agents.js: 753 lines of code crates/openfang-api/static/js/pages/agents.js:1— crates/openfang-api/static/js/pages/agents.js has 753 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· crates/openfang-api/static/js/pages/scheduler.js · ×1
crates/openfang-api/static/js/pages/scheduler.js: 584 lines of code crates/openfang-api/static/js/pages/scheduler.js:1— crates/openfang-api/static/js/pages/scheduler.js has 584 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· crates/openfang-api/static/js/pages/wizard.js · ×1
crates/openfang-api/static/js/pages/wizard.js: 571 lines of code crates/openfang-api/static/js/pages/wizard.js:1— crates/openfang-api/static/js/pages/wizard.js has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 566 lines of code REDACTED:1— REDACTED has 566 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· crates/openfang-api/static/js/pages/skills.js · ×1
crates/openfang-api/static/js/pages/skills.js: 470 lines of code crates/openfang-api/static/js/pages/skills.js:1— crates/openfang-api/static/js/pages/skills.js has 470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Weak hash algorithm crates/openfang-channels/src/wecom.rs:83— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Swallowed exception (caught, then discarded) crates/openfang-api/static/js/api.js:246— `catch (parseErr)` 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.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:193— `info!` at line 193 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:236— `info!` at line 236 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:296— `info!` at line 296 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:346— `debug!` at line 346 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:470— `debug!` at line 470 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:478— `debug!` at line 478 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:483— `error!` at line 483 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:587— `info!` at line 587 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:612— `warn!` at line 612 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:642— `debug!` at line 642 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:738— `warn!` at line 738 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:789— `info!` at line 789 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:796— `info!` at line 796 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-wire/src/peer.rs:800— `info!` at line 800 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/clawhub.rs:337— `debug!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/loader.rs:80— `debug!` at line 80 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/loader.rs:138— `error!` at line 138 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/loader.rs:185— `debug!` at line 185 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/loader.rs:332— `debug!` at line 332 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/loader.rs:384— `error!` at line 384 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/marketplace.rs:122— `info!` at line 122 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/marketplace.rs:154— `info!` at line 154 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/marketplace.rs:193— `info!` at line 193 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/openclaw_compat.rs:265— `info!` at line 265 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/openfang-skills/src/openclaw_compat.rs:433— `info!` at line 433 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Duplicated predicate crates/openfang-api/static/js/pages/logs.js:232— `map[action] || action.replace(/([A-Z])/g, ' $1').trim()` appears character-identically in 2 files — crates/openfang-api/static/js/pages/logs.js, crates/openfang-api/static/js/pages/overview.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-api/static/js/pages/overview.js:146— `p.auth_status === 'not_set' || p.auth_status === 'missing'` appears character-identically in 2 files — crates/openfang-api/static/js/pages/overview.js, crates/openfang-api/static/js/pages/settings.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-runtime/src/web_fetch.rs:197— `!url.starts_with("http://") && !url.starts_with("https://")` appears character-identically in 2 files — crates/openfang-runtime/src/web_fetch.rs, crates/openfang-types/src/scheduler.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-api/src/channel_bridge.rs:1868— `((value.starts_with('"') && value.ends_with('"')) || (value.starts_with('\'') && value.ends_with('\''))) && value.len() >= 2` appears character-identically in 3 files — crates/openfang-api/src/channel_bridge.rs, crates/openfang-cli/src/dotenv.rs, crates/openfang-desktop/src/server.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-api/src/routes.rs:9589— `c.is_alphanumeric() || c == ' ' || c == '-' || c == '_'` appears character-identically in 3 files — crates/openfang-api/src/routes.rs, crates/openfang-kernel/src/kernel.rs, crates/openfang-runtime/src/tool_runner.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-runtime/src/drivers/claude_code.rs:433— `detail.contains("not authenticated") || detail.contains("auth") || detail.contains("login") || detail.contains("credentials")` appears character-identically in 2 files — crates/openfang-runtime/src/drivers/claude_code.rs, crates/openfang-runtime/src/drivers/qwen_code.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-cli/src/tui/mod.rs:622— `key.code == KeyCode::Char('c') && key.modifiers.contains(KeyModifiers::CONTROL)` appears character-identically in 21 files — crates/openfang-cli/src/tui/mod.rs, crates/openfang-cli/src/tui/screens/agents.rs, crates/openfang-cli/src/tui/screens/audit.rs, crates/openfang-cli/src/tui/screens/channels.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-runtime/src/drivers/gemini.rs:863— `line.is_empty() || line.starts_with(':')` appears character-identically in 2 files — crates/openfang-runtime/src/drivers/gemini.rs, crates/openfang-runtime/src/drivers/openai.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-cli/src/main.rs:5227— `provider == "github-copilot" || provider == "copilot"` appears character-identically in 2 files — crates/openfang-cli/src/main.rs, crates/openfang-runtime/src/drivers/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-cli/src/tui/chat_runner.rs:175— `r.total_usage.input_tokens > 0 || r.total_usage.output_tokens > 0` appears character-identically in 2 files — crates/openfang-cli/src/tui/chat_runner.rs, crates/openfang-cli/src/tui/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/openfang-api/src/channel_bridge.rs:1860— `trimmed.is_empty() || trimmed.starts_with('#')` appears character-identically in 3 files — crates/openfang-api/src/channel_bridge.rs, crates/openfang-cli/src/dotenv.rs, crates/openfang-desktop/src/server.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default on Err crates/openfang-cli/src/tui/event.rs:1228— `daemon_client` turns every `Err` into `reqwest::blocking::Client::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/openfang-kernel/src/kernel.rs:6445— `build_mcp_summary` turns every `Err` into `String::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/openfang-runtime/src/workspace_context.rs:242— `load` turns every `Err` into `Self::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Subsumed condition operand crates/openfang-kernel/src/metering.rs:247— `model.contains("claude-opus-4-6")` can never decide this `||` — every value satisfying `model.contains("claude-opus-4-6")` also satisfies `model.contains("opus-4-6")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/openfang-kernel/src/metering.rs:253— `model.contains("claude-sonnet-4-6")` can never decide this `||` — every value satisfying `model.contains("claude-sonnet-4-6")` also satisfies `model.contains("sonnet-4-6")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/openfang-kernel/src/metering.rs:473— `model.contains("mistral-small")` can never decide this `||` — every value satisfying `model.contains("mistral-small")` also satisfies `model.contains("mistral")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Silent fallback default in catch crates/openfang-api/static/js/pages/scheduler.js:604— `schedulerPage.formatTime` 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 crates/openfang-api/static/js/pages/scheduler.js:624— `schedulerPage.relativeTime` swallows every exception into `return 'never'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 24 significant file(s) lose their only recent owner: crates/openfang-cli/src/tui/event.rs, crates/openfang-runtime/src/drivers/anthropic.rs, crates/openfang-skills/src/clawhub.rs, crates/openfang-memory/src/session.rs, crates/openfang-api/src/openai_compat.rs, crates/openfang-kernel/src/config_reload.rs, crates/openfang-channels/src/bluesky.rs, crates/openfang-types/src/commands.rs (+16 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (27 single-owned of 235 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 235 of the 251 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/openfang-runtime/src/host_functions.rs, crates/openfang-runtime/src/web_search.rs, crates/openfang-extensions/src/installer.rs.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 18 project(s) overshoot their size bounds, lowering Project Cohesion to 6.7/10. The most over is `crates/openfang-runtime` (47098 LoC, 171 module-visible types across 2 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
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.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 594/779 types (76%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
Logging is not universal — Only 13/16 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `agents/langchain-code-reviewer`, `sdk/python`, `xtask`.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 0/4 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/openfang-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: async-trait — `async-trait` is locked at 0.1.89 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` and commit the updated REDACTED.
Outdated: axum — `axum` is locked at 0.8.8 but 0.8.9 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum` and commit the updated REDACTED.
Outdated: bitflags — `bitflags` is locked at 2.11.0 but 2.13.2 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/openfang-types/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitflags` and commit the updated REDACTED.
Outdated: bytes — `bytes` is locked at 1.11.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/openfang-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.44 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.6.0 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in crates/openfang-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: clap_complete — `clap_complete` is locked at 4.6.0 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in crates/openfang-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap_complete` and commit the updated REDACTED.
Outdated: crossbeam — `crossbeam` is locked at 0.8.4 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/openfang-kernel/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam` and commit the updated REDACTED.
Outdated: dashmap — `dashmap` is locked at 6.1.0 but 6.2.1 is the current stable release on crates.io, and it already satisfies the `"6"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p dashmap` and commit the updated REDACTED.
Outdated: futures — `futures` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
Outdated: http — `http` is locked at 1.4.0 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/openfang-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http` and commit the updated REDACTED.
Outdated: lettre — `lettre` is locked at 0.11.21 but 0.11.23 is the current stable release on crates.io, and it already satisfies the `"0.11"` requirement declared in crates/openfang-channels/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p lettre` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.185 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/openfang-kernel/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: open — `open` is locked at 5.3.4 but 5.4.5 is the current stable release on crates.io, and it already satisfies the `"5"` requirement declared in crates/openfang-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p open` and commit the updated REDACTED.
Outdated: prost — `prost` is locked at 0.14.3 but 0.14.4 is the current stable release on crates.io, and it already satisfies the `"0.14"` requirement declared in crates/openfang-channels/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p prost` and commit the updated REDACTED.
Outdated: roxmltree — `roxmltree` is locked at 0.21.1 but 0.21.2 is the current stable release on crates.io, and it already satisfies the `"0.21"` requirement declared in crates/openfang-channels/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p roxmltree` and commit the updated REDACTED.
Outdated: rustls — `rustls` is locked at 0.23.39 but 0.23.46 is the current stable release on crates.io, and it already satisfies the `"0.23"` requirement declared in crates/openfang-kernel/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.149 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/openfang-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: tauri — `tauri` is locked at 2.10.3 but 2.12.5 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/openfang-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri` and commit the updated REDACTED.
Outdated: tauri-build — `tauri-build` is locked at 2.5.6 but 2.7.4 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/openfang-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-build` and commit the updated REDACTED.
Outdated: tauri-plugin-autostart — `tauri-plugin-autostart` is locked at 2.5.1 but 2.7.0 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/openfang-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-autostart` and commit the updated REDACTED.
Outdated: tauri-plugin-dialog — `tauri-plugin-dialog` is locked at 2.6.0 but 2.8.3 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/openfang-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-dialog` and commit the updated REDACTED.
Outdated: tauri-plugin-global-shortcut — `tauri-plugin-global-shortcut` is locked at 2.3.1 but 2.4.1 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/openfang-desktop/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-global-shortcut` and commit the updated REDACTED.
+ 9 more in this group — see findings.md.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
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.
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 01a17641-0ac6-7d1c-9bfa-72d2a7f08ede · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 52 · Warnings: 1534 · Recommendations: 77 · Info: 34 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 03:28 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.