Public report of tw93/Kaku, published 27 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, 27 October 2026, 21:49 UTC · Survey ID cd_949fd2efe5d24c7284940553aa748c1b
tw93/Kaku
Measured 27 October 2026, 21:43 UTC, at code version 838cbe0
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 scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 16 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: 305,733 lines of product code in 64 projects, tests not counted · Estimated rebuild effort: about 2.4 person-years · Weakest lens: Accessibility, 47
Findings by how serious they are
66 critical1435 serious229 minor
16 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
27 October 2026, 21:43 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.
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 ▸
79of 79 dimensions measured by tools.
1635of 1730 findings point to an exact file and line, so you can open each one in the code. The other 95 concern the repository as a whole, such as missing documentation.
79dimensions across 9 lenses, read from 305,733 lines of product code in 64 projects.
tw93/Kaku falls short of our standard for a preview release, held back most by its Accessibility lens, the interface's usability with a keyboard or assistive technology. It scores 53 out of 100 and is rated Adequate, and 40 of its 66 critical findings are security problems.
Accessibility, at 47, is the weakest lens and counts most in the score. The best first step is fixing focus, motion and contrast, worth about 4 points. Recording design decisions comes next, worth about 2 points. Raising Accessibility to 65 would lift the score to about 58.
Thirty-eight weaknesses in the code could be used by an attacker. One known security hole in a package the code depends on can be used by attackers, and twenty-four parts of the code are no longer understood by anyone working on it. Fixing the weaknesses the scanner points to, updating the vulnerable packages and having someone learn the forgotten files would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command. Moving the business rules into the object that owns the data would take care of the business object that only holds data.
The product code is 305,733 lines, about €350,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 Accessibility rose from 47 to 65, the lowest score rated Strong, the score would rise from 53 to about 58.
Code composition: what the lines of code are
Product code 98%Tests 2%
New since the last survey: 161 findings
These 161 critical or serious findings weren't in the previous survey, on 13 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 42 findings
These 42 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.
IaC & Container Security · High IaC: DS-0002 REDACTED
Supply-chain Provenance & Signing · REDACTED
Rebuild cost: about €350,000 · Estimate
Cost to rebuild
€120,000 to €580,000, for 1,937 to 6,145 hours of work, about 2.4 person-years for 1 to 5 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 53. 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: 305,733 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
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.
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 2 points · Low effort · ADR Quality
3
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.
Raises the score by about 3 points · Medium effort · A11y enforcement
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 €350,000 to build again, about 2.4 person-years of work. Its weakest lens is Accessibility, at 47 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 89,974 lines over the last 90 days, which is about 364,895 lines a year. At that pace, the extra work comes to an estimated 38.3 to 229.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — 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.
420 modules, with 1239 dependencies between them. 8 loops run through 70 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 380 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.
config.font uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break config.font, while a change to config.font can't break wezterm_dynamic.value.
Position
Below the diagonal: config.font uses a module listed above it, which is the healthy direction.
config.font uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break config.font, while a change to config.font can't break wezterm_escape_parser.csi.
Position
Below the diagonal: config.font uses a module listed above it, which is the healthy direction.
config.units uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break config.units, while a change to config.units can't break wezterm_dynamic.value.
Position
Below the diagonal: config.units uses a module listed above it, which is the healthy direction.
wezterm_color_types uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break wezterm_color_types, while a change to wezterm_color_types can't break wezterm_dynamic.value.
Position
Below the diagonal: wezterm_color_types uses a module listed above it, which is the healthy direction.
10→16 wezterm_color_types uses config.colorpart of a loop✕
Connections
1 pair of types, where a type in wezterm_color_types uses a type in config.color.
wezterm_color_types uses config.color, so a change to config.color can break wezterm_color_types, while a change to wezterm_color_types can't break config.color.
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.
wezterm_input_types uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break wezterm_input_types, while a change to wezterm_input_types can't break wezterm_dynamic.value.
Position
Below the diagonal: wezterm_input_types uses a module listed above it, which is the healthy direction.
wezterm_input_types uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break wezterm_input_types, while a change to wezterm_input_types can't break wezterm_escape_parser.csi.
Position
Below the diagonal: wezterm_input_types uses a module listed above it, which is the healthy direction.
wezterm_surface.line.line uses wezterm_cell, so a change to wezterm_cell can break wezterm_surface.line.line, while a change to wezterm_surface.line.line can't break wezterm_cell.
Position
Below the diagonal: wezterm_surface.line.line uses a module listed above it, which is the healthy direction.
config.keyassignment uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break config.keyassignment, while a change to config.keyassignment can't break wezterm_dynamic.value.
Position
Below the diagonal: config.keyassignment uses a module listed above it, which is the healthy direction.
config.keyassignment uses config.units, so a change to config.units can break config.keyassignment, while a change to config.keyassignment can't break config.units.
Position
Below the diagonal: config.keyassignment uses a module listed above it, which is the healthy direction.
wezterm_surface uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break wezterm_surface, while a change to wezterm_surface can't break wezterm_surface.line.line.
Position
Below the diagonal: wezterm_surface uses a module listed above it, which is the healthy direction.
wezterm_term.color uses wezterm_color_types, so a change to wezterm_color_types can break wezterm_term.color, while a change to wezterm_term.color can't break wezterm_color_types.
Position
Below the diagonal: wezterm_term.color uses a module listed above it, which is the healthy direction.
15→16 wezterm_term.color uses config.colorpart of a loop✕
Connections
1 pair of types, where a type in wezterm_term.color uses a type in config.color.
wezterm_term.color uses config.color, so a change to config.color can break wezterm_term.color, while a change to wezterm_term.color can't break config.color.
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.
config.color uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break config.color, while a change to config.color can't break wezterm_dynamic.value.
Position
Below the diagonal: config.color uses a module listed above it, which is the healthy direction.
config.color uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break config.color, while a change to config.color can't break wezterm_escape_parser.csi.
Position
Below the diagonal: config.color uses a module listed above it, which is the healthy direction.
config.color uses wezterm_color_types, so a change to wezterm_color_types can break config.color, while a change to config.color can't break wezterm_color_types.
Position
Below the diagonal: config.color uses a module listed above it, which is the healthy direction.
config.color uses wezterm_term.color, so a change to wezterm_term.color can break config.color, while a change to config.color can't break wezterm_term.color.
Position
Below the diagonal: config.color uses a module listed above it, which is the healthy direction.
kaku_remote.web uses kaku_remote.queue, so a change to kaku_remote.queue can break kaku_remote.web, while a change to kaku_remote.web can't break kaku_remote.queue.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in kaku_remote.web uses a type in vtparse.enums.
The types involved
kaku_remote.web.web$module → vtparse.enums.State
Direction
kaku_remote.web uses vtparse.enums, so a change to vtparse.enums can break kaku_remote.web, while a change to kaku_remote.web can't break vtparse.enums.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
kaku_remote.web uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break kaku_remote.web, while a change to kaku_remote.web can't break wezterm_escape_parser.csi.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
kaku_remote.web uses wezterm_input_types, so a change to wezterm_input_types can break kaku_remote.web, while a change to kaku_remote.web can't break wezterm_input_types.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
kaku_remote.web uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break kaku_remote.web, while a change to kaku_remote.web can't break wezterm_surface.line.line.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
kaku_remote.web uses wezterm_surface, so a change to wezterm_surface can break kaku_remote.web, while a change to kaku_remote.web can't break wezterm_surface.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
kaku_remote.web uses wezterm_term.color, so a change to wezterm_term.color can break kaku_remote.web, while a change to kaku_remote.web can't break wezterm_term.color.
Position
Below the diagonal: kaku_remote.web uses a module listed above it, which is the healthy direction.
17→22 kaku_remote.web uses config.configpart of a loop✕
Connections
1 pair of types, where a type in kaku_remote.web uses a type in config.config.
kaku_remote.web uses config.config, so a change to config.config can break kaku_remote.web, while a change to kaku_remote.web can't break config.config.
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.
wezterm_term.terminalstate uses bintree, so a change to bintree can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break bintree.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses filedescriptor, so a change to filedescriptor can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break filedescriptor.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses kaku_remote.queue, so a change to kaku_remote.queue can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break kaku_remote.queue.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses wezterm_cell, so a change to wezterm_cell can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_cell.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_escape_parser.csi.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses wezterm_input_types, so a change to wezterm_input_types can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_input_types.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_surface.line.line.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses wezterm_surface, so a change to wezterm_surface can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_surface.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses wezterm_term.color, so a change to wezterm_term.color can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_term.color.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
wezterm_term.terminalstate uses kaku_remote.web, so a change to kaku_remote.web can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break kaku_remote.web.
Position
Below the diagonal: wezterm_term.terminalstate uses a module listed above it, which is the healthy direction.
19→21 wezterm_term.terminalstate uses wezterm_term.terminalpart of a loop✕
Connections
3 pairs of types, where a type in wezterm_term.terminalstate uses a type in wezterm_term.terminal.
wezterm_term.terminalstate uses wezterm_term.terminal, so a change to wezterm_term.terminal can break wezterm_term.terminalstate, while a change to wezterm_term.terminalstate can't break wezterm_term.terminal.
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.
wezterm_font uses kaku_remote.queue, so a change to kaku_remote.queue can break wezterm_font, while a change to wezterm_font can't break kaku_remote.queue.
Position
Below the diagonal: wezterm_font uses a module listed above it, which is the healthy direction.
wezterm_term.terminal uses vtparse.enums, so a change to vtparse.enums can break wezterm_term.terminal, while a change to wezterm_term.terminal can't break vtparse.enums.
Position
Below the diagonal: wezterm_term.terminal uses a module listed above it, which is the healthy direction.
wezterm_term.terminal uses wezterm_term.terminalstate, so a change to wezterm_term.terminalstate can break wezterm_term.terminal, while a change to wezterm_term.terminal can't break wezterm_term.terminalstate.
Position
Below the diagonal: wezterm_term.terminal uses a module listed above it, which is the healthy direction.
config.config uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break config.config, while a change to config.config can't break wezterm_dynamic.value.
Position
Below the diagonal: config.config uses a module listed above it, which is the healthy direction.
config.config uses wezterm_input_types, so a change to wezterm_input_types can break config.config, while a change to config.config can't break wezterm_input_types.
Position
Below the diagonal: config.config uses a module listed above it, which is the healthy direction.
config.config uses config.keyassignment, so a change to config.keyassignment can break config.config, while a change to config.config can't break config.keyassignment.
Position
Below the diagonal: config.config uses a module listed above it, which is the healthy direction.
config.config uses wezterm_surface, so a change to wezterm_surface can break config.config, while a change to config.config can't break wezterm_surface.
Position
Below the diagonal: config.config uses a module listed above it, which is the healthy direction.
config.config uses wezterm_term.terminal, so a change to wezterm_term.terminal can break config.config, while a change to config.config can't break wezterm_term.terminal.
Position
Below the diagonal: config.config uses a module listed above it, which is the healthy direction.
kaku.ai_config.tui uses kaku_remote.queue, so a change to kaku_remote.queue can break kaku.ai_config.tui, while a change to kaku.ai_config.tui can't break kaku_remote.queue.
Position
Below the diagonal: kaku.ai_config.tui uses a module listed above it, which is the healthy direction.
kaku.ai_config.tui uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break kaku.ai_config.tui, while a change to kaku.ai_config.tui can't break wezterm_dynamic.value.
Position
Below the diagonal: kaku.ai_config.tui uses a module listed above it, which is the healthy direction.
kaku.ai_config.tui uses wezterm_input_types, so a change to wezterm_input_types can break kaku.ai_config.tui, while a change to kaku.ai_config.tui can't break wezterm_input_types.
Position
Below the diagonal: kaku.ai_config.tui uses a module listed above it, which is the healthy direction.
kaku.ai_config.tui uses wezterm_term.terminal, so a change to wezterm_term.terminal can break kaku.ai_config.tui, while a change to kaku.ai_config.tui can't break wezterm_term.terminal.
Position
Below the diagonal: kaku.ai_config.tui uses a module listed above it, which is the healthy direction.
kaku_gui.glyphcache uses kaku_remote.queue, so a change to kaku_remote.queue can break kaku_gui.glyphcache, while a change to kaku_gui.glyphcache can't break kaku_remote.queue.
Position
Below the diagonal: kaku_gui.glyphcache uses a module listed above it, which is the healthy direction.
kaku_gui.glyphcache uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break kaku_gui.glyphcache, while a change to kaku_gui.glyphcache can't break wezterm_escape_parser.csi.
Position
Below the diagonal: kaku_gui.glyphcache uses a module listed above it, which is the healthy direction.
kaku_gui.glyphcache uses config.font, so a change to config.font can break kaku_gui.glyphcache, while a change to kaku_gui.glyphcache can't break config.font.
Position
Below the diagonal: kaku_gui.glyphcache uses a module listed above it, which is the healthy direction.
kaku_gui.glyphcache uses wezterm_surface, so a change to wezterm_surface can break kaku_gui.glyphcache, while a change to kaku_gui.glyphcache can't break wezterm_surface.
Position
Below the diagonal: kaku_gui.glyphcache uses a module listed above it, which is the healthy direction.
kaku_gui.glyphcache uses wezterm_font, so a change to wezterm_font can break kaku_gui.glyphcache, while a change to kaku_gui.glyphcache can't break wezterm_font.
Position
Below the diagonal: kaku_gui.glyphcache uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.box_model uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break wezterm_escape_parser.csi.
Position
Below the diagonal: kaku_gui.termwindow.box_model uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.box_model uses config.units, so a change to config.units can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break config.units.
Position
Below the diagonal: kaku_gui.termwindow.box_model uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.box_model uses wezterm_color_types, so a change to wezterm_color_types can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break wezterm_color_types.
Position
Below the diagonal: kaku_gui.termwindow.box_model uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.box_model uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break wezterm_surface.line.line.
Position
Below the diagonal: kaku_gui.termwindow.box_model uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.box_model uses wezterm_term.color, so a change to wezterm_term.color can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break wezterm_term.color.
Position
Below the diagonal: kaku_gui.termwindow.box_model uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.box_model uses wezterm_font, so a change to wezterm_font can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break wezterm_font.
Position
Below the diagonal: kaku_gui.termwindow.box_model uses a module listed above it, which is the healthy direction.
25→37 kaku_gui.termwindow.box_model uses kaku_gui.termwindowpart of a loop✕
Connections
3 pairs of types, where a type in kaku_gui.termwindow.box_model uses a type in kaku_gui.termwindow.
kaku_gui.termwindow.box_model uses kaku_gui.termwindow, so a change to kaku_gui.termwindow can break kaku_gui.termwindow.box_model, while a change to kaku_gui.termwindow.box_model can't break kaku_gui.termwindow.
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.
mux.renderable uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break mux.renderable, while a change to mux.renderable can't break wezterm_dynamic.value.
Position
Below the diagonal: mux.renderable uses a module listed above it, which is the healthy direction.
mux.renderable uses wezterm_surface, so a change to wezterm_surface can break mux.renderable, while a change to mux.renderable can't break wezterm_surface.
Position
Below the diagonal: mux.renderable uses a module listed above it, which is the healthy direction.
mux.renderable uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.renderable, while a change to mux.renderable can't break wezterm_term.terminal.
Position
Below the diagonal: mux.renderable uses a module listed above it, which is the healthy direction.
window uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break window, while a change to window can't break wezterm_escape_parser.csi.
Position
Below the diagonal: window uses a module listed above it, which is the healthy direction.
mux.tab uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.tab, while a change to mux.tab can't break wezterm_term.terminal.
Position
Below the diagonal: mux.tab uses a module listed above it, which is the healthy direction.
mux.domain uses config.keyassignment, so a change to config.keyassignment can break mux.domain, while a change to mux.domain can't break config.keyassignment.
Position
Below the diagonal: mux.domain uses a module listed above it, which is the healthy direction.
mux.domain uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.domain, while a change to mux.domain can't break wezterm_term.terminal.
Position
Below the diagonal: mux.domain uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in mux.pane uses a type in wezterm_dynamic.value.
The types involved
mux.pane.Pane → wezterm_dynamic.value.Value
Direction
mux.pane uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break mux.pane, while a change to mux.pane can't break wezterm_dynamic.value.
Position
Below the diagonal: mux.pane uses a module listed above it, which is the healthy direction.
mux.pane uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break mux.pane, while a change to mux.pane can't break wezterm_surface.line.line.
Position
Below the diagonal: mux.pane uses a module listed above it, which is the healthy direction.
mux.pane uses config.keyassignment, so a change to config.keyassignment can break mux.pane, while a change to mux.pane can't break config.keyassignment.
Position
Below the diagonal: mux.pane uses a module listed above it, which is the healthy direction.
mux.pane uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.pane, while a change to mux.pane can't break wezterm_term.terminal.
Position
Below the diagonal: mux.pane uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses wezterm_cell, so a change to wezterm_cell can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break wezterm_cell.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses config.font, so a change to config.font can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break config.font.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses wezterm_color_types, so a change to wezterm_color_types can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break wezterm_color_types.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break wezterm_surface.line.line.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses wezterm_surface, so a change to wezterm_surface can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break wezterm_surface.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses wezterm_term.color, so a change to wezterm_term.color can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break wezterm_term.color.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses config, so a change to config can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break config.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses wezterm_font, so a change to wezterm_font can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break wezterm_font.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses mux.renderable, so a change to mux.renderable can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break mux.renderable.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses window, so a change to window can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break window.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow.render uses mux.pane, so a change to mux.pane can break kaku_gui.termwindow.render, while a change to kaku_gui.termwindow.render can't break mux.pane.
Position
Below the diagonal: kaku_gui.termwindow.render uses a module listed above it, which is the healthy direction.
mux.localpane uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break mux.localpane, while a change to mux.localpane can't break wezterm_dynamic.value.
Position
Below the diagonal: mux.localpane uses a module listed above it, which is the healthy direction.
mux.localpane uses wezterm_input_types, so a change to wezterm_input_types can break mux.localpane, while a change to mux.localpane can't break wezterm_input_types.
Position
Below the diagonal: mux.localpane uses a module listed above it, which is the healthy direction.
mux.localpane uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break mux.localpane, while a change to mux.localpane can't break wezterm_surface.line.line.
Position
Below the diagonal: mux.localpane uses a module listed above it, which is the healthy direction.
mux.localpane uses config.keyassignment, so a change to config.keyassignment can break mux.localpane, while a change to mux.localpane can't break config.keyassignment.
Position
Below the diagonal: mux.localpane uses a module listed above it, which is the healthy direction.
mux.localpane uses wezterm_term.color, so a change to wezterm_term.color can break mux.localpane, while a change to mux.localpane can't break wezterm_term.color.
Position
Below the diagonal: mux.localpane uses a module listed above it, which is the healthy direction.
mux.localpane uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.localpane, while a change to mux.localpane can't break wezterm_term.terminal.
Position
Below the diagonal: mux.localpane uses a module listed above it, which is the healthy direction.
mux.ssh uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.ssh, while a change to mux.ssh can't break wezterm_term.terminal.
Position
Below the diagonal: mux.ssh uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses filedescriptor, so a change to filedescriptor can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break filedescriptor.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses kaku_remote.queue, so a change to kaku_remote.queue can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break kaku_remote.queue.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses vtparse.enums, so a change to vtparse.enums can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break vtparse.enums.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses wezterm_input_types, so a change to wezterm_input_types can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break wezterm_input_types.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses config.keyassignment, so a change to config.keyassignment can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break config.keyassignment.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses wezterm_term.color, so a change to wezterm_term.color can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break wezterm_term.color.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses wezterm_term.terminal, so a change to wezterm_term.terminal can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break wezterm_term.terminal.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses mux.renderable, so a change to mux.renderable can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break mux.renderable.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
mux.termwiztermtab uses mux.domain, so a change to mux.domain can break mux.termwiztermtab, while a change to mux.termwiztermtab can't break mux.domain.
Position
Below the diagonal: mux.termwiztermtab uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_cell, so a change to wezterm_cell can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_cell.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_dynamic.value, so a change to wezterm_dynamic.value can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_dynamic.value.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_escape_parser.csi.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses config.font, so a change to config.font can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break config.font.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses config.units, so a change to config.units can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break config.units.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_color_types, so a change to wezterm_color_types can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_color_types.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_input_types, so a change to wezterm_input_types can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_input_types.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_surface.line.line, so a change to wezterm_surface.line.line can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_surface.line.line.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses config.keyassignment, so a change to config.keyassignment can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break config.keyassignment.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_term.color, so a change to wezterm_term.color can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_term.color.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses config.color, so a change to config.color can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break config.color.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses kaku_remote.web, so a change to kaku_remote.web can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break kaku_remote.web.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_font, so a change to wezterm_font can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_font.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses wezterm_term.terminal, so a change to wezterm_term.terminal can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break wezterm_term.terminal.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses config.config, so a change to config.config can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break config.config.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses kaku_gui.glyphcache, so a change to kaku_gui.glyphcache can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break kaku_gui.glyphcache.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses kaku_gui.termwindow.box_model, so a change to kaku_gui.termwindow.box_model can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break kaku_gui.termwindow.box_model.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses mux.renderable, so a change to mux.renderable can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break mux.renderable.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
kaku_gui.termwindow uses kaku_gui.termwindow.render, so a change to kaku_gui.termwindow.render can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break kaku_gui.termwindow.render.
Position
Below the diagonal: kaku_gui.termwindow uses a module listed above it, which is the healthy direction.
37→39 kaku_gui.termwindow uses kaku_gui.overlay.copypart of a loop✕
Connections
1 pair of types, where a type in kaku_gui.termwindow uses a type in kaku_gui.overlay.copy.
kaku_gui.termwindow uses kaku_gui.overlay.copy, so a change to kaku_gui.overlay.copy can break kaku_gui.termwindow, while a change to kaku_gui.termwindow can't break kaku_gui.overlay.copy.
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.
wezterm_client.client uses filedescriptor, so a change to filedescriptor can break wezterm_client.client, while a change to wezterm_client.client can't break filedescriptor.
Position
Below the diagonal: wezterm_client.client uses a module listed above it, which is the healthy direction.
wezterm_client.client uses kaku_remote.queue, so a change to kaku_remote.queue can break wezterm_client.client, while a change to wezterm_client.client can't break kaku_remote.queue.
Position
Below the diagonal: wezterm_client.client uses a module listed above it, which is the healthy direction.
wezterm_client.client uses mux.domain, so a change to mux.domain can break wezterm_client.client, while a change to wezterm_client.client can't break mux.domain.
Position
Below the diagonal: wezterm_client.client uses a module listed above it, which is the healthy direction.
wezterm_client.client uses mux.pane, so a change to mux.pane can break wezterm_client.client, while a change to wezterm_client.client can't break mux.pane.
Position
Below the diagonal: wezterm_client.client uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses vtparse.enums, so a change to vtparse.enums can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break vtparse.enums.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses wezterm_cell, so a change to wezterm_cell can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break wezterm_cell.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break wezterm_escape_parser.csi.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses wezterm_input_types, so a change to wezterm_input_types can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break wezterm_input_types.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses config.keyassignment, so a change to config.keyassignment can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break config.keyassignment.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses wezterm_term.color, so a change to wezterm_term.color can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break wezterm_term.color.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses wezterm_term.terminal, so a change to wezterm_term.terminal can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break wezterm_term.terminal.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses mux.renderable, so a change to mux.renderable can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break mux.renderable.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses mux.tab, so a change to mux.tab can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break mux.tab.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses mux.domain, so a change to mux.domain can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break mux.domain.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses mux.pane, so a change to mux.pane can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break mux.pane.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
kaku_gui.overlay.copy uses kaku_gui.termwindow, so a change to kaku_gui.termwindow can break kaku_gui.overlay.copy, while a change to kaku_gui.overlay.copy can't break kaku_gui.termwindow.
Position
Below the diagonal: kaku_gui.overlay.copy uses a module listed above it, which is the healthy direction.
window.os.macos.window uses wezterm_escape_parser.csi, so a change to wezterm_escape_parser.csi can break window.os.macos.window, while a change to window.os.macos.window can't break wezterm_escape_parser.csi.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses wezterm_input_types, so a change to wezterm_input_types can break window.os.macos.window, while a change to window.os.macos.window can't break wezterm_input_types.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses config.keyassignment, so a change to config.keyassignment can break window.os.macos.window, while a change to window.os.macos.window can't break config.keyassignment.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses config, so a change to config can break window.os.macos.window, while a change to window.os.macos.window can't break config.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses wezterm_font, so a change to wezterm_font can break window.os.macos.window, while a change to window.os.macos.window can't break wezterm_font.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses wezterm_term.terminal, so a change to wezterm_term.terminal can break window.os.macos.window, while a change to window.os.macos.window can't break wezterm_term.terminal.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses window, so a change to window can break window.os.macos.window, while a change to window.os.macos.window can't break window.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
window.os.macos.window uses kaku_gui.overlay.copy, so a change to kaku_gui.overlay.copy can break window.os.macos.window, while a change to window.os.macos.window can't break kaku_gui.overlay.copy.
Position
Below the diagonal: window.os.macos.window uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 51% · Adequate · gated by D1, D2, X3, 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
40
High / Critical
A03:2025 — Software Supply Chain Failures
14
High / Critical
A02:2025 — Security Misconfiguration
3
Medium
Roadmap
First, address visual and motion safety by ensuring visible focus styles, respecting reduced motion preferences, and fixing low-contrast colors. Next, enforce accessibility standards by integrating invariant checks into your test suite and gating merges on CI. Finally, improve code reliability and structure by implementing structured logging, correcting page semantics like language and landmarks, and resolving swallowed exceptions.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
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.
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.
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 — 66
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 — 1435
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 — 229
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
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. 79 of 79 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 — 79 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, 1635 of 1730 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, .cjs) 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`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) 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`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) 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.
D10 Test 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. The 120 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 25 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — 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, .cjs) and this repository declares a Cargo test suite (repository root, 175 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.
D32 Data Compliance (PII/GDPR) — 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. `crates/kaku-remote/assets/web/xterm-webgl.js` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
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 REDACTED (REDACTED). docker build failed (exit 1) — 2 | # carry the web terminal's page and fonts from crates/kaku-remote. 3 | >>> FROM rust:1.95-slim AS builder 4 | WORKDIR /app 5 | -------------------- ERROR: failed to solve: rust:1.95-slim: failed to resolve source metadata for docker.io/library/rust:1.95-slim: failed to do request: Head "https://registry-1.docker.io/v2/library/rust/manifests/1.95-slim": Forbidden; runtime evidence skipped.
C1 Data Protection — 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. 'rusqlite' is imported (kaku/src/ai_config/tui/providers/mod.rs:183), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'rusqlite' is imported (kaku/src/ai_config/tui/providers/mod.rs:183), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — 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. 'rusqlite' is imported (kaku/src/ai_config/tui/providers/mod.rs:183), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — 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. 'rusqlite' is imported (kaku/src/ai_config/tui/providers/mod.rs:183), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — 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, lua 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, lua 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.
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 Lua, 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.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
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".
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.
214 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PhysKeyCode::for_each_code at 321. A further 33 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 BlockKey::from_char at 371 — they are counted neither in the figure above nor in this dimension's score. 8 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: kaku-gui/src/overlay/copy.rs (CopyOverlay::perform_assignment at 42), config/src/background.rs (GradientPreset::build at 38), crates/wezterm-ssh/src/sftp/error.rs (SftpError::try_from at 23), kaku-gui/src/inputmap.rs (kaku_gui::inputmap::ui_key at 22), kaku/src/cli/mod.rs (kaku::cli::run_cli_async at 19), and 3 more not listed here. 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.
+ 72 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 PhysKeyCode::for_each_code (cyclomatic 321), TermWindow::perform_key_assignment (cyclomatic 174), kaku_gui::commands::derive_command_from_key_assignment (cyclomatic 166). — 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 4.0 to about 5.3/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.
+ 129 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 10 bodies over 120 down to 120 or less in Cognitive Complexity — start with PhysKeyCode::for_each_code (cognitive 427), kaku_remote::web::run_session (cognitive 374), TermWindow::render_screen_line (cognitive 218). — 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 10 together lifts Cognitive Complexity from 2.0 to about 3.0/10, projected with the scoring formula itself and assuming each lands exactly at 120; 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.0 / 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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 101 MethodTooLong finding(s) in God Classes — start with mod.rs (15), lib.rs (11), window.rs (4). — One of this dimension's main actionable groups (101 warning-level).
Resolve the 80 FileTooLong finding(s) in God Classes — start with mod.rs (10), lib.rs (8), main.rs (3). — One of this dimension's main actionable groups (80 warning-level).
Resolve the 48 FunctionTooLong finding(s) in God Classes — start with mod.rs (6), lib.rs (4), web.rs (3). — One of this dimension's main actionable groups (48 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.
302 duplicated block group(s) detected. A further 5 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 74 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 25 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (2), session_restore.rs (2), tab.rs (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 25 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (5), copy.rs (3), lib.rs (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 25 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with mod.rs (4), copy.rs (2), ui.rs (2). — One of this dimension's main actionable groups (25 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.3 / 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.
64 production modules (Cargo), 0 dependency cycle(s), 5 unstable depended-on module(s). Read from the build's own module declarations; 15 module(s) off the main sequence, with abstractness counted on 51 of the 64 (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: bintree · ×15
Unstable project color-funcs
Unstable project env-bootstrap
Unstable project mux-lua
Unstable project wezterm-client
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 15 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (15 warning-level).
Resolve the 1 Unstable project color-funcs finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project env-bootstrap 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.
Low cohesion: Element (LCOM4 13) · ×5kaku-gui/src/termwindow/box_model.rs:223
What to do
Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with box_model.rs, config.rs, connection.rs. — One of this dimension's main actionable groups (5 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 Distribution9.7 / 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.
1979 test methods: 1914 unit, 26 integration, 0 BDD, 39 e2e. The JavaScript/TypeScript suite contributes 120 `it`/`test` case(s) across 1 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 1824 `#[test]` function(s) across 175 file(s) declaring at least one; its unit/integration split is Cargo's own — 4 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 35 test function(s) across 4 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.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
4 skipped (4 with a documented reason), 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 120 tests. Measured on the JavaScript/TypeScript suite only — at least 25 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: an upload waiting for relay authentication settles when its socket closescrates/kaku-remote/tests/web.test.cjs:1046
Skipped (documented): a lost WebGL context hands the grid to the DOM at once and comes back · ×4crates/kaku-remote/tests/web.test.cjs:1749
What to do
Resolve the 1 No assertions finding(s) in Test Quality — start with web.test.cjs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, 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.
58 outdated, 0 yanked direct Cargo dependencies. 160 of 163 direct crates were graded against crates.io (0 not published there, 3 not resolved by a committed REDACTED). 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 · ×58
What to do
Improve Dependency Hygiene — currently 8.0/10. — 58 outdated, 0 yanked direct Cargo dependencies. 160 of 163 direct crates were graded against crates.io (0 not published there, 3 not resolved by a committed REDACTED). 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 717 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. A further 1 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict.
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: kaku-gui/src/termwindow/mod.rs (52×174=9048); crates/kaku-remote/src/web.rs (56×116=6496); crates/kaku-remote/assets/web/index.html (97×46=4462) Repeated repair below the complexity floor: crates/wezterm-surface/src/line/test.rs (5 of 5 changes were fixes); crates/wezterm-surface/src/line/line.rs (5 of 5 changes were fixes); kaku-gui/src/ai_tools/paths.rs (5 of 5 changes were fixes)
Resolve the 42 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (5), main.rs (3), lib.rs (2). — One of this dimension's main actionable groups (42 warning-level).
Resolve the 15 Repeated repair finding(s) in Churn × Complexity Hotspots — start with test.rs, line.rs, paths.rs. — One of this dimension's main actionable groups (15 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.
40 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is kaku-gui/src/customglyph.rs. Counted over 330 of the 432 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 · ×3
Further sole-owners (lower concentration)
What to do
Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 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.
78 deducted task-comment markers across 305733 LoC (0.0/KLoC) → score 9.9. 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 48 TodoComment finding(s) in Explicit Debt — start with mod.rs (5), terminfo.rs (4), pane.rs (4). — One of this dimension's main actionable groups (48 warning-level).
Resolve the 30 FixmeComment finding(s) in Explicit Debt — start with lib.rs (4), commands.rs (4), window.rs (3). — One of this dimension's main actionable groups (30 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. 23 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.
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).
40 finding(s): 0 critical, 39 high, 1 medium, 0 low. semgrep hit a parse error in 141 file(s) — `assets/shell-integration/kaku.sh` (lines 54–55, line 60, line 62, …), `assets/shell-integration/setup_zsh.sh` (line 1039, lines 2017–2512), `crates/kaku-remote/assets/web/xterm-webgl.js` (line 1), `crates/kaku-remote/assets/web/xterm.js`, `deps/cairo/cairo/src/cairo-analysis-surface-private.h`, … (+136 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 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
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 25 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (12), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (25 issue-level).
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED, REDACTED. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 4 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 4 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 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.
142 of 330 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/bidi/src/bidi_class.rs. Counted over 330 of the 432 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 118 Orphaned file finding(s) in Knowledge Freshness — start with lib.rs (21), mod.rs (7), error.rs (4). — One of this dimension's main actionable groups (118 recommendation-level).
Resolve the 24 Orphaned knowledge finding(s) in Knowledge Freshness — start with lib.rs (4), domain.rs (2), bidi_class.rs. — One of this dimension's main actionable groups (24 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
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.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 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.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels5.3 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — crates/kaku-remote/assets/web/index.html:224
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.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — crates/kaku-remote/assets/web/index.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
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.
`#bar .dot.in` moves (`animation: dot-in 0.25s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/kaku-remote/assets/web/index.html:56
`#bar .dot.out` moves (`animation: dot-out 0.3s ease-in 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/kaku-remote/assets/web/index.html:57
`#bar .tab 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/kaku-remote/assets/web/index.html:70
`#find 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/kaku-remote/assets/web/index.html:122
`#dialog` 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/kaku-remote/assets/web/index.html:169
`#dialog button:focus-visible` 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/kaku-remote/assets/web/index.html:176
`.xterm.focus` 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/kaku-remote/assets/web/xterm.css:48
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no 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 2 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 · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model7.9 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`DecodedPdu` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — crates/codec/src/lib.rs:287
What to do
Move the domain logic onto the entity (invariant-enforcing `&mut self` commands) instead of a foreign service.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 63 of 68 project(s) that lack one — worth up to 1.9 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.
term/README.md links to `terminal/struct.Terminal.html`, but `term/terminal/struct.Terminal.html` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — term/README.md:18
What to do
Reconcile the README with reality: term/README.md links to `terminal/struct.Terminal.html`, but `term/terminal/struct.Terminal.html` does not exist.
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.
377/529 types (71%) 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.9 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 25/26 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/wezterm-char-props/codegen`.
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
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
What to do
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
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::blocking::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/wezterm-char-props/codegen/src/main.rs:22
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.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
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.mkdtempSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — crates/kaku-remote/tests/feel.cjs:93, crates/kaku-remote/tests/live.cjs:33, crates/kaku-remote/tests/static_page.cjs:63
`execFileSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — crates/kaku-remote/tests/feel.cjs:108, crates/kaku-remote/tests/feel.cjs:123, crates/kaku-remote/tests/static_page.cjs:73
`fs.mkdirSync` in `anonymous function` 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. (×8) — crates/kaku-remote/tests/feel.cjs:115, crates/kaku-remote/tests/feel.cjs:116, crates/kaku-remote/tests/live.cjs:42, …
`fs.writeFileSync` in `anonymous function` 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. (×6) — crates/kaku-remote/tests/feel.cjs:118, crates/kaku-remote/tests/live.cjs:45, crates/kaku-remote/tests/live.cjs:151, …
`fs.existsSync` in `callback to until` 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. (×5) — crates/kaku-remote/tests/feel.cjs:122, crates/kaku-remote/tests/live.cjs:53, crates/kaku-remote/tests/live.cjs:235, …
`fs.rmSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — crates/kaku-remote/tests/feel.cjs:400, crates/kaku-remote/tests/live.cjs:491, crates/kaku-remote/tests/static_page.cjs:155
`fs.readFileSync` in `anonymous function` 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. (×5) — crates/kaku-remote/tests/live.cjs:54, crates/kaku-remote/tests/live.cjs:236, crates/kaku-remote/tests/live.cjs:325, …
`fs.readFileSync` in `callback to until` 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. — crates/kaku-remote/tests/live.cjs:244
`fs.readdirSync` in `anonymous function` 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. — crates/kaku-remote/tests/live.cjs:346
`crypto.hkdfSync` in `derive` 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. — crates/kaku-remote/tests/live.cjs:408
`crypto.generateKeyPairSync` in `anonymous function` 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. — crates/kaku-remote/tests/live.cjs:419
`execFileSync` in `cli` 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. — crates/kaku-remote/tests/static_page.cjs:87
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.
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/kaku-remote/src/lib.rs:709)), 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.
Set: Referrer-Policy. Missing: Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−2.0 on this card.) The server: `axum::serve(` (crates/kaku-remote/src/lib.rs:709).
No handler of this repository's Rust server answers 400, 413 or 422 (`StatusCode::BAD_REQUEST`, `HttpResponse::BadRequest()`, `Status::BadRequest`, tonic `Status::invalid_argument`), and nothing declares validation — no `validator`/`garde` derive, no body limit (`DefaultBodyLimit::max`, `RequestBodyLimitLayer`, `JsonConfig::default().limit(…)`, Rocket `Limits`) — nothing shows inbound requests being checked, and refused, before a handler acts on them. A check that answers its failure with 200 and an error body is not seen. (−2.0 on this card.) The server: `axum::serve(` (crates/kaku-remote/src/lib.rs:709).
What to do
Add Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options beside the headers the Rust server already sets.
Validate what the server reads from a request — path, query, headers, body size and shape — and answer what fails with 400 (413 for an oversized body) before a handler acts on it: derive `validator::Validate` (or `garde::Validate`) on the request types and reject with `StatusCode::BAD_REQUEST`, and cap bodies with `DefaultBodyLimit::max`/`RequestBodyLimitLayer` or actix's `JsonConfig::default().limit(…)`.
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 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. (×5) — crates/kaku-remote/assets/web/desktop.js:211, crates/kaku-remote/assets/web/desktop.js:317, crates/kaku-remote/assets/web/desktop.js:460, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×4) — crates/kaku-remote/assets/web/desktop.js:500, crates/kaku-remote/assets/web/desktop.js:512, crates/kaku-remote/assets/web/desktop.js:560, …
`.then(…, () => {})` 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. — crates/kaku-remote/assets/web/desktop.js:1167
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 767 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/kaku-relay/src/main.rs:767
`info!` at line 858 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/kaku-relay/src/main.rs:858
`info!` at line 863 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/kaku-relay/src/main.rs:863
`info!` at line 1028 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/kaku-relay/src/main.rs:1028
`warn!` at line 1264 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/kaku-relay/src/main.rs:1264
`warn!` at line 1272 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/kaku-relay/src/main.rs:1272
`info!` at line 1301 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/kaku-relay/src/main.rs:1301
`info!` at line 1320 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/kaku-relay/src/main.rs:1320
`info!` at line 1333 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/kaku-relay/src/main.rs:1333
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 17 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 — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'rusqlite' (kaku/src/ai_config/tui/providers/mod.rs:183) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'rusqlite' (kaku/src/ai_config/tui/providers/mod.rs:183) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'rusqlite' (kaku/src/ai_config/tui/providers/mod.rs:183) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 41 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — Not applicable: 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 — docker build failed (exit 1) — 2 | # carry the web terminal's page and fonts from crates/kaku-remote. 3 | >>> FROM rust:1.95-slim AS builder 4 | WORKDIR /app 5 | -------------------- ERROR: failed to solve: rust:1.95-slim: failed to resolve source metadata for docker.io/library/rust:1.95-slim: failed to do request: Head "https://registry-1.docker.io/v2/library/rust/manifests/1.95-slim": 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 — Not assessed: this repository stores data through 'rusqlite' (kaku/src/ai_config/tui/providers/mod.rs:183) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
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, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed 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. Aggregate roots were found in only one source directory (mux), which is a layered codebase, not two contexts. 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) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
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
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.
X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
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.
Orphaned knowledge crates/bidi/src/bidi_class.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/bidi/src/lib.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge crates/wezterm-surface/src/lib.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge termwiz/src/input.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge termwiz/src/render/terminfo.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge crates/wezterm-ssh/src/sessioninner.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-char-props/src/widechar_width.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge mux/src/ssh.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/vtparse/src/lib.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge crates/wezterm-escape-parser/src/tmux_cc/mod.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge crates/wezterm-client/src/domain.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-escape-parser/src/apc.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge term/src/terminalstate/kitty.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-font/src/hbwrap.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-font/src/rasterizer/freetype.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-font/src/parser.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-client/src/pane/renderable.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge termwiz/src/widgets/layout.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge mux/src/pane_encoding.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge mux/src/domain.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/wezterm-client/src/pane/clientpane.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/bintree/src/lib.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge kaku-gui/src/termwindow/background.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge kaku-gui/src/shapecache.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label crates/kaku-remote/assets/web/index.html:224— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
DM4 · Rich vs anemic domain model· Anemic domain model · ×1
Anemic domain model: DecodedPdu crates/codec/src/lib.rs:287— `DecodedPdu` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
MethodTooLong: BlockKey.from_char kaku-gui/src/customglyph.rs:722— MethodTooLong — from_char runs 2925 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 2825 over it, 29.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: GlyphCache.block_sprite kaku-gui/src/customglyph.rs:5175— MethodTooLong — block_sprite runs 612 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 512 over it, 6.12× 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: SessionHandler.process_one crates/wezterm-mux-server-impl/src/sessionhandler.rs:246— MethodTooLong — process_one runs 551 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 451 over it, 5.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: TermWindow.perform_key_assignment kaku-gui/src/termwindow/mod.rs:4752— MethodTooLong — perform_key_assignment 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.
MethodTooLong: TermWindow.render_screen_line kaku-gui/src/termwindow/render/screen_line.rs:108— MethodTooLong — render_screen_line runs 459 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 359 over it, 4.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: TermWindow.mouse_event_terminal kaku-gui/src/termwindow/mouseevent.rs:1867— MethodTooLong — mouse_event_terminal runs 437 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 337 over it, 4.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: TermWindow.paint_pane kaku-gui/src/termwindow/render/pane.rs:152— MethodTooLong — paint_pane runs 427 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 327 over it, 4.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TerminalState.perform_csi_mode term/src/terminalstate/mod.rs:1675— MethodTooLong — perform_csi_mode runs 372 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 272 over it, 3.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TermWindow.new_window kaku-gui/src/termwindow/mod.rs:1591— MethodTooLong — new_window runs 341 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 241 over it, 3.41× 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: TermWindow.build_fancy_tab_bar kaku-gui/src/termwindow/render/fancy_tab_bar.rs:58— MethodTooLong — build_fancy_tab_bar runs 320 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 220 over it, 3.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: TermWindow.mouse_event_impl kaku-gui/src/termwindow/mouseevent.rs:863— MethodTooLong — mouse_event_impl runs 281 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 181 over it, 2.81× 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: Performer.osc_dispatch term/src/terminalstate/performer.rs:852— MethodTooLong — osc_dispatch runs 278 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 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CommandDef.recreate_menubar kaku-gui/src/commands.rs:665— MethodTooLong — recreate_menubar runs 272 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 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TermWindow.dispatch_notif kaku-gui/src/termwindow/mod.rs:2404— MethodTooLong — dispatch_notif runs 272 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 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TabBarState.new kaku-gui/src/tabbar.rs:1004— MethodTooLong — new runs 267 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 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TerminfoRenderer.render_to termwiz/src/render/terminfo.rs:337— MethodTooLong — render_to runs 256 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 156 over it, 2.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.
MethodTooLong: WindowView.key_common window/src/os/macos/window.rs:8708— MethodTooLong — key_common runs 256 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 156 over it, 2.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.
MethodTooLong: TermWindow.paint_pass kaku-gui/src/termwindow/render/paint.rs:261— MethodTooLong — paint_pass runs 245 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 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MuxPane.add_methods lua-api-crates/mux/src/pane.rs:88— MethodTooLong — add_methods runs 241 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 141 over it, 2.41× 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: WindowView.define_class window/src/os/macos/window.rs:9990— MethodTooLong — define_class 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: GuiWin.add_methods kaku-gui/src/scripting/guiwin.rs:35— MethodTooLong — add_methods runs 237 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 137 over it, 2.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: TermWindow.compute_element kaku-gui/src/termwindow/box_model.rs:542— MethodTooLong — compute_element runs 236 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 136 over it, 2.36× 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: InputMap.new kaku-gui/src/inputmap.rs:26— MethodTooLong — new runs 229 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 129 over it, 2.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: KeyEvent.encode_kitty crates/wezterm-input-types/src/lib.rs:1660— MethodTooLong — encode_kitty runs 217 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 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WebGpuState.new_impl kaku-gui/src/termwindow/webgpu.rs:225— MethodTooLong — new_impl runs 212 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 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: macos/window.rs window/src/os/macos/window.rs— FileTooLong — 4770 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 116 free functions. The bar is 500 significant lines; this is 4270 over it, 9.54× 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: termwindow/mod.rs kaku-gui/src/termwindow/mod.rs— FileTooLong — 4573 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: TermWindow (5 blocks, 1043-6872). The bar is 500 significant lines; this is 4073 over it, 9.15× 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/customglyph.rs kaku-gui/src/customglyph.rs— FileTooLong — 3914 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: BlockKey (2 blocks, 218-5033). The bar is 500 significant lines; this is 3414 over it, 7.83× 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: ai_config/tui.rs kaku/src/ai_config/tui.rs— FileTooLong — 2267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 70 free functions. The bar is 500 significant lines; this is 1767 over it, 4.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/bidi_class.rs crates/bidi/src/bidi_class.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/web.rs crates/kaku-remote/src/web.rs— FileTooLong — 2204 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 75 free functions. The bar is 500 significant lines; this is 1704 over it, 4.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/commands.rs kaku-gui/src/commands.rs— FileTooLong — 2080 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 1580 over it, 4.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/csi.rs crates/wezterm-escape-parser/src/csi.rs— FileTooLong — 1932 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 1432 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: terminalstate/mod.rs term/src/terminalstate/mod.rs— FileTooLong — 1845 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: TerminalState (2 blocks, 302-2987). The bar is 500 significant lines; this is 1345 over it, 3.69× 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/config.rs config/src/config.rs— FileTooLong — 1753 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: Config (3 blocks, 52-2169), declaring 87 free functions. The bar is 500 significant lines; this is 1253 over it, 3.51× 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: ai_chat/state.rs kaku-gui/src/overlay/ai_chat/state.rs— FileTooLong — 1741 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 72% of them inside a single declaration: App (2 blocks, 704-2528). The bar is 500 significant lines; this is 1241 over it, 3.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/lib.rs crates/wezterm-input-types/src/lib.rs— FileTooLong — 1702 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 1202 over it, 3.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/tab.rs mux/src/tab.rs— FileTooLong — 1667 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 62% of them inside a single declaration: TabInner (2 blocks, 93-2565). The bar is 500 significant lines; this is 1167 over it, 3.33× 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: termwindow/mouseevent.rs kaku-gui/src/termwindow/mouseevent.rs— FileTooLong — 1639 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: TermWindow (477-2534). The bar is 500 significant lines; this is 1139 over it, 3.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: providers/mod.rs kaku/src/ai_config/tui/providers/mod.rs— FileTooLong — 1576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 101 free functions. The bar is 500 significant lines; this is 1076 over it, 3.15× 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: overlay/copy.rs kaku-gui/src/overlay/copy.rs— FileTooLong — 1424 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 924 over it, 2.85× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs mux/src/lib.rs— FileTooLong — 1271 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 771 over it, 2.54× 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/osc.rs crates/wezterm-escape-parser/src/osc.rs— FileTooLong — 1116 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 616 over it, 2.23× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: config_tui/mod.rs kaku/src/config_tui/mod.rs— FileTooLong — 1092 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: App (2 blocks, 361-1611). The bar is 500 significant lines; this is 592 over it, 2.18× 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: macos/app.rs window/src/os/macos/app.rs— FileTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 572 over it, 2.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs crates/bidi/src/lib.rs— FileTooLong — 1049 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: BidiContext (2 blocks, 75-1729). The bar is 500 significant lines; this is 549 over it, 2.10× 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/ftwrap.rs crates/wezterm-font/src/ftwrap.rs— FileTooLong — 1026 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: Face (3 blocks, 98-1155). The bar is 500 significant lines; this is 526 over it, 2.05× 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/doctor.rs kaku/src/doctor.rs— FileTooLong — 1024 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 524 over it, 2.05× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/tabbar.rs kaku-gui/src/tabbar.rs— FileTooLong — 1015 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 515 over it, 2.03× 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/frontend.rs kaku-gui/src/frontend.rs— FileTooLong — 994 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 494 over it, 1.99× 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.
kaku_gui::cli_chat::run_repl (cognitive 116) kaku-gui/src/cli_chat/mod.rs:545— kaku_gui::cli_chat::run_repl has cognitive complexity 116 (threshold 15). Drivers by points: if/else 28 (79 pts), match/switch 6 (25 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 76). 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.
kaku_gui::overlay::ai_chat::input::handle_key (cognitive 76) kaku-gui/src/overlay/ai_chat/input.rs:10— kaku_gui::overlay::ai_chat::input::handle_key has cognitive complexity 76 (threshold 15). Drivers by points: if/else 32 (63 pts), match/switch 3 (6 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::ai_tools::search::fallback_regex_search (cognitive 75) kaku-gui/src/ai_tools/search.rs:269— kaku_gui::ai_tools::search::fallback_regex_search has cognitive complexity 75 (threshold 15). Drivers by points: if/else 25 (63 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::ai_chat_engine::run_agent (cognitive 74) kaku-gui/src/ai_chat_engine/mod.rs:387— kaku_gui::ai_chat_engine::run_agent has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (57 pts), match/switch 4 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::update::update_checker (cognitive 68) kaku-gui/src/update.rs:555— kaku_gui::update::update_checker has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (52 pts), match/switch 3 (12 pts), boolean chains 3, loops 1 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
kaku_gui::ai_client::responses::parse_responses_sse (cognitive 66) kaku-gui/src/ai_client/responses.rs:205— kaku_gui::ai_client::responses::parse_responses_sse has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (61 pts), loops 2 (3 pts), match/switch 1 (2 pts) (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.
kaku_gui::commands::derive_command_from_key_assignment (cognitive 61) kaku-gui/src/commands.rs:1106— kaku_gui::commands::derive_command_from_key_assignment has cognitive complexity 61 (threshold 15). Drivers by points: if/else 35 (50 pts), match/switch 4 (8 pts), loops 1 (2 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.
kaku_gui::overlay::ai_chat::input::handle_mouse (cognitive 58) kaku-gui/src/overlay/ai_chat/input.rs:424— kaku_gui::overlay::ai_chat::input::handle_mouse has cognitive complexity 58 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 7, match/switch 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
kaku_gui::overlay::ai_chat::markdown::wrap_segments (cognitive 58) kaku-gui/src/overlay/ai_chat/markdown.rs:451— kaku_gui::overlay::ai_chat::markdown::wrap_segments has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (42 pts), loops 4 (7 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 33). 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.
kaku_gui::overlay::ai_chat::markdown::parse_markdown_blocks (cognitive 52) kaku-gui/src/overlay/ai_chat/markdown.rs:17— kaku_gui::overlay::ai_chat::markdown::parse_markdown_blocks has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
kaku_gui::ai_tools::project::exec_project_summary (cognitive 50) kaku-gui/src/ai_tools/project.rs:6— kaku_gui::ai_tools::project::exec_project_summary has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 4 (7 pts), boolean chains 5 (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.
kaku_gui::ai_tools::search::exec_grep_search (cognitive 50) kaku-gui/src/ai_tools/search.rs:734— kaku_gui::ai_tools::search::exec_grep_search has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (43 pts), match/switch 2 (4 pts), loops 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::overlay::ai_chat::render::render_chat (cognitive 49) kaku-gui/src/overlay/ai_chat/render.rs:463— kaku_gui::overlay::ai_chat::render::render_chat has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (38 pts), boolean chains 5, loops 3, match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::remote_tabs::perform (cognitive 48) kaku-gui/src/remote_tabs.rs:21— kaku_gui::remote_tabs::perform has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (44 pts), match/switch 3 (4 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.
kaku_gui::overlay::ai_chat::state::emit_assistant_markdown (cognitive 42) kaku-gui/src/overlay/ai_chat/state.rs:476— kaku_gui::overlay::ai_chat::state::emit_assistant_markdown has cognitive complexity 42 (threshold 15). Drivers by points: loops 8 (23 pts), match/switch 4 (13 pts), if/else 2 (5 pts), boolean chains 1 (nesting depth added 27). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
kaku_gui::termwindow::wrapped_link::rejoined_links (cognitive 42) kaku-gui/src/termwindow/wrapped_link.rs:96— kaku_gui::termwindow::wrapped_link::rejoined_links has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 10, loops 7 (10 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.
kaku_gui::overlay::ai_chat::ai_chat_overlay (cognitive 41) kaku-gui/src/overlay/ai_chat/mod.rs:82— kaku_gui::overlay::ai_chat::ai_chat_overlay has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 4 (9 pts), boolean chains 5, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::ai_client::responses::emit_response_output (cognitive 40) kaku-gui/src/ai_client/responses.rs:442— kaku_gui::ai_client::responses::emit_response_output has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 3 (12 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::ai_chat_engine::approval::curl_is_dangerous (cognitive 33) kaku-gui/src/ai_chat_engine/approval.rs:372— kaku_gui::ai_chat_engine::approval::curl_is_dangerous has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (7 pts), boolean chains 6, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::overlay::confirm::run_confirmation_impl (cognitive 33) kaku-gui/src/overlay/confirm.rs:43— kaku_gui::overlay::confirm::run_confirmation_impl has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::ai_chat_engine::approval::split_shell_segments (cognitive 32) kaku-gui/src/ai_chat_engine/approval.rs:117— kaku_gui::ai_chat_engine::approval::split_shell_segments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 8, 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.
kaku_gui::ai_tools::search::exec_symbol_search (cognitive 31) kaku-gui/src/ai_tools/search.rs:557— kaku_gui::ai_tools::search::exec_symbol_search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 2 (3 pts), loops 2 (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.
kaku_gui::ai_client::responses::translate_responses_messages (cognitive 30) kaku-gui/src/ai_client/responses.rs:18— kaku_gui::ai_client::responses::translate_responses_messages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (5 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.
kaku_gui::ai_tools::shell::exec_shell_exec (cognitive 29) kaku-gui/src/ai_tools/shell.rs:98— kaku_gui::ai_tools::shell::exec_shell_exec has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_gui::async_run_terminal_gui (cognitive 28) kaku-gui/src/main.rs:350— kaku_gui::async_run_terminal_gui has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 3 (5 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.
TodoComment termwiz/src/input.rs:273— // TODO: also respect self.application_keypad — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment termwiz/src/widgets/mod.rs:453— // TODO: garbage collect unreachable WidgetId's from self.state — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment termwiz/src/render/terminfo.rs:547— // TODO: this isn't spec'd by terminfo, but some terminals — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment termwiz/src/render/terminfo.rs:602— // TODO: slice out the requested region of the image, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment termwiz/src/render/terminfo.rs:624— // TODO: } else if self.caps.sixel() { — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment termwiz/src/render/terminfo.rs:1083— // TODO: could we use ECMA-48 REP for this?
TodoComment termwiz/src/lineedit/mod.rs:580— // TODO: there's no way we can match anything. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment termwiz/src/lineedit/mod.rs:635— // TODO: there's no way we can match anything. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment term/src/test/c0.rs:13— // TODO: when we can set the left margin, we should test that here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment term/src/test/c0.rs:36— // TODO: when we can set the left margin, we should test that here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment term/src/terminalstate/kitty.rs:47— // TODO: make this configurable via TerminalConfiguration — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment term/src/terminalstate/kitty.rs:769— // TODO: send an EINVAL error back here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment term/src/terminalstate/mod.rs:186— // TODO: selective_erase when supported — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment term/src/terminalstate/mod.rs:1489— // TODO: see https://vt100.net/docs/vt510-rm/DECSTR.html
TodoComment mux/src/lib.rs:1597— // TODO: disambiguate with TabId — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment mux/src/lib.rs:1674— // TODO: disambiguate with TabId — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment mux/src/localpane.rs:1019— // TODO: do we need to proactively list available tabs here? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment mux/src/ssh.rs:574— // TODO: TerminalWaker assumes that we're a SystemTerminal but that — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment mux/src/termwiztermtab.rs:481— // TODO: TerminalWaker assumes that we're a SystemTerminal but that — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment mux/src/termwiztermtab.rs:570— // TODO: make a singleton — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment kaku-gui/src/termwindow/keyevent.rs:1269— // TODO: consider eliminating these codes from termwiz::input::KeyCode — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment kaku-gui/src/termwindow/render/pane.rs:379— // TODO: we only have a single scrollbar in a single position. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment kaku-gui/src/termwindow/render/pane.rs:766— // TODO: render a thingy to jump to prior prompt — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment kaku-gui/src/termwindow/render/pane.rs:861— // TODO: visual bell background layer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment kaku-gui/src/termwindow/render/pane.rs:862— // TODO: scrollbar — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FunctionTooLong: kaku_gui::commands::derive_command_from_key_assignment kaku-gui/src/commands.rs:1106— FunctionTooLong — kaku_gui::commands::derive_command_from_key_assignment runs 1274 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 1174 over it, 12.74× 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: kaku_remote::web::run_session crates/kaku-remote/src/web.rs:2785— FunctionTooLong — kaku_remote::web::run_session runs 343 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 243 over it, 3.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: kaku_gui::ai_tools::registry::all_tools kaku-gui/src/ai_tools/registry.rs:15— FunctionTooLong — kaku_gui::ai_tools::registry::all_tools runs 308 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 208 over it, 3.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.
FunctionTooLong: wezterm_escape_parser::tmux_cc::parse_line crates/wezterm-escape-parser/src/tmux_cc/mod.rs:219— FunctionTooLong — wezterm_escape_parser::tmux_cc::parse_line runs 259 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 159 over it, 2.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: kaku_gui::overlay::ai_chat::input::handle_key kaku-gui/src/overlay/ai_chat/input.rs:10— FunctionTooLong — kaku_gui::overlay::ai_chat::input::handle_key runs 249 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 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku_gui::cli_chat::run_repl kaku-gui/src/cli_chat/mod.rs:545— FunctionTooLong — kaku_gui::cli_chat::run_repl runs 224 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 124 over it, 2.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.
FunctionTooLong: kaku_gui::ai_chat_engine::run_agent kaku-gui/src/ai_chat_engine/mod.rs:387— FunctionTooLong — kaku_gui::ai_chat_engine::run_agent runs 223 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 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: kaku_gui::overlay::copy::copy_key_table kaku-gui/src/overlay/copy.rs:1832— FunctionTooLong — kaku_gui::overlay::copy::copy_key_table runs 198 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 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku_gui::overlay::ai_chat::render::render_chat kaku-gui/src/overlay/ai_chat/render.rs:463— FunctionTooLong — kaku_gui::overlay::ai_chat::render::render_chat runs 193 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 93 over it, 1.93× 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: mux::ssh::connect_ssh_session mux/src/ssh.rs:430— FunctionTooLong — mux::ssh::connect_ssh_session runs 177 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 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: wezterm_font::rasterizer::harfbuzz::record_to_cairo_surface crates/wezterm-font/src/rasterizer/harfbuzz.rs:104— FunctionTooLong — wezterm_font::rasterizer::harfbuzz::record_to_cairo_surface runs 165 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 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku_remote::web::handle_input crates/kaku-remote/src/web.rs:2484— FunctionTooLong — kaku_remote::web::handle_input runs 164 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 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku::ai_config::tui::save_field kaku/src/ai_config/tui.rs:2757— FunctionTooLong — kaku::ai_config::tui::save_field 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.
FunctionTooLong: kaku::ai_config::tui::providers::assistant::save_kaku_assistant_field_to_path kaku/src/ai_config/tui/providers/assistant.rs:438— FunctionTooLong — kaku::ai_config::tui::providers::assistant::save_kaku_assistant_field_to_path 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.
FunctionTooLong: kaku_gui::ai_tools::search::exec_grep_search kaku-gui/src/ai_tools/search.rs:734— FunctionTooLong — kaku_gui::ai_tools::search::exec_grep_search runs 154 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 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku_gui::ai_client::responses::parse_responses_sse kaku-gui/src/ai_client/responses.rs:205— FunctionTooLong — kaku_gui::ai_client::responses::parse_responses_sse runs 153 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 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: config::lua::make_lua_context config/src/lua.rs:247— FunctionTooLong — config::lua::make_lua_context 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.
FunctionTooLong: kaku_gui::overlay::confirm::run_confirmation_impl kaku-gui/src/overlay/confirm.rs:43— FunctionTooLong — kaku_gui::overlay::confirm::run_confirmation_impl runs 150 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 50 over it, 1.50× 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: kaku::doctor::build_shell_integration_group kaku/src/doctor.rs:448— FunctionTooLong — kaku::doctor::build_shell_integration_group runs 138 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 38 over it, 1.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: wezterm_font::rasterizer::colr::apply_sweep_gradient_patches crates/wezterm-font/src/rasterizer/colr.rs:298— FunctionTooLong — wezterm_font::rasterizer::colr::apply_sweep_gradient_patches runs 134 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 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku_gui::overlay::ai_chat::ai_chat_overlay kaku-gui/src/overlay/ai_chat/mod.rs:82— FunctionTooLong — kaku_gui::overlay::ai_chat::ai_chat_overlay runs 133 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 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku_gui::ai_tools::search::exec_symbol_search kaku-gui/src/ai_tools/search.rs:557— FunctionTooLong — kaku_gui::ai_tools::search::exec_symbol_search runs 131 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 31 over it, 1.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: wezterm_dynamic_derive::fromdynamic::derive_enum crates/wezterm-dynamic/derive/src/fromdynamic.rs:139— FunctionTooLong — wezterm_dynamic_derive::fromdynamic::derive_enum runs 129 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 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kaku::update::imp::run kaku/src/update.rs:80— FunctionTooLong — kaku::update::imp::run runs 129 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 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: wezterm_mux_server_impl::dispatch::process_async crates/wezterm-mux-server-impl/src/dispatch.rs:37— FunctionTooLong — wezterm_mux_server_impl::dispatch::process_async runs 127 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 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: kaku-gui/src/termwindow/mod.rs kaku-gui/src/termwindow/mod.rs:4752— kaku-gui/src/termwindow/mod.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 174 in TermWindow::perform_key_assignment at line 4752. 29 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/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/kaku-remote/src/web.rs crates/kaku-remote/src/web.rs:2785— crates/kaku-remote/src/web.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in kaku_remote::web::run_session at line 2785. 17 of those changes were fix/bug commits, and the other 39 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/kaku-remote/src/web.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/kaku-remote/assets/web/index.html crates/kaku-remote/assets/web/index.html:3516— crates/kaku-remote/assets/web/index.html changed 97 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in index.html.connect at line 3516. 42 of those changes were fix/bug commits, and the other 55 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/kaku-remote/assets/web/index.html`: 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: kaku-gui/src/termwindow/mouseevent.rs kaku-gui/src/termwindow/mouseevent.rs:1867— kaku-gui/src/termwindow/mouseevent.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in TermWindow::mouse_event_terminal at line 1867. 20 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/mouseevent.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: kaku-gui/src/commands.rs kaku-gui/src/commands.rs:1106— kaku-gui/src/commands.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 166 in kaku_gui::commands::derive_command_from_key_assignment at line 1106. 7 of those changes were fix/bug commits, and the other 7 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/commands.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/kaku-remote/src/share.rs crates/kaku-remote/src/share.rs:819— crates/kaku-remote/src/share.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in kaku_remote::share::serve at line 819. 9 of those changes were fix/bug commits, and the other 13 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/kaku-remote/src/share.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/kaku-remote/assets/web/desktop.js crates/kaku-remote/assets/web/desktop.js:99— crates/kaku-remote/assets/web/desktop.js changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in desktop.init at line 99. 6 of those changes were fix/bug commits, and the other 13 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/kaku-remote/assets/web/desktop.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: window/src/os/macos/window.rs window/src/os/macos/window.rs:9419— window/src/os/macos/window.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in WindowView::did_resize at line 9419. 16 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- window/src/os/macos/window.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/kaku-relay/src/main.rs crates/kaku-relay/src/main.rs:1093— crates/kaku-relay/src/main.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in kaku_relay::serve_browser at line 1093. 14 of those changes were fix/bug commits, and the other 15 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/kaku-relay/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: kaku-gui/src/tabbar.rs kaku-gui/src/tabbar.rs:1004— kaku-gui/src/tabbar.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in TabBarState::new at line 1004. 7 of those changes were fix/bug commits, and the other 12 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/tabbar.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: kaku/src/main.rs kaku/src/main.rs:323— kaku/src/main.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in kaku::run_remote at line 323. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku/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: kaku-gui/src/overlay/ai_chat/state.rs kaku-gui/src/overlay/ai_chat/state.rs:1823— kaku-gui/src/overlay/ai_chat/state.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in App::drain_tokens at line 1823. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/overlay/ai_chat/state.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: kaku/src/ai_config/tui.rs kaku/src/ai_config/tui.rs:2757— kaku/src/ai_config/tui.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in kaku::ai_config::tui::save_field at line 2757. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku/src/ai_config/tui.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: term/src/terminalstate/performer.rs term/src/terminalstate/performer.rs:852— term/src/terminalstate/performer.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in Performer::osc_dispatch at line 852. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- term/src/terminalstate/performer.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: kaku-gui/src/frontend.rs kaku-gui/src/frontend.rs:647— kaku-gui/src/frontend.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in GuiFrontEnd::try_new at line 647. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/frontend.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: kaku-gui/src/termwindow/render/paint.rs kaku-gui/src/termwindow/render/paint.rs:261— kaku-gui/src/termwindow/render/paint.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in TermWindow::paint_pass at line 261. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/render/paint.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/wezterm-input-types/src/lib.rs crates/wezterm-input-types/src/lib.rs:1660— crates/wezterm-input-types/src/lib.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 111 in KeyEvent::encode_kitty at line 1660. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/wezterm-input-types/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.
Hotspot: kaku/src/config_tui/mod.rs kaku/src/config_tui/mod.rs:987— kaku/src/config_tui/mod.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in App::normalize_value at line 987. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku/src/config_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: kaku-gui/src/termwindow/render/pane.rs kaku-gui/src/termwindow/render/pane.rs:152— kaku-gui/src/termwindow/render/pane.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in TermWindow::paint_pane at line 152. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/render/pane.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: kaku-gui/src/ai_chat_engine/mod.rs kaku-gui/src/ai_chat_engine/mod.rs:387— kaku-gui/src/ai_chat_engine/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in kaku_gui::ai_chat_engine::run_agent at line 387. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/ai_chat_engine/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: kaku-gui/src/termwindow/resize.rs kaku-gui/src/termwindow/resize.rs:481— kaku-gui/src/termwindow/resize.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in TermWindow::apply_dimensions at line 481. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/resize.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: kaku-gui/src/remote_tabs.rs kaku-gui/src/remote_tabs.rs:21— kaku-gui/src/remote_tabs.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in kaku_gui::remote_tabs::perform at line 21. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/remote_tabs.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/kaku-remote/tests/live.cjs crates/kaku-remote/tests/live.cjs:32— crates/kaku-remote/tests/live.cjs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in (anonymous) at line 32. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/kaku-remote/tests/live.cjs`: 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: kaku-gui/src/main.rs kaku-gui/src/main.rs:350— kaku-gui/src/main.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in kaku_gui::async_run_terminal_gui at line 350. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/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: kaku-gui/src/termwindow/render/fancy_tab_bar.rs kaku-gui/src/termwindow/render/fancy_tab_bar.rs:58— kaku-gui/src/termwindow/render/fancy_tab_bar.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in TermWindow::build_fancy_tab_bar at line 58. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/render/fancy_tab_bar.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.
TermWindow::render_screen_line (cognitive 218) kaku-gui/src/termwindow/render/screen_line.rs:108— TermWindow::render_screen_line has cognitive complexity 218 (threshold 15). Drivers by points: if/else 75 (175 pts), loops 10 (26 pts), match/switch 5 (11 pts), boolean chains 6 (nesting depth added 122). Of this number, 194 points are the body's own statements and 24 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TermWindow::mouse_event_terminal (cognitive 187) kaku-gui/src/termwindow/mouseevent.rs:1867— TermWindow::mouse_event_terminal has cognitive complexity 187 (threshold 15). Drivers by points: if/else 60 (130 pts), boolean chains 21, match/switch 10 (19 pts), loops 5 (17 pts) (nesting depth added 91). 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.
TermWindow::mouse_event_impl (cognitive 156) kaku-gui/src/termwindow/mouseevent.rs:863— TermWindow::mouse_event_impl has cognitive complexity 156 (threshold 15). Drivers by points: if/else 61 (128 pts), match/switch 9 (17 pts), boolean chains 11 (nesting depth added 75). 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.
TermWindow::perform_key_assignment (cognitive 152) kaku-gui/src/termwindow/mod.rs:4752— TermWindow::perform_key_assignment has cognitive complexity 152 (threshold 15). Drivers by points: if/else 62 (110 pts), match/switch 21 (38 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::paint_pane (cognitive 103) kaku-gui/src/termwindow/render/pane.rs:152— TermWindow::paint_pane has cognitive complexity 103 (threshold 15). Drivers by points: if/else 54 (77 pts), boolean chains 15, match/switch 4 (10 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::paint_pass (cognitive 96) kaku-gui/src/termwindow/render/paint.rs:261— TermWindow::paint_pass has cognitive complexity 96 (threshold 15). Drivers by points: if/else 40 (76 pts), boolean chains 10, loops 4 (5 pts), match/switch 2 (5 pts) (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.
TermWindow::dispatch_notif (cognitive 76) kaku-gui/src/termwindow/mod.rs:2404— TermWindow::dispatch_notif has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (63 pts), match/switch 3 (6 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 43). 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.
TermWindow::mouse_event_tab_bar (cognitive 75) kaku-gui/src/termwindow/mouseevent.rs:1625— TermWindow::mouse_event_tab_bar has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (55 pts), match/switch 8 (18 pts), boolean chains 2 (nesting depth added 46). 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.
TermWindow::key_event_impl (cognitive 64) kaku-gui/src/termwindow/keyevent.rs:1061— TermWindow::key_event_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 7, match/switch 3 (5 pts), loops 1 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::selection_text (cognitive 57) kaku-gui/src/termwindow/selection.rs:90— TermWindow::selection_text has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (47 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 38). 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.
TermWindow::process_key (cognitive 52) kaku-gui/src/termwindow/keyevent.rs:371— TermWindow::process_key has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 8, match/switch 2 (4 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.
TermWindow::show_launcher_impl (cognitive 51) kaku-gui/src/termwindow/mod.rs:4440— TermWindow::show_launcher_impl has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (37 pts), match/switch 4 (7 pts), loops 2 (5 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.
TermWindow::apply_dimensions (cognitive 50) kaku-gui/src/termwindow/resize.rs:481— TermWindow::apply_dimensions has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 4 (11 pts), boolean chains 6 (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.
TermWindow::compute_element (cognitive 49) kaku-gui/src/termwindow/box_model.rs:542— TermWindow::compute_element has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 9 (18 pts), loops 4 (8 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::paint_impl (cognitive 42) kaku-gui/src/termwindow/render/paint.rs:57— TermWindow::paint_impl has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 4 (13 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::dispatch_window_event (cognitive 40) kaku-gui/src/termwindow/mod.rs:2046— TermWindow::dispatch_window_event has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (31 pts), match/switch 6 (9 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.
TermWindow::build_fancy_tab_bar (cognitive 39) kaku-gui/src/termwindow/render/fancy_tab_bar.rs:58— TermWindow::build_fancy_tab_bar has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (26 pts), match/switch 6 (9 pts), boolean chains 3, loops 1 (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.
TermWindow::compute_cell_fg_bg (cognitive 36) kaku-gui/src/termwindow/render/mod.rs:700— TermWindow::compute_cell_fg_bg has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::update_title_impl (cognitive 35) kaku-gui/src/termwindow/mod.rs:3793— TermWindow::update_title_impl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (28 pts), match/switch 5 (6 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.
TermWindow::build_line_element_shape (cognitive 35) kaku-gui/src/termwindow/render/screen_line.rs:817— TermWindow::build_line_element_shape has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::render_element (cognitive 33) kaku-gui/src/termwindow/box_model.rs:850— TermWindow::render_element has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 4 (7 pts), loops 2 (4 pts), boolean chains 1 (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.
TermWindow::new_window (cognitive 33) kaku-gui/src/termwindow/mod.rs:1591— TermWindow::new_window has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (19 pts), loops 3 (8 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TermWindow::selection_lines (cognitive 32) kaku-gui/src/termwindow/selection.rs:23— TermWindow::selection_lines has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (24 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TermWindow::subscribe_to_pane_updates (cognitive 31) kaku-gui/src/termwindow/mod.rs:3015— TermWindow::subscribe_to_pane_updates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermWindow::rejoin_wrapped_link (cognitive 30) kaku-gui/src/termwindow/mod.rs:5598— TermWindow::rejoin_wrapped_link has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, loops 2 (3 pts), 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.
Sync-over-async blocking crates/kaku-remote/tests/feel.cjs:93— `fs.mkdtempSync` in `anonymous function` 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 crates/kaku-remote/tests/feel.cjs:108— `execFileSync` in `anonymous function` 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 crates/kaku-remote/tests/feel.cjs:115— `fs.mkdirSync` in `anonymous function` 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 crates/kaku-remote/tests/feel.cjs:116— `fs.mkdirSync` in `anonymous function` 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 crates/kaku-remote/tests/feel.cjs:118— `fs.writeFileSync` in `anonymous function` 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 crates/kaku-remote/tests/feel.cjs:122— `fs.existsSync` in `callback to until` 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 crates/kaku-remote/tests/feel.cjs:123— `execFileSync` in `anonymous function` 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 crates/kaku-remote/tests/feel.cjs:400— `fs.rmSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:33— `fs.mkdtempSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:42— `fs.mkdirSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:43— `fs.mkdirSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:45— `fs.writeFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:53— `fs.existsSync` in `callback to until` 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 crates/kaku-remote/tests/live.cjs:54— `fs.readFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:151— `fs.writeFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:235— `fs.existsSync` in `callback to until` 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 crates/kaku-remote/tests/live.cjs:236— `fs.readFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:244— `fs.existsSync` in `callback to until` 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 crates/kaku-remote/tests/live.cjs:244— `fs.readFileSync` in `callback to until` 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 crates/kaku-remote/tests/live.cjs:246— `fs.writeFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:291— `fs.mkdirSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:302— `fs.writeFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:325— `fs.readFileSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:346— `fs.readdirSync` in `anonymous function` 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 crates/kaku-remote/tests/live.cjs:347— `fs.readFileSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
ClassTooLong: TermWindow kaku-gui/src/termwindow/mod.rs:1043— ClassTooLong — 3853 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 306 methods, 5 blocks, lines 1043-6872. The bar is 400 significant lines; this is 3453 over it, 9.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.
ClassTooLong: BlockKey kaku-gui/src/customglyph.rs:218— ClassTooLong — 2966 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 2 blocks, lines 218-5033. The bar is 400 significant lines; this is 2566 over it, 7.42× 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: WindowView window/src/os/macos/window.rs:4548— ClassTooLong — 1698 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 89 methods, 2 blocks, lines 4548-10342. The bar is 400 significant lines; this is 1298 over it, 4.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: TerminalState term/src/terminalstate/mod.rs:302— ClassTooLong — 1599 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 110 methods, 2 blocks, lines 302-2987. The bar is 400 significant lines; this is 1199 over it, 4.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.
ClassTooLong: App kaku-gui/src/overlay/ai_chat/state.rs:704— ClassTooLong — 1249 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 2 blocks, lines 704-2528. The bar is 400 significant lines; this is 849 over it, 3.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: Config config/src/config.rs:52— ClassTooLong — 1148 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 3 blocks, lines 52-2169. The bar is 400 significant lines; this is 748 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TabInner mux/src/tab.rs:93— ClassTooLong — 1037 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 2 blocks, lines 93-2565. The bar is 400 significant lines; this is 637 over it, 2.59× 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: WindowInner window/src/os/macos/window.rs:524— ClassTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 3 blocks, lines 524-3794. The bar is 400 significant lines; this is 462 over it, 2.16× 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 kaku/src/config_tui/mod.rs:361— ClassTooLong — 848 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 2 blocks, lines 361-1611. The bar is 400 significant lines; this is 448 over it, 2.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: Performer term/src/terminalstate/performer.rs:36— ClassTooLong — 796 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 5 blocks, lines 36-1310. The bar is 400 significant lines; this is 396 over it, 1.99× 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: TabRenameModal kaku-gui/src/termwindow/tab_rename.rs:30— ClassTooLong — 791 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 3 blocks, lines 30-1136. The bar is 400 significant lines; this is 391 over it, 1.98× 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: BidiContext crates/bidi/src/lib.rs:75— ClassTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 2 blocks, lines 75-1729. The bar is 400 significant lines; this is 361 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CSIParser crates/wezterm-escape-parser/src/csi.rs:1702— ClassTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 3 blocks, lines 1702-2989. The bar is 400 significant lines; this is 350 over it, 1.88× 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: CommandPalette kaku-gui/src/termwindow/palette.rs:71— ClassTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 3 blocks, lines 71-1257. The bar is 400 significant lines; this is 314 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: Mux mux/src/lib.rs:151— ClassTooLong — 702 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 2 blocks, lines 151-1908. The bar is 400 significant lines; this is 302 over it, 1.76× 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: SessionInner crates/wezterm-ssh/src/sessioninner.rs:41— ClassTooLong — 694 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 3 blocks, lines 41-1045. The bar is 400 significant lines; this is 294 over it, 1.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Line crates/wezterm-surface/src/line/line.rs:46— ClassTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 70 methods, 5 blocks, lines 46-1257. The bar is 400 significant lines; this is 282 over it, 1.71× 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: Face crates/wezterm-font/src/ftwrap.rs:98— ClassTooLong — 678 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 3 blocks, lines 98-1155. The bar is 400 significant lines; this is 278 over it, 1.70× 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: Screen term/src/screen.rs:15— ClassTooLong — 655 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 2 blocks, lines 15-1217. The bar is 400 significant lines; this is 255 over it, 1.64× 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: CopyRenderable kaku-gui/src/overlay/copy.rs:63— ClassTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 56 methods, 2 blocks, lines 63-1192. The bar is 400 significant lines; this is 252 over it, 1.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.
ClassTooLong: CommandDef kaku-gui/src/commands.rs:58— ClassTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 3 blocks, lines 58-1063. The bar is 400 significant lines; this is 251 over it, 1.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.
ClassTooLong: LocalPane mux/src/localpane.rs:132— ClassTooLong — 623 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 4 blocks, lines 132-1295. The bar is 400 significant lines; this is 223 over it, 1.56× 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: SessionHandler crates/wezterm-mux-server-impl/src/sessionhandler.rs:198— ClassTooLong — 584 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, 3 blocks, lines 198-1021. The bar is 400 significant lines; this is 184 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GuiFrontEnd kaku-gui/src/frontend.rs:94— ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 3 blocks, lines 94-1506. The bar is 400 significant lines; this is 179 over it, 1.45× 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: GlyphCache kaku-gui/src/glyphcache.rs:560— 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), 14 methods, 4 blocks, lines 560-1403. 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.
TermWindow::perform_key_assignment (cyclomatic 174) kaku-gui/src/termwindow/mod.rs:4752— TermWindow::perform_key_assignment has cyclomatic complexity 174 (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.
TermWindow::mouse_event_terminal (cyclomatic 98) kaku-gui/src/termwindow/mouseevent.rs:1867— TermWindow::mouse_event_terminal has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::win_key_code_to_termwiz_key_code (cyclomatic 94) kaku-gui/src/termwindow/keyevent.rs:1264— TermWindow::win_key_code_to_termwiz_key_code has cyclomatic complexity 94 (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.
TermWindow::mouse_event_impl (cyclomatic 80) kaku-gui/src/termwindow/mouseevent.rs:863— TermWindow::mouse_event_impl has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::render_screen_line (cyclomatic 76) kaku-gui/src/termwindow/render/screen_line.rs:108— TermWindow::render_screen_line has cyclomatic complexity 76 (threshold 15). Of this number, 70 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::dispatch_notif (cyclomatic 64) kaku-gui/src/termwindow/mod.rs:2404— TermWindow::dispatch_notif has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::paint_pane (cyclomatic 54) kaku-gui/src/termwindow/render/pane.rs:152— TermWindow::paint_pane has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::paint_pass (cyclomatic 45) kaku-gui/src/termwindow/render/paint.rs:261— TermWindow::paint_pass has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::dispatch_window_event (cyclomatic 42) kaku-gui/src/termwindow/mod.rs:2046— TermWindow::dispatch_window_event has cyclomatic complexity 42 (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.
TermWindow::key_event_impl (cyclomatic 39) kaku-gui/src/termwindow/keyevent.rs:1061— TermWindow::key_event_impl has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TermWindow::mouse_event_tab_bar (cyclomatic 37) kaku-gui/src/termwindow/mouseevent.rs:1625— TermWindow::mouse_event_tab_bar 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.
TermWindow::build_fancy_tab_bar (cyclomatic 30) kaku-gui/src/termwindow/render/fancy_tab_bar.rs:58— TermWindow::build_fancy_tab_bar has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TermWindow::process_key (cyclomatic 29) kaku-gui/src/termwindow/keyevent.rs:371— TermWindow::process_key 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.
TermWindow::apply_dimensions (cyclomatic 27) kaku-gui/src/termwindow/resize.rs:481— TermWindow::apply_dimensions 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.
TermWindow::show_launcher_impl (cyclomatic 24) kaku-gui/src/termwindow/mod.rs:4440— TermWindow::show_launcher_impl 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.
TermWindow::render_background (cyclomatic 23) kaku-gui/src/termwindow/background.rs:428— TermWindow::render_background has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TermWindow::compute_element (cyclomatic 23) kaku-gui/src/termwindow/box_model.rs:542— TermWindow::compute_element 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.
TermWindow::new_window (cyclomatic 23) kaku-gui/src/termwindow/mod.rs:1591— TermWindow::new_window 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.
TermWindow::rejoin_wrapped_link (cyclomatic 23) kaku-gui/src/termwindow/mod.rs:5598— TermWindow::rejoin_wrapped_link 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.
TermWindow::compute_cell_fg_bg (cyclomatic 23) kaku-gui/src/termwindow/render/mod.rs:700— TermWindow::compute_cell_fg_bg 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.
TermWindow::paint_impl (cyclomatic 22) kaku-gui/src/termwindow/render/paint.rs:57— TermWindow::paint_impl 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.
TermWindow::update_title_impl (cyclomatic 21) kaku-gui/src/termwindow/mod.rs:3793— TermWindow::update_title_impl 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.
TermWindow::resize (cyclomatic 21) kaku-gui/src/termwindow/resize.rs:191— TermWindow::resize 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.
TermWindow::render_element_background (cyclomatic 20) kaku-gui/src/termwindow/box_model.rs:1036— TermWindow::render_element_background 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.
TermWindow::maybe_handle_native_line_editor_shortcut (cyclomatic 20) kaku-gui/src/termwindow/keyevent.rs:738— TermWindow::maybe_handle_native_line_editor_shortcut 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.
kaku_gui::commands::derive_command_from_key_assignment (cyclomatic 166) kaku-gui/src/commands.rs:1106— kaku_gui::commands::derive_command_from_key_assignment has cyclomatic complexity 166 (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.
kaku_gui::overlay::ai_chat::input::handle_key (cyclomatic 76) kaku-gui/src/overlay/ai_chat/input.rs:10— kaku_gui::overlay::ai_chat::input::handle_key has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kaku_gui::cli_chat::run_repl (cyclomatic 52) kaku-gui/src/cli_chat/mod.rs:545— kaku_gui::cli_chat::run_repl has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kaku_gui::ai_client::responses::parse_responses_sse (cyclomatic 35) kaku-gui/src/ai_client/responses.rs:205— kaku_gui::ai_client::responses::parse_responses_sse 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.
kaku_gui::remote_tabs::perform (cyclomatic 33) kaku-gui/src/remote_tabs.rs:21— kaku_gui::remote_tabs::perform 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.
kaku_gui::ai_chat_engine::run_agent (cyclomatic 32) kaku-gui/src/ai_chat_engine/mod.rs:387— kaku_gui::ai_chat_engine::run_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.
kaku_gui::overlay::ai_chat::input::handle_mouse (cyclomatic 32) kaku-gui/src/overlay/ai_chat/input.rs:424— kaku_gui::overlay::ai_chat::input::handle_mouse 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.
kaku_gui::ai_tools::search::fallback_regex_search (cyclomatic 31) kaku-gui/src/ai_tools/search.rs:269— kaku_gui::ai_tools::search::fallback_regex_search has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kaku_gui::ai_tools::execute (cyclomatic 30) kaku-gui/src/ai_tools/mod.rs:54— kaku_gui::ai_tools::execute has cyclomatic complexity 30 (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.
kaku_gui::ai_tools::project::exec_project_summary (cyclomatic 28) kaku-gui/src/ai_tools/project.rs:6— kaku_gui::ai_tools::project::exec_project_summary 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.
kaku_gui::ai_tools::search::exec_grep_search (cyclomatic 27) kaku-gui/src/ai_tools/search.rs:734— kaku_gui::ai_tools::search::exec_grep_search 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.
kaku_gui::overlay::ai_chat::markdown::wrap_segments (cyclomatic 27) kaku-gui/src/overlay/ai_chat/markdown.rs:451— kaku_gui::overlay::ai_chat::markdown::wrap_segments 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.
kaku_gui::overlay::ai_chat::render::render_chat (cyclomatic 27) kaku-gui/src/overlay/ai_chat/render.rs:463— kaku_gui::overlay::ai_chat::render::render_chat 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.
kaku_gui::ai_chat_engine::approval::split_shell_segments (cyclomatic 26) kaku-gui/src/ai_chat_engine/approval.rs:117— kaku_gui::ai_chat_engine::approval::split_shell_segments 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.
kaku_gui::overlay::ai_chat::ai_chat_overlay (cyclomatic 26) kaku-gui/src/overlay/ai_chat/mod.rs:82— kaku_gui::overlay::ai_chat::ai_chat_overlay 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.
kaku_gui::termwindow::wrapped_link::rejoined_links (cyclomatic 26) kaku-gui/src/termwindow/wrapped_link.rs:96— kaku_gui::termwindow::wrapped_link::rejoined_links 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.
kaku_gui::tabbar::parse_status_text (cyclomatic 25) kaku-gui/src/tabbar.rs:1427— kaku_gui::tabbar::parse_status_text has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
kaku_gui::overlay::confirm::run_confirmation_impl (cyclomatic 23) kaku-gui/src/overlay/confirm.rs:43— kaku_gui::overlay::confirm::run_confirmation_impl 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.
kaku_gui::update::update_checker (cyclomatic 23) kaku-gui/src/update.rs:555— kaku_gui::update::update_checker 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.
kaku_gui::ai_tools::shell::exec_shell_exec (cyclomatic 22) kaku-gui/src/ai_tools/shell.rs:98— kaku_gui::ai_tools::shell::exec_shell_exec 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.
kaku_gui::overlay::ai_chat::markdown::parse_markdown_blocks (cyclomatic 22) kaku-gui/src/overlay/ai_chat/markdown.rs:17— kaku_gui::overlay::ai_chat::markdown::parse_markdown_blocks 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.
kaku_gui::overlay::ai_chat::state::emit_assistant_markdown (cyclomatic 22) kaku-gui/src/overlay/ai_chat/state.rs:476— kaku_gui::overlay::ai_chat::state::emit_assistant_markdown has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
kaku_gui::ai_tools::search::exec_symbol_search (cyclomatic 21) kaku-gui/src/ai_tools/search.rs:557— kaku_gui::ai_tools::search::exec_symbol_search 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.
kaku_gui::async_run_terminal_gui (cyclomatic 21) kaku-gui/src/main.rs:350— kaku_gui::async_run_terminal_gui 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.
kaku_gui::overlay::ai_chat::render::format_tool_suffix (cyclomatic 21) kaku-gui/src/overlay/ai_chat/render.rs:45— kaku_gui::overlay::ai_chat::render::format_tool_suffix 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.
FixmeComment window/src/os/macos/window.rs:729— // FIXME: CTRL-C is 0x3, should it be normalized to C here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment window/src/os/macos/window.rs:7938— // FIXME: docs say to insert the text here, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment window/src/os/macos/window.rs:7948— // FIXME: returns NSArray<NSAttributedStringKey> * — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment termwiz/src/render/terminfo.rs:397— // FIXME: this doesn't behave correctly for terminals without bce. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment termwiz/src/render/terminfo.rs:419— // FIXME: this doesn't behave correctly for terminals without bce. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment term/src/screen.rs:289— // FIXME: borrow bidi mode from line — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment term/src/screen.rs:333— // FIXME: borrow bidi mode from line — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment term/src/test/mod.rs:11— // mod selection; FIXME: port to render layer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment mux/src/lib.rs:1722— // FIXME: clipboard — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment mux/src/lib.rs:1729— // FIXME: split pane pixel dimensions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment mux/src/lib.rs:1897— // FIXME: clipboard? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment mux/src/ssh.rs:275— // FIXME: this isn't useful without a way to talk to the remote mux. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment mux/src/termwiztermtab.rs:144— // FIXME: connect to something? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/commands.rs:524— // FIXME: use domain_label here, but needs to be async — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/commands.rs:554— // FIXME: use domain_label here, but needs to be async — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/commands.rs:1371— // FIXME: find a new assignment — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/commands.rs:1382— // FIXME: find a new assignment — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/termwindow/render/fancy_tab_bar.rs:323— // FIXME: determine exact width of macos ... buttons — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/termwindow/render/mod.rs:1011— // FIXME: need more paragraph context — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment kaku-gui/src/scripting/guiwin.rs:134— // FIXME: expose other states here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/wezterm-surface/src/line/line.rs:539— // FIXME: let's build a string and a byte-to-cell map here, and — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/wezterm-surface/src/line/line.rs:1034— // FIXME: we can skip the look-back for second and subsequent iterations — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/wezterm-ssh/src/sessioninner.rs:183— // FIXME: overridden config path? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/wezterm-input-types/src/lib.rs:1874— // FIXME: ideally we'd get the correct unshifted key from — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/wezterm-font/src/rasterizer/freetype.rs:545— // FIXME: gradient vectors are expressed as font units, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (9 lines × 2) config/derive/src/configmeta.rs:26— config/derive/src/configmeta.rs:26-35 | crates/wezterm-dynamic/derive/src/todynamic.rs:29-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) config/src/lua.rs:43— config/src/lua.rs:43-51 | config/src/lua.rs:65-73 — both copies are in the same file, so extract the block into 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/wezterm-client/src/client.rs:242— crates/wezterm-client/src/client.rs:242-250 | crates/wezterm-client/src/client.rs:278-286 — both copies are in the same file, so extract the block into 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/wezterm-dynamic/derive/src/fromdynamic.rs:93— crates/wezterm-dynamic/derive/src/fromdynamic.rs:93-101 | crates/wezterm-dynamic/derive/src/fromdynamic.rs:157-165 — both copies are in the same file, so extract the block into 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/wezterm-font/src/lib.rs:833— crates/wezterm-font/src/lib.rs:833-841 | crates/wezterm-font/src/lib.rs:853-861 — both copies are in the same file, so extract the block into 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/wezterm-mux-server-impl/src/sessionhandler.rs:587— crates/wezterm-mux-server-impl/src/sessionhandler.rs:587-595 | crates/wezterm-mux-server-impl/src/sessionhandler.rs:613-621 — both copies are in the same file, so extract the block into 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/wezterm-ssh/src/config.rs:255— crates/wezterm-ssh/src/config.rs:255-263 | crates/wezterm-ssh/src/config.rs:267-275 — both copies are in the same file, so extract the block into 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/wezterm-ssh/src/pty.rs:163— crates/wezterm-ssh/src/pty.rs:163-171 | crates/wezterm-ssh/src/pty.rs:189-197 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_chat_engine/approval.rs:523— kaku-gui/src/ai_chat_engine/approval.rs:523-531 | kaku-gui/src/ai_chat_engine/approval.rs:537-545 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_chat_engine/mod.rs:1100— kaku-gui/src/ai_chat_engine/mod.rs:1100-1108 | kaku-gui/src/overlay/ai_chat/state.rs:1795-1803 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) kaku-gui/src/customglyph.rs:5523— kaku-gui/src/customglyph.rs:5523-5531 | kaku-gui/src/customglyph.rs:5598-5606 — both copies are in the same file, so extract the block into 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) kaku-gui/src/glyphcache.rs:329— kaku-gui/src/glyphcache.rs:329-337 | kaku-gui/src/glyphcache.rs:345-353 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/ai_chat/markdown.rs:515— kaku-gui/src/overlay/ai_chat/markdown.rs:515-523 | kaku-gui/src/overlay/ai_chat/markdown.rs:534-542 — both copies are in the same file, so extract the block into 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) kaku-gui/src/session_restore.rs:356— kaku-gui/src/session_restore.rs:356-364 | kaku-gui/src/session_restore.rs:894-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 (9 lines × 2) kaku-gui/src/session_restore.rs:1332— kaku-gui/src/session_restore.rs:1332-1340 | kaku-gui/src/session_restore.rs:1354-1362 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/tab_rename.rs:106— kaku-gui/src/termwindow/tab_rename.rs:106-114 | kaku-gui/src/termwindow/tab_rename.rs:115-123 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui.rs:2860— kaku/src/ai_config/tui.rs:2860-2868 | kaku/src/ai_config/tui.rs:2942-2950 — both copies are in the same file, so extract the block into 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) kaku/src/reset.rs:458— kaku/src/reset.rs:458-466 | kaku/src/reset.rs:547-555 — both copies are in the same file, so extract the block into 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) mux/src/tab.rs:1201— mux/src/tab.rs:1201-1209 | mux/src/tab.rs:1232-1240 — both copies are in the same file, so extract the block into 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) mux/src/tab.rs:1212— mux/src/tab.rs:1212-1220 | mux/src/tab.rs:1243-1251 — both copies are in the same file, so extract the block into 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) mux/src/tmux_commands.rs:663— mux/src/tmux_commands.rs:663-671 | mux/src/tmux_commands.rs:902-910 — both copies are in the same file, so extract the block into 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) termwiz/src/render/terminfo.rs:641— termwiz/src/render/terminfo.rs:641-649 | termwiz/src/render/terminfo.rs:671-679 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_client/mod.rs:499— kaku-gui/src/ai_client/mod.rs:499-507 | kaku-gui/src/ai_client/mod.rs:665-673 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_tools/search.rs:47— kaku-gui/src/ai_tools/search.rs:47-55 | kaku-gui/src/ai_tools/search.rs:184-192 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_client/responses.rs:299— kaku-gui/src/ai_client/responses.rs:299-307 | kaku-gui/src/ai_client/responses.rs:319-327 — both copies are in the same file, so extract the block into 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) config/derive/src/attr.rs:132— config/derive/src/attr.rs:132-139 | crates/wezterm-dynamic/derive/src/attr.rs:282-289 — before extracting anything, compare `config/derive/src/attr.rs` and `crates/wezterm-dynamic/derive/src/attr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 138 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/tabout/src/lib.rs:96— crates/tabout/src/lib.rs:96-103 | crates/tabout/src/lib.rs:202-209 — both copies are in the same file, so extract the block into 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/wezterm-font/src/rasterizer/colr.rs:117— crates/wezterm-font/src/rasterizer/colr.rs:117-124 | crates/wezterm-font/src/rasterizer/colr.rs:150-157 — both copies are in the same file, so extract the block into 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/wezterm-input-types/src/lib.rs:1974— crates/wezterm-input-types/src/lib.rs:1974-1981 | termwiz/src/input.rs:599-606 — 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) kaku-gui/src/ai_chat_engine/suggestion.rs:45— kaku-gui/src/ai_chat_engine/suggestion.rs:45-52 | kaku-gui/src/ai_chat_engine/title.rs:35-42 — 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) kaku-gui/src/ai_client/mod.rs:255— kaku-gui/src/ai_client/mod.rs:255-262 | kaku-gui/src/ai_client/mod.rs:774-781 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_client/mod.rs:654— kaku-gui/src/ai_client/mod.rs:654-661 | kaku-gui/src/ai_client/mod.rs:751-758 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_client/responses.rs:288— kaku-gui/src/ai_client/responses.rs:288-295 | kaku-gui/src/ai_client/responses.rs:308-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 (8 lines × 2) kaku-gui/src/ai_tools/search.rs:668— kaku-gui/src/ai_tools/search.rs:668-675 | kaku-gui/src/ai_tools/search.rs:820-827 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5676— kaku-gui/src/customglyph.rs:5676-5683 | kaku-gui/src/customglyph.rs:5706-5713 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5691— kaku-gui/src/customglyph.rs:5691-5698 | kaku-gui/src/customglyph.rs:5721-5728 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:436— kaku-gui/src/overlay/copy.rs:436-443 | kaku-gui/src/overlay/quickselect.rs:921-928 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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) kaku-gui/src/overlay/copy.rs:856— kaku-gui/src/overlay/copy.rs:856-863 | kaku-gui/src/overlay/copy.rs:871-878 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mod.rs:5844— kaku-gui/src/termwindow/mod.rs:5844-5851 | kaku-gui/src/termwindow/mod.rs:5967-5974 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/palette.rs:587— kaku-gui/src/termwindow/palette.rs:587-594 | kaku-gui/src/termwindow/palette.rs:617-624 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:379— kaku-gui/src/update.rs:379-386 | kaku/src/update.rs:611-618 — before extracting anything, compare `kaku-gui/src/update.rs` and `kaku/src/update.rs` as WHOLE FILES: this scan already matched 6 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. 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) kaku/src/ai_config/tui.rs:2537— kaku/src/ai_config/tui.rs:2537-2544 | kaku/src/ai_config/tui.rs:2598-2606 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/providers/mod.rs:1032— kaku/src/ai_config/tui/providers/mod.rs:1032-1039 | kaku/src/ai_config/tui/providers/mod.rs:1051-1058 — both copies are in the same file, so extract the block into 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) kaku/src/config_tui/mod.rs:876— kaku/src/config_tui/mod.rs:876-883 | kaku/src/config_tui/mod.rs:914-921 — both copies are in the same file, so extract the block into 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) mux/src/tab.rs:1732— mux/src/tab.rs:1732-1739 | mux/src/tab.rs:1749-1756 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:577— kaku-gui/src/overlay/copy.rs:577-584 | kaku-gui/src/overlay/quickselect.rs:743-750 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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/wezterm-escape-parser/src/osc.rs:858— crates/wezterm-escape-parser/src/osc.rs:858-865 | crates/wezterm-escape-parser/src/osc.rs:867-874 — both copies are in the same file, so extract the block into 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) kaku-gui/src/stats.rs:368— kaku-gui/src/stats.rs:368-375 | kaku-gui/src/stats.rs:388-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 (8 lines × 2) crates/wezterm-font/src/rasterizer/freetype.rs:641— crates/wezterm-font/src/rasterizer/freetype.rs:641-648 | crates/wezterm-font/src/rasterizer/freetype.rs:691-698 — both copies are in the same file, so extract the block into 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) kaku/src/reset.rs:345— kaku/src/reset.rs:345-352 | kaku/src/reset.rs:394-401 — both copies are in the same file, so extract the block into 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) config/src/lua.rs:894— config/src/lua.rs:894-899 | config/src/lua.rs:915-920 — both copies are in the same file, so extract the block into 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/kaku-remote/src/share.rs:1114— crates/kaku-remote/src/share.rs:1114-1119 | crates/kaku-remote/src/share.rs:1134-1139 — both copies are in the same file, so extract the block into 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/wezterm-ssh/src/pty.rs:218— crates/wezterm-ssh/src/pty.rs:218-223 | crates/wezterm-ssh/src/sessioninner.rs:905-910 — 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) kaku-gui/src/ai_tools/search.rs:68— kaku-gui/src/ai_tools/search.rs:68-73 | kaku-gui/src/ai_tools/search.rs:127-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 (6 lines × 2) kaku-gui/src/ai_tools/shell.rs:104— kaku-gui/src/ai_tools/shell.rs:104-109 | kaku-gui/src/ai_tools/shell.rs:245-250 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:1569— kaku-gui/src/overlay/copy.rs:1569-1574 | kaku-gui/src/overlay/copy.rs:1671-1676 — both copies are in the same file, so extract the block into 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) kaku-gui/src/session_restore.rs:367— kaku-gui/src/session_restore.rs:367-372 | kaku-gui/src/session_restore.rs:908-913 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/render/fancy_tab_bar.rs:172— kaku-gui/src/termwindow/render/fancy_tab_bar.rs:172-177 | kaku-gui/src/termwindow/render/fancy_tab_bar.rs:217-222 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/selection.rs:105— kaku-gui/src/termwindow/selection.rs:105-110 | lua-api-crates/mux/src/pane.rs:54-59 — 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) kaku-gui/src/update.rs:181— kaku-gui/src/update.rs:181-186 | kaku-gui/src/update.rs:357-365 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui.rs:2545— kaku/src/ai_config/tui.rs:2545-2550 | kaku/src/ai_config/tui.rs:2607-2612 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/ui.rs:322— kaku/src/ai_config/tui/ui.rs:322-327 | kaku/src/ai_config/tui/ui.rs:342-347 — both copies are in the same file, so extract the block into 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) lua-api-crates/mux/src/pane.rs:101— lua-api-crates/mux/src/pane.rs:101-106 | lua-api-crates/mux/src/pane.rs:111-116 — both copies are in the same file, so extract the block into 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) termwiz/src/render/terminfo.rs:390— termwiz/src/render/terminfo.rs:390-395 | termwiz/src/render/terminfo.rs:412-417 — both copies are in the same file, so extract the block into 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) window/src/os/macos/window.rs:2433— window/src/os/macos/window.rs:2433-2438 | window/src/os/macos/window.rs:2449-2454 — both copies are in the same file, so extract the block into 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) kaku-gui/src/cli_chat/mod.rs:847— kaku-gui/src/cli_chat/mod.rs:847-852 | kaku-gui/src/overlay/ai_chat/layout.rs:5-10 — 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) kaku-gui/src/overlay/copy.rs:226— kaku-gui/src/overlay/copy.rs:226-231 | kaku-gui/src/overlay/quickselect.rs:732-737 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (6 lines × 2) kaku-gui/src/overlay/launcher.rs:568— kaku-gui/src/overlay/launcher.rs:568-573 | kaku-gui/src/overlay/selector.rs:228-233 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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) kaku-gui/src/overlay/launcher.rs:575— kaku-gui/src/overlay/launcher.rs:575-580 | kaku-gui/src/overlay/selector.rs:235-240 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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) term/src/terminalstate/mod.rs:56— term/src/terminalstate/mod.rs:56-61 | term/src/terminalstate/performer.rs:47-52 — before extracting anything, compare `term/src/terminalstate/mod.rs` and `term/src/terminalstate/performer.rs` as WHOLE FILES: this scan already matched 5 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 (6 lines × 2) kaku/src/ai_config/tui/ui.rs:295— kaku/src/ai_config/tui/ui.rs:295-301 | kaku/src/ai_config/tui/ui.rs:322-327 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/providers/mod.rs:1687— kaku/src/ai_config/tui/providers/mod.rs:1687-1692 | kaku/src/ai_config/tui/providers/mod.rs:1903-1908 — both copies are in the same file, so extract the block into 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) config/src/lib.rs:1955— config/src/lib.rs:1955-1960 | config/src/lib.rs:1981-1986 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/osc.rs:1535— crates/wezterm-escape-parser/src/osc.rs:1535-1540 | crates/wezterm-escape-parser/src/osc.rs:1545-1550 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/tmux_cc/mod.rs:303— crates/wezterm-escape-parser/src/tmux_cc/mod.rs:303-308 | crates/wezterm-escape-parser/src/tmux_cc/mod.rs:349-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
kaku::ai_config::tui::run_loop (cognitive 152) kaku/src/ai_config/tui.rs:3115— kaku::ai_config::tui::run_loop has cognitive complexity 152 (threshold 15). Drivers by points: if/else 29 (116 pts), match/switch 6 (21 pts), boolean chains 9, loops 2 (6 pts) (nesting depth added 106). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::ai_config::tui::save_field (cognitive 112) kaku/src/ai_config/tui.rs:2757— kaku::ai_config::tui::save_field has cognitive complexity 112 (threshold 15). Drivers by points: if/else 37 (88 pts), loops 2 (10 pts), match/switch 4 (9 pts), boolean chains 5 (nesting depth added 64). 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.
kaku::ai_config::tui::ui::render_tools (cognitive 89) kaku/src/ai_config/tui/ui.rs:109— kaku::ai_config::tui::ui::render_tools has cognitive complexity 89 (threshold 15). Drivers by points: if/else 42 (79 pts), boolean chains 7, loops 2 (3 pts) (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.
kaku::utils::strip_jsonc_comments (cognitive 56) kaku/src/utils.rs:191— kaku::utils::strip_jsonc_comments has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 3 (11 pts), match/switch 1 (6 pts), boolean chains 1 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
kaku::ai_config::tui::extract_openclaw_fields (cognitive 46) kaku/src/ai_config/tui.rs:1757— kaku::ai_config::tui::extract_openclaw_fields has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 4 (12 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.
kaku::ai_config::tui::providers::assistant::save_kaku_assistant_field_to_path (cognitive 46) kaku/src/ai_config/tui/providers/assistant.rs:438— kaku::ai_config::tui::providers::assistant::save_kaku_assistant_field_to_path has cognitive complexity 46 (threshold 15). Drivers by points: if/else 30 (41 pts), boolean chains 3, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::reset::imp::strip_legacy_inline_block (cognitive 46) kaku/src/reset.rs:712— kaku::reset::imp::strip_legacy_inline_block has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 3 (10 pts), boolean chains 2 (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.
kaku::doctor::build_shell_integration_group (cognitive 45) kaku/src/doctor.rs:448— kaku::doctor::build_shell_integration_group has cognitive complexity 45 (threshold 15). Drivers by points: if/else 35 (42 pts), boolean chains 3 (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.
kaku::run_remote (cognitive 34) kaku/src/main.rs:323— kaku::run_remote has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 4 (6 pts), boolean chains 2, match/switch 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.
kaku::doctor::build_environment_group (cognitive 33) kaku/src/doctor.rs:262— kaku::doctor::build_environment_group has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (27 pts), match/switch 3 (6 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.
kaku::update::imp::run (cognitive 30) kaku/src/update.rs:80— kaku::update::imp::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 4 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::config_tui::run_app (cognitive 28) kaku/src/config_tui/mod.rs:65— kaku::config_tui::run_app has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 5 (12 pts), boolean chains 2, loops 1 (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
kaku::config_tui::ui::render_fields (cognitive 28) kaku/src/config_tui/ui.rs:201— kaku::config_tui::ui::render_fields has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 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.
kaku::select_main_menu_command (cognitive 23) kaku/src/main.rs:786— kaku::select_main_menu_command has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 3 (6 pts), loops 2 (nesting depth added 13). Of this number, 18 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::ai_config::tui::providers::codex::codex_connection_is_configured_at (cognitive 23) kaku/src/ai_config/tui/providers/codex.rs:46— kaku::ai_config::tui::providers::codex::codex_connection_is_configured_at has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 5 (6 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
kaku::ai_config::tui::providers::assistant::render_kaku_assistant_config (cognitive 20) kaku/src/ai_config/tui/providers/assistant.rs:246— kaku::ai_config::tui::providers::assistant::render_kaku_assistant_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
kaku::utils::strip_jsonc_trailing_commas (cognitive 20) kaku/src/utils.rs:258— kaku::utils::strip_jsonc_trailing_commas has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::doctor::check_fish_conf_d_source_line (cognitive 18) kaku/src/doctor.rs:1126— kaku::doctor::check_fish_conf_d_source_line has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1, match/switch 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.
kaku::ensure_relay_access (cognitive 17) kaku/src/main.rs:612— kaku::ensure_relay_access has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::ai_config::tui::summarize_tool_fields (cognitive 16) kaku/src/ai_config/tui.rs:367— kaku::ai_config::tui::summarize_tool_fields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
kaku::ai_config::tui::save_kimi_field_at (cognitive 16) kaku/src/ai_config/tui.rs:2991— kaku::ai_config::tui::save_kimi_field_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1, match/switch 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.
kaku::ai_config::tui::providers::codex::extract_codex_fields (cognitive 16) kaku/src/ai_config/tui/providers/codex.rs:204— kaku::ai_config::tui::providers::codex::extract_codex_fields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku::ai_config::tui::providers::codex::save_codex_field_at (cognitive 16) kaku/src/ai_config/tui/providers/codex.rs:315— kaku::ai_config::tui::providers::codex::save_codex_field_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1, match/switch 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.
kaku::doctor::check_zshrc_source_line (cognitive 16) kaku/src/doctor.rs:1077— kaku::doctor::check_zshrc_source_line has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, match/switch 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.
Duplicated block (13 lines × 2) config/src/font.rs:401— config/src/font.rs:401-413 | config/src/font.rs:437-449 — both copies are in the same file, so extract the block into 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/wezterm-dynamic/derive/src/attr.rs:141— crates/wezterm-dynamic/derive/src/attr.rs:141-153 | crates/wezterm-dynamic/derive/src/attr.rs:168-180 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_chat_engine/suggestion.rs:30— kaku-gui/src/ai_chat_engine/suggestion.rs:30-42 | kaku-gui/src/ai_chat_engine/title.rs:20-32 — 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) kaku-gui/src/ai_tools/search.rs:514— kaku-gui/src/ai_tools/search.rs:514-526 | kaku-gui/src/ai_tools/search.rs:543-555 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_tools/search.rs:638— kaku-gui/src/ai_tools/search.rs:638-650 | kaku-gui/src/ai_tools/search.rs:783-795 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_tools/search.rs:869— kaku-gui/src/ai_tools/search.rs:869-881 | kaku-gui/src/ai_tools/shell.rs:157-169 — 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) kaku-gui/src/overlay/ai_chat/render.rs:497— kaku-gui/src/overlay/ai_chat/render.rs:497-509 | kaku-gui/src/overlay/ai_chat/render.rs:768-780 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:1541— kaku-gui/src/overlay/copy.rs:1541-1553 | kaku-gui/src/overlay/quickselect.rs:534-546 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (13 lines × 2) kaku-gui/src/overlay/copy.rs:1591— kaku-gui/src/overlay/copy.rs:1591-1603 | kaku-gui/src/overlay/quickselect.rs:580-592 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (13 lines × 2) kaku-gui/src/termwindow/box_model.rs:1168— kaku-gui/src/termwindow/box_model.rs:1168-1180 | kaku-gui/src/termwindow/box_model.rs:1182-1194 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/charselect.rs:507— kaku-gui/src/termwindow/charselect.rs:507-519 | kaku-gui/src/termwindow/paneselect.rs:110-122 — before extracting anything, compare `kaku-gui/src/termwindow/charselect.rs` and `kaku-gui/src/termwindow/paneselect.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 (13 lines × 2) kaku-gui/src/termwindow/mouseevent.rs:1270— kaku-gui/src/termwindow/mouseevent.rs:1270-1282 | kaku-gui/src/termwindow/mouseevent.rs:1676-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 (13 lines × 2) kaku-gui/src/termwindow/tab_rename.rs:874— kaku-gui/src/termwindow/tab_rename.rs:874-886 | kaku-gui/src/termwindow/tab_rename.rs:905-917 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:423— kaku-gui/src/update.rs:423-435 | kaku/src/update.rs:651-663 — before extracting anything, compare `kaku-gui/src/update.rs` and `kaku/src/update.rs` as WHOLE FILES: this scan already matched 6 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. 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 (13 lines × 2) kaku/src/ai_config/tui.rs:2512— kaku/src/ai_config/tui.rs:2512-2524 | kaku/src/ai_config/tui.rs:2572-2584 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/ui.rs:371— kaku/src/ai_config/tui/ui.rs:371-383 | kaku/src/config_tui/ui.rs:453-465 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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 (13 lines × 2) kaku/src/ai_config/tui/ui.rs:390— kaku/src/ai_config/tui/ui.rs:390-402 | kaku/src/config_tui/ui.rs:472-484 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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 (13 lines × 2) mux/src/tab.rs:1798— mux/src/tab.rs:1798-1810 | mux/src/tab.rs:1837-1849 — both copies are in the same file, so extract the block into 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) mux/src/tmux_commands.rs:414— mux/src/tmux_commands.rs:414-426 | mux/src/tmux_commands.rs:448-460 — both copies are in the same file, so extract the block into 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) mux/src/tmux_pty.rs:27— mux/src/tmux_pty.rs:27-39 | mux/src/tmux_pty.rs:48-60 — both copies are in the same file, so extract the block into 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) termwiz/src/render/terminfo.rs:657— termwiz/src/render/terminfo.rs:657-669 | termwiz/src/render/terminfo.rs:687-699 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/charselect.rs:250— kaku-gui/src/termwindow/charselect.rs:250-262 | kaku-gui/src/termwindow/palette.rs:248-260 — 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) kaku/src/ai_config/tui.rs:1090— kaku/src/ai_config/tui.rs:1090-1102 | kaku/src/ai_config/tui.rs:1262-1274 — both copies are in the same file, so extract the block into 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) config/src/color.rs:302— config/src/color.rs:302-309 | config/src/color.rs:354-360 — both copies are in the same file, so extract the block into 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) config/src/lib.rs:322— config/src/lib.rs:322-328 | config/src/lib.rs:333-339 — both copies are in the same file, so extract the block into 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/wezterm-client/src/domain.rs:447— crates/wezterm-client/src/domain.rs:447-453 | crates/wezterm-client/src/domain.rs:716-722 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/csi.rs:1903— crates/wezterm-escape-parser/src/csi.rs:1903-1909 | crates/wezterm-escape-parser/src/csi.rs:1932-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 (7 lines × 2) crates/wezterm-escape-parser/src/csi.rs:2146— crates/wezterm-escape-parser/src/csi.rs:2146-2152 | crates/wezterm-escape-parser/src/csi.rs:2170-2176 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/osc.rs:798— crates/wezterm-escape-parser/src/osc.rs:798-804 | crates/wezterm-escape-parser/src/osc.rs:829-835 — both copies are in the same file, so extract the block into 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/wezterm-font/src/ftwrap.rs:857— crates/wezterm-font/src/ftwrap.rs:857-863 | crates/wezterm-font/src/ftwrap.rs:874-880 — both copies are in the same file, so extract the block into 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/wezterm-font/src/rasterizer/freetype.rs:133— crates/wezterm-font/src/rasterizer/freetype.rs:133-139 | crates/wezterm-font/src/rasterizer/freetype.rs:178-184 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_client/mod.rs:380— kaku-gui/src/ai_client/mod.rs:380-386 | kaku-gui/src/ai_client/transport.rs:304-310 — 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) kaku-gui/src/overlay/copy.rs:972— kaku-gui/src/overlay/copy.rs:972-978 | kaku-gui/src/overlay/copy.rs:1004-1010 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mod.rs:4078— kaku-gui/src/termwindow/mod.rs:4078-4084 | kaku-gui/src/termwindow/mod.rs:4730-4736 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/palette.rs:485— kaku-gui/src/termwindow/palette.rs:485-492 | kaku-gui/src/termwindow/palette.rs:1011-1017 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/palette.rs:636— kaku-gui/src/termwindow/palette.rs:636-642 | kaku-gui/src/termwindow/palette.rs:742-748 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui.rs:905— kaku/src/ai_config/tui.rs:905-911 | kaku/src/ai_config/tui/providers/mod.rs:573-579 — 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 (7 lines × 2) kaku/src/ai_config/tui/ui.rs:478— kaku/src/ai_config/tui/ui.rs:478-484 | kaku/src/config_tui/ui.rs:404-410 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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) termwiz/src/lineedit/buffer.rs:98— termwiz/src/lineedit/buffer.rs:98-104 | termwiz/src/lineedit/buffer.rs:125-131 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/prompt.rs:81— kaku-gui/src/overlay/prompt.rs:81-87 | kaku-gui/src/overlay/selector.rs:387-393 — 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) kaku-gui/src/session_restore.rs:269— kaku-gui/src/session_restore.rs:269-275 | window/src/os/macos/window.rs:983-989 — 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 (7 lines × 2) kaku/src/doctor.rs:1399— kaku/src/doctor.rs:1399-1405 | kaku/src/reset.rs:432-438 — 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) kaku/src/ai_config/tui/providers/mod.rs:585— kaku/src/ai_config/tui/providers/mod.rs:585-591 | kaku/src/ai_config/tui/providers/mod.rs:1449-1455 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/providers/mod.rs:1791— kaku/src/ai_config/tui/providers/mod.rs:1791-1797 | kaku/src/ai_config/tui/providers/mod.rs:1799-1805 — both copies are in the same file, so extract the block into 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) kaku-gui/src/session_restore.rs:1099— kaku-gui/src/session_restore.rs:1099-1105 | kaku-gui/src/session_restore.rs:1142-1148 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:274— kaku-gui/src/update.rs:274-280 | kaku/src/update.rs:940-946 — before extracting anything, compare `kaku-gui/src/update.rs` and `kaku/src/update.rs` as WHOLE FILES: this scan already matched 6 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. 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/wezterm-dynamic/src/error.rs:264— crates/wezterm-dynamic/src/error.rs:264-273 | crates/wezterm-font/src/parser.rs:367-376 — 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/wezterm-font/src/ftwrap.rs:1117— crates/wezterm-font/src/ftwrap.rs:1117-1126 | crates/wezterm-font/src/ftwrap.rs:1130-1139 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_conversations.rs:229— kaku-gui/src/ai_conversations.rs:229-238 | kaku-gui/src/ai_conversations.rs:293-302 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/ai_chat/state.rs:878— kaku-gui/src/overlay/ai_chat/state.rs:878-887 | kaku-gui/src/overlay/ai_chat/state.rs:2491-2500 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:213— kaku-gui/src/overlay/copy.rs:213-222 | kaku-gui/src/overlay/quickselect.rs:307-316 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (10 lines × 2) kaku-gui/src/overlay/copy.rs:307— kaku-gui/src/overlay/copy.rs:307-316 | kaku-gui/src/overlay/quickselect.rs:845-854 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (10 lines × 2) kaku-gui/src/overlay/launcher.rs:679— kaku-gui/src/overlay/launcher.rs:679-688 | kaku-gui/src/overlay/selector.rs:294-303 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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) kaku-gui/src/termwindow/charselect.rs:393— kaku-gui/src/termwindow/charselect.rs:393-402 | kaku-gui/src/termwindow/paneselect.rs:62-71 — before extracting anything, compare `kaku-gui/src/termwindow/charselect.rs` and `kaku-gui/src/termwindow/paneselect.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 (10 lines × 2) kaku-gui/src/termwindow/mod.rs:4309— kaku-gui/src/termwindow/mod.rs:4309-4318 | kaku-gui/src/termwindow/mod.rs:4333-4342 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mouseevent.rs:1785— kaku-gui/src/termwindow/mouseevent.rs:1785-1794 | kaku-gui/src/termwindow/mouseevent.rs:1811-1820 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/selection.rs:26— kaku-gui/src/termwindow/selection.rs:26-35 | kaku-gui/src/termwindow/selection.rs:92-101 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:350— kaku-gui/src/update.rs:350-359 | kaku/src/update.rs:570-579 — before extracting anything, compare `kaku-gui/src/update.rs` and `kaku/src/update.rs` as WHOLE FILES: this scan already matched 6 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. 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) kaku/src/ai_config/tui.rs:2994— kaku/src/ai_config/tui.rs:2994-3003 | kaku/src/ai_config/tui/providers/codex.rs:319-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) kaku/src/cli/get_text.rs:47— kaku/src/cli/get_text.rs:47-56 | kaku/src/cli/get_text.rs:60-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 (10 lines × 2) mux/src/pane_encoding.rs:132— mux/src/pane_encoding.rs:132-141 | mux/src/pane_encoding.rs:239-248 — both copies are in the same file, so extract the block into 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) term/src/terminalstate/performer.rs:629— term/src/terminalstate/performer.rs:629-638 | term/src/terminalstate/performer.rs:646-655 — both copies are in the same file, so extract the block into 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) mux/src/localpane.rs:528— mux/src/localpane.rs:528-537 | mux/src/termwiztermtab.rs:337-346 — 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/wezterm-font/src/rasterizer/freetype.rs:642— crates/wezterm-font/src/rasterizer/freetype.rs:642-651 | crates/wezterm-font/src/rasterizer/freetype.rs:667-676 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui.rs:1052— kaku/src/ai_config/tui.rs:1052-1061 | kaku/src/ai_config/tui.rs:1083-1092 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:324— kaku-gui/src/update.rs:324-333 | kaku-gui/src/update.rs:351-360 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/apc.rs:663— crates/wezterm-escape-parser/src/apc.rs:663-672 | crates/wezterm-escape-parser/src/apc.rs:674-683 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/csi.rs:2158— crates/wezterm-escape-parser/src/csi.rs:2158-2168 | crates/wezterm-escape-parser/src/csi.rs:2170-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 (11 lines × 2) crates/wezterm-ssh/src/pty.rs:106— crates/wezterm-ssh/src/pty.rs:106-116 | crates/wezterm-ssh/src/pty.rs:143-153 — both copies are in the same file, so extract the block into 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) kaku-gui/src/commands.rs:595— kaku-gui/src/commands.rs:595-605 | kaku-gui/src/commands.rs:615-625 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5563— kaku-gui/src/customglyph.rs:5563-5573 | kaku-gui/src/customglyph.rs:5599-5609 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5581— kaku-gui/src/customglyph.rs:5581-5591 | kaku-gui/src/customglyph.rs:5617-5627 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/ai_chat/state.rs:889— kaku-gui/src/overlay/ai_chat/state.rs:889-899 | kaku-gui/src/overlay/ai_chat/state.rs:2502-2512 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:1685— kaku-gui/src/overlay/copy.rs:1685-1695 | kaku-gui/src/overlay/quickselect.rs:674-684 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (11 lines × 2) kaku-gui/src/termwindow/render/mod.rs:707— kaku-gui/src/termwindow/render/mod.rs:707-719 | kaku-gui/src/termwindow/render/mod.rs:765-775 — both copies are in the same file, so extract the block into 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) mux/src/connui.rs:27— mux/src/connui.rs:27-37 | mux/src/ssh.rs:48-58 — 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) mux/src/connui.rs:373— mux/src/connui.rs:373-383 | mux/src/connui.rs:393-403 — both copies are in the same file, so extract the block into 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) term/src/screen.rs:801— term/src/screen.rs:801-811 | term/src/screen.rs:875-885 — both copies are in the same file, so extract the block into 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) term/src/terminalstate/mod.rs:2659— term/src/terminalstate/mod.rs:2659-2669 | term/src/terminalstate/mod.rs:2716-2726 — both copies are in the same file, so extract the block into 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) term/src/terminalstate/mod.rs:87— term/src/terminalstate/mod.rs:87-97 | term/src/terminalstate/performer.rs:78-88 — before extracting anything, compare `term/src/terminalstate/mod.rs` and `term/src/terminalstate/performer.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) term/src/terminalstate/mod.rs:940— term/src/terminalstate/mod.rs:940-950 | term/src/terminalstate/performer.rs:140-150 — before extracting anything, compare `term/src/terminalstate/mod.rs` and `term/src/terminalstate/performer.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) term/src/terminalstate/mod.rs:952— term/src/terminalstate/mod.rs:952-962 | term/src/terminalstate/performer.rs:152-162 — before extracting anything, compare `term/src/terminalstate/mod.rs` and `term/src/terminalstate/performer.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) crates/wezterm-escape-parser/src/tmux_cc/mod.rs:270— crates/wezterm-escape-parser/src/tmux_cc/mod.rs:270-280 | crates/wezterm-escape-parser/src/tmux_cc/mod.rs:389-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) kaku/src/ai_config/tui.rs:1063— kaku/src/ai_config/tui.rs:1063-1073 | kaku/src/ai_config/tui/providers/mod.rs:2092-2102 — 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 (11 lines × 2) crates/wezterm-escape-parser/src/tmux_cc/mod.rs:318— crates/wezterm-escape-parser/src/tmux_cc/mod.rs:318-328 | crates/wezterm-escape-parser/src/tmux_cc/mod.rs:485-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.
TooManyMethods: TermWindow kaku-gui/src/termwindow/mod.rs:1043— TooManyMethods — 306 methods, declared across 20 files: termwindow/mod.rs (150), termwindow/mouseevent.rs (30), termwindow/keyevent.rs (26), render/mod.rs (19), +16 more file(s). The bar is 30 methods; this is 276 over it, 10.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: TerminalState term/src/terminalstate/mod.rs:302— TooManyMethods — 110 methods, declared across 7 files: terminalstate/mod.rs (82), terminalstate/kitty.rs (12), terminalstate/mouse.rs (8), terminalstate/keyboard.rs (4), +3 more file(s). The bar is 30 methods; this is 80 over it, 3.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: WindowView window/src/os/macos/window.rs:4548— TooManyMethods — 89 methods. The bar is 30 methods; this is 59 over it, 2.97× 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: Line crates/wezterm-surface/src/line/line.rs:46— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Mux mux/src/lib.rs:151— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: App kaku-gui/src/overlay/ai_chat/state.rs:704— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× 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: CopyRenderable kaku-gui/src/overlay/copy.rs:63— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WindowInner window/src/os/macos/window.rs:524— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: App kaku/src/config_tui/mod.rs:361— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: TabInner mux/src/tab.rs:93— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Tab mux/src/tab.rs:105— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BidiContext crates/bidi/src/lib.rs:75— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: App kaku/src/ai_config/tui.rs:1954— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Screen term/src/screen.rs:15— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× 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: TabRenameModal kaku-gui/src/termwindow/tab_rename.rs:30— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Surface crates/wezterm-surface/src/lib.rs:107— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Config config/src/config.rs:52— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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.
Repeated repair: crates/wezterm-surface/src/line/test.rs crates/wezterm-surface/src/line/test.rs:405— crates/wezterm-surface/src/line/test.rs changed 5 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 1 (its worst body is wezterm_surface::line::test::bold at line 405), 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(surface): #608 stop the link scan at the last cell instead of aborting”; “fix(links): keep hard-newline output out of hyperlink targets”; “fix(links): #547 rejoin rows a TUI wrapped without the wrap attribute”; “fix: tighten terminal links and macOS interactions”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/wezterm-surface/src/line/test.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/wezterm-surface/src/line/line.rs crates/wezterm-surface/src/line/line.rs:571— crates/wezterm-surface/src/line/line.rs changed 5 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 14 (its worst body is Line::apply_hyperlink_rules at line 571), 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(links): keep hard-newline output out of hyperlink targets”; “fix(links): drop needless borrows in the row continuity check”; “fix(links): #547 rejoin rows a TUI wrapped without the wrap attribute”; “fix: tighten terminal links and macOS interactions”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- crates/wezterm-surface/src/line/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: kaku-gui/src/ai_tools/paths.rs kaku-gui/src/ai_tools/paths.rs:298— kaku-gui/src/ai_tools/paths.rs changed 5 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 14 (its worst body is kaku_gui::ai_tools::paths::reject_relative_cwd_escape at line 298), 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(ai): harden tool security and partial stream turns”; “fix: address review follow-ups on security and state repair”; “fix(ai): harden tool security and stream robustness”; “fix: keep code search safe without ripgrep”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/ai_tools/paths.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: window/src/os/macos/menu.rs window/src/os/macos/menu.rs:49— window/src/os/macos/menu.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 2 (its worst body is Menu::item_at_index at line 49), 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(macos): rebuild the menubar in place on config reload”; “fix(menu): retain separator items instead of adopting them”; “fix(gui): harden launcher teardown and guard menubar init”; “fix(macos): make terminal context menu safe”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- window/src/os/macos/menu.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: kaku/src/init.rs kaku/src/init.rs:320— kaku/src/init.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 8 (its worst body is kaku::init::imp::resolve_preferred_kaku_bin at line 320), 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(init): run only the bundled setup script in release builds”; “fix(shell): only persist completed first-run state”; “fix(shell): converge state.json across XDG entry points”; “fix: preserve managed shell state across XDG paths”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku/src/init.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: kaku/src/shell.rs kaku/src/shell.rs:182— kaku/src/shell.rs changed 5 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 8 (its worst body is kaku::shell::find_shell_executable 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(shell): only persist completed first-run state”; “fix: address review follow-ups on security and state repair”; “fix(shell): converge state.json across XDG entry points”; “fix: preserve managed shell state across XDG paths”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku/src/shell.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: kaku-gui/src/inline_ai.rs kaku-gui/src/inline_ai.rs:96— kaku-gui/src/inline_ai.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is kaku_gui::inline_ai::job_paths at line 96), 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(ai): never run a fix that quits or kills apps on Cmd+Shift+E”; “fix(ai): keep file names whole in inline summaries”; “fix(ai): preserve inline explanations and command candidates”; “fix(ai): keep inline command requests valid and repeatable”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/inline_ai.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: window/src/lib.rs window/src/lib.rs:297— window/src/lib.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is WindowEventSender::dispatch at line 297), 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(window): give voice input tools a caret to find in the terminal view”; “fix(macos): #574 isolate hotkey sessions and recover display geometry”; “fix(macos): make terminal context menu safe”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- window/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: kaku-gui/src/termwindow/render/agent_title.rs kaku-gui/src/termwindow/render/agent_title.rs:76— kaku-gui/src/termwindow/render/agent_title.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is kaku_gui::termwindow::render::agent_title::agent_topic at line 76), 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(gui): keep the agent title fitted and clear of the first row”; “fix(gui): keep complete words in agent topics”; “fix(gui): give the agent mark half a point more room before the topic”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/termwindow/render/agent_title.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: kaku-gui/src/overlay/confirm_close_pane.rs kaku-gui/src/overlay/confirm_close_pane.rs:12— kaku-gui/src/overlay/confirm_close_pane.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 4 (its worst body is kaku_gui::overlay::confirm_close_pane::confirm_close_pane at line 12), 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(ui): draw confirmation frames with the window's palette”; “fix(gui): record the cwd on every tab close path”; “fix(gui): close the pane its confirmation was opened for”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/overlay/confirm_close_pane.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: kaku-gui/src/overlay/ai_chat/types.rs kaku-gui/src/overlay/ai_chat/types.rs:48— kaku-gui/src/overlay/ai_chat/types.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 4 (its worst body is ChatPalette::heading_marker_attr at line 48), 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(ui): quiet the frame lines Kaku draws on dark themes”; “fix(ai): clarify chat input and use a blinking caret”; “fix: harden AI response state and tool boundaries”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/overlay/ai_chat/types.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: window/src/os/macos/app.rs window/src/os/macos/app.rs:1423— window/src/os/macos/app.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 10 (its worst body is window::os::macos::app::first_service_path at line 1423), 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(macos): stop blocking log out, restart and shut down”; “fix(macos): #574 isolate hotkey sessions and recover display geometry”; “fix(macos): make terminal context menu safe”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- window/src/os/macos/app.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: kaku/src/diagnostics.rs kaku/src/diagnostics.rs:224— kaku/src/diagnostics.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 6 (its worst body is kaku::diagnostics::collect_crash_reports at line 224), 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(doctor): redact committed input method text”; “fix(doctor): keep typed keys out of the diagnostics bundle”; “fix(doctor): redact URL credentials and fine-grained GitHub tokens”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku/src/diagnostics.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: kaku-gui/src/ai_chat_engine/compact.rs kaku-gui/src/ai_chat_engine/compact.rs:131— kaku-gui/src/ai_chat_engine/compact.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 9 (its worst body is kaku_gui::ai_chat_engine::compact::micro_compact at line 131), 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(ai): improve chat overlay context, prompt guidance, and compaction hints”; “fix(ai): harden tool security and stream robustness”; “fix: harden AI response state and tool boundaries”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/ai_chat_engine/compact.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: kaku-gui/src/ai_tools/web.rs kaku-gui/src/ai_tools/web.rs:64— kaku-gui/src/ai_tools/web.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 kaku_gui::ai_tools::web::exec_http_request at line 64), 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(ai): harden tool security and partial stream turns”; “fix(ai): harden tool security and stream robustness”; “fix: harden AI response state and tool boundaries”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 18:56:01 +08:00' --until='2026-10-27 18:56:01 +08:00' --full-history --no-merges -- kaku-gui/src/ai_tools/web.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.
Off the main sequence: bintree — bintree: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: frecency — frecency: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: promise — promise: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: rangeset — rangeset: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: umask — umask: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: wezterm-char-props — wezterm-char-props: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: wezterm-uds — wezterm-uds: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: luahelper — luahelper: abstractness 0.00, instability 0.05, distance 0.95 — zone of pain — concrete and depended on by 19 project(s), so it's rigid to change.
Off the main sequence: wezterm-bidi — wezterm-bidi: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: wezterm-color-types — wezterm-color-types: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: wezterm-input-types — wezterm-input-types: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: vtparse — vtparse: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: wezterm-blob-leases — wezterm-blob-leases: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: wezterm-toast-notification — wezterm-toast-notification: 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: config — config: abstractness 0.01, instability 0.28, distance 0.70 — zone of pain — concrete and depended on by 28 project(s), so it's rigid to change.
kaku::ai_config::tui::run_loop (cyclomatic 68) kaku/src/ai_config/tui.rs:3115— kaku::ai_config::tui::run_loop 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.
kaku::ai_config::tui::save_field (cyclomatic 47) kaku/src/ai_config/tui.rs:2757— kaku::ai_config::tui::save_field 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.
kaku::ai_config::tui::ui::render_tools (cyclomatic 36) kaku/src/ai_config/tui/ui.rs:109— kaku::ai_config::tui::ui::render_tools has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kaku::ai_config::tui::providers::assistant::save_kaku_assistant_field_to_path (cyclomatic 34) kaku/src/ai_config/tui/providers/assistant.rs:438— kaku::ai_config::tui::providers::assistant::save_kaku_assistant_field_to_path 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.
kaku::config_tui::run_app (cyclomatic 28) kaku/src/config_tui/mod.rs:65— kaku::config_tui::run_app has cyclomatic complexity 28 (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.
kaku::doctor::build_shell_integration_group (cyclomatic 27) kaku/src/doctor.rs:448— kaku::doctor::build_shell_integration_group 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.
kaku::run_remote (cyclomatic 25) kaku/src/main.rs:323— kaku::run_remote 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.
kaku::ai_config::tui::providers::codex::codex_connection_is_configured_at (cyclomatic 23) kaku/src/ai_config/tui/providers/codex.rs:46— kaku::ai_config::tui::providers::codex::codex_connection_is_configured_at has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
kaku::select_main_menu_command (cyclomatic 22) kaku/src/main.rs:786— kaku::select_main_menu_command has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
kaku::update::imp::run (cyclomatic 19) kaku/src/update.rs:80— kaku::update::imp::run 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.
kaku::doctor::build_environment_group (cyclomatic 18) kaku/src/doctor.rs:262— kaku::doctor::build_environment_group 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.
kaku::utils::strip_jsonc_comments (cyclomatic 18) kaku/src/utils.rs:191— kaku::utils::strip_jsonc_comments 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.
kaku::ai_config::tui::extract_openclaw_fields (cyclomatic 17) kaku/src/ai_config/tui.rs:1757— kaku::ai_config::tui::extract_openclaw_fields 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.
kaku::reset::imp::strip_legacy_inline_block (cyclomatic 17) kaku/src/reset.rs:712— kaku::reset::imp::strip_legacy_inline_block has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Duplicated block (5 lines × 2) kaku-gui/src/cli_chat/mod.rs:323— kaku-gui/src/cli_chat/mod.rs:323-327 | kaku-gui/src/cli_chat/mod.rs:330-334 — both copies are in the same file, so extract the block into 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) kaku-gui/src/codex_connection.rs:220— kaku-gui/src/codex_connection.rs:220-224 | kaku-gui/src/codex_connection.rs:267-271 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5670— kaku-gui/src/customglyph.rs:5670-5674 | kaku-gui/src/customglyph.rs:5685-5689 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5700— kaku-gui/src/customglyph.rs:5700-5704 | kaku-gui/src/customglyph.rs:5715-5719 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/ai_chat/state.rs:1730— kaku-gui/src/overlay/ai_chat/state.rs:1730-1735 | kaku-gui/src/overlay/ai_chat/state.rs:2408-2412 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/ai_chat/state.rs:2151— kaku-gui/src/overlay/ai_chat/state.rs:2151-2155 | kaku-gui/src/overlay/ai_chat/state.rs:2473-2477 — both copies are in the same file, so extract the block into 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) kaku-gui/src/stats.rs:224— kaku-gui/src/stats.rs:224-228 | kaku-gui/src/stats.rs:259-263 — both copies are in the same file, so extract the block into 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) lua-api-crates/mux/src/tab.rs:47— lua-api-crates/mux/src/tab.rs:47-51 | lua-api-crates/mux/src/window.rs:65-70 — 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) kaku/src/ai_config/tui/providers/assistant.rs:518— kaku/src/ai_config/tui/providers/assistant.rs:518-522 | kaku/src/ai_config/tui/providers/assistant.rs:524-528 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mod.rs:5979— kaku-gui/src/termwindow/mod.rs:5979-5983 | kaku-gui/src/termwindow/mod.rs:5993-5997 — both copies are in the same file, so extract the block into 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) config/src/color.rs:285— config/src/color.rs:285-289 | config/src/color.rs:291-295 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/mod.rs:56— kaku-gui/src/overlay/mod.rs:56-60 | kaku-gui/src/overlay/mod.rs:94-98 — both copies are in the same file, so extract the block into 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) window/src/os/macos/connection.rs:250— window/src/os/macos/connection.rs:250-254 | window/src/os/macos/connection.rs:261-265 — both copies are in the same file, so extract the block into 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) window/src/os/macos/window.rs:3215— window/src/os/macos/window.rs:3215-3219 | window/src/os/macos/window.rs:3289-3293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
kaku_remote::web::run_session (cognitive 374) crates/kaku-remote/src/web.rs:2785— kaku_remote::web::run_session has cognitive complexity 374 (threshold 15). Drivers by points: if/else 86 (328 pts), match/switch 8 (24 pts), loops 4 (12 pts), boolean chains 10 (nesting depth added 266). 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.
kaku_remote::share::serve (cognitive 125) crates/kaku-remote/src/share.rs:819— kaku_remote::share::serve has cognitive complexity 125 (threshold 15). Drivers by points: if/else 23 (89 pts), match/switch 7 (23 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 88). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_remote::p2p::carry (cognitive 69) REDACTED:705— kaku_remote::p2p::carry has cognitive complexity 69 (threshold 15). Drivers by points: if/else 14 (52 pts), match/switch 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_remote::p2p::wrap (cognitive 68) REDACTED:114— kaku_remote::p2p::wrap has cognitive complexity 68 (threshold 15). Drivers by points: if/else 14 (40 pts), match/switch 7 (18 pts), loops 5 (8 pts), boolean chains 2 (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.
kaku_remote::web::handle_input (cognitive 48) crates/kaku-remote/src/web.rs:2484— kaku_remote::web::handle_input has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (41 pts), loops 2 (4 pts), boolean chains 2, match/switch 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.
kaku_remote::web::handle_upload (cognitive 42) crates/kaku-remote/src/web.rs:1241— kaku_remote::web::handle_upload has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 5, match/switch 3 (5 pts) (nesting depth added 20). 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.
kaku_remote::share::advance (cognitive 31) crates/kaku-remote/src/share.rs:361— kaku_remote::share::advance has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 4 (8 pts) (nesting depth added 16). 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.
kaku_remote::web::find_in_rows (cognitive 24) crates/kaku-remote/src/web.rs:1437— kaku_remote::web::find_in_rows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (6 pts), loops 2 (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.
kaku_remote::web::handle_download (cognitive 22) crates/kaku-remote/src/web.rs:1136— kaku_remote::web::handle_download has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (3 pts) (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.
kaku_remote::desktop::tap_with (cognitive 20) crates/kaku-remote/src/desktop.rs:132— kaku_remote::desktop::tap_with has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_remote::web::search_pane (cognitive 20) crates/kaku-remote/src/web.rs:1489— kaku_remote::web::search_pane has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kaku_remote::web::image_placements (cognitive 18) crates/kaku-remote/src/web.rs:1669— kaku_remote::web::image_placements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 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.
kaku_remote::web::row_text (cognitive 17) crates/kaku-remote/src/web.rs:2177— kaku_remote::web::row_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (12 lines × 2) config/derive/src/bound.rs:5— config/derive/src/bound.rs:5-16 | crates/wezterm-dynamic/derive/src/bound.rs:5-16 — 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 (12 lines × 2) config/src/keyassignment.rs:364— config/src/keyassignment.rs:364-375 | mux/src/domain.rs:315-326 — 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 (12 lines × 2) crates/bintree/src/lib.rs:326— crates/bintree/src/lib.rs:326-337 | crates/bintree/src/lib.rs:340-351 — both copies are in the same file, so extract the block into 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/bintree/src/lib.rs:362— crates/bintree/src/lib.rs:362-373 | crates/bintree/src/lib.rs:384-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 (12 lines × 2) crates/tabout/src/lib.rs:32— crates/tabout/src/lib.rs:32-43 | crates/tabout/src/lib.rs:147-158 — both copies are in the same file, so extract the block into 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/wezterm-ssh/src/auth.rs:98— crates/wezterm-ssh/src/auth.rs:98-112 | crates/wezterm-ssh/src/auth.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) kaku-gui/src/ai_tools/search.rs:694— kaku-gui/src/ai_tools/search.rs:694-705 | kaku-gui/src/ai_tools/search.rs:877-888 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/launcher.rs:199— kaku-gui/src/overlay/launcher.rs:199-210 | kaku-gui/src/overlay/selector.rs:75-86 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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) kaku-gui/src/termwindow/resize.rs:596— kaku-gui/src/termwindow/resize.rs:596-607 | kaku-gui/src/termwindow/resize.rs:682-693 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui.rs:2243— kaku/src/ai_config/tui.rs:2243-2254 | kaku/src/ai_config/tui.rs:2280-2291 — both copies are in the same file, so extract the block into 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) mux/src/tab.rs:441— mux/src/tab.rs:441-452 | mux/src/tab.rs:511-522 — both copies are in the same file, so extract the block into 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) term/src/screen.rs:683— term/src/screen.rs:683-694 | term/src/screen.rs:952-963 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/ui.rs:79— kaku/src/ai_config/tui/ui.rs:79-90 | kaku/src/config_tui/ui.rs:158-169 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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.
App::drain_tokens (cognitive 72) kaku-gui/src/overlay/ai_chat/state.rs:1823— App::drain_tokens has cognitive complexity 72 (threshold 15). Drivers by points: if/else 20 (44 pts), boolean chains 12, loops 4 (10 pts), match/switch 3 (6 pts) (nesting depth added 33). 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.
App::rebuild_display_cache (cognitive 48) kaku-gui/src/overlay/ai_chat/state.rs:1228— App::rebuild_display_cache has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 2 (6 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App::load_window_decorations (cognitive 29) kaku/src/config_tui/mod.rs:700— App::load_window_decorations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App::submit (cognitive 28) kaku-gui/src/overlay/ai_chat/state.rs:1594— App::submit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (22 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
App::to_lua_value (cognitive 26) kaku/src/config_tui/mod.rs:1501— App::to_lua_value has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 3 (5 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.
App::set_lua_config_line (cognitive 25) kaku/src/config_tui/mod.rs:1436— App::set_lua_config_line has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App::normalize_value (cognitive 24) kaku/src/config_tui/mod.rs:987— App::normalize_value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 7). 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::start_edit (cognitive 23) kaku/src/ai_config/tui.rs:2428— App::start_edit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6 (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.
App::extract_lua_value (cognitive 19) kaku/src/config_tui/mod.rs:795— App::extract_lua_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 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.
App::activate_control (cognitive 19) kaku-gui/src/overlay/ai_chat/state.rs:1460— App::activate_control has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 7). 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.
TerminalState::perform_csi_edit (cognitive 54) term/src/terminalstate/mod.rs:2364— TerminalState::perform_csi_edit has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 4 (10 pts), boolean chains 5, match/switch 3 (5 pts) (nesting depth added 28). 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.
TerminalState::perform_csi_cursor (cognitive 44) term/src/terminalstate/mod.rs:2562— TerminalState::perform_csi_cursor has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (37 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 17). 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.
TerminalState::set_image (cognitive 25) term/src/terminalstate/iterm.rs:10— TerminalState::set_image has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 5 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalState::sixel (cognitive 25) term/src/terminalstate/sixel.rs:10— TerminalState::sixel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 3 (5 pts), match/switch 2 (3 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.
TerminalState::assign_image_to_cells (cognitive 24) term/src/terminalstate/image.rs:96— TerminalState::assign_image_to_cells has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalState::kitty_frame_transmit (cognitive 21) term/src/terminalstate/kitty.rs:556— TerminalState::kitty_frame_transmit has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 8 (13 pts), if/else 5 (8 pts) (nesting depth added 8). 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.
TerminalState::coalesce_kitty_accumulation (cognitive 21) term/src/terminalstate/kitty.rs:870— TerminalState::coalesce_kitty_accumulation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (8 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalState::set_cursor_pos (cognitive 20) term/src/terminalstate/mod.rs:1220— TerminalState::set_cursor_pos has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (nesting depth added 6). 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.
TerminalState::perform_csi_mode (cognitive 19) term/src/terminalstate/mod.rs:1675— TerminalState::perform_csi_mode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (3 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.
TerminalState::kitty_img (cognitive 16) term/src/terminalstate/kitty.rs:175— TerminalState::kitty_img has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Swallowed exception (empty catch) crates/kaku-remote/assets/web/desktop.js:211— 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/kaku-remote/assets/web/desktop.js:317— 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/kaku-remote/assets/web/desktop.js:460— 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/kaku-remote/assets/web/desktop.js:500— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/kaku-remote/assets/web/desktop.js:512— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/kaku-remote/assets/web/desktop.js:560— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/kaku-remote/assets/web/desktop.js:561— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) crates/kaku-remote/assets/web/desktop.js:601— 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/kaku-remote/assets/web/desktop.js:712— 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/kaku-remote/assets/web/desktop.js:1167— `.then(…, () => {})` 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.
BidiContext::explicit_embedding_levels (cognitive 103) crates/bidi/src/lib.rs:1337— BidiContext::explicit_embedding_levels has cognitive complexity 103 (threshold 15). Drivers by points: if/else 29 (89 pts), boolean chains 7, loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BidiContext::reverse_levels (cognitive 39) crates/bidi/src/lib.rs:355— BidiContext::reverse_levels has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 2 (7 pts), loops 4 (5 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.
BidiContext::resolve_paired_brackets (cognitive 27) crates/bidi/src/lib.rs:819— BidiContext::resolve_paired_brackets has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 3 (5 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BidiContext::resolve_terminators (cognitive 26) crates/bidi/src/lib.rs:718— BidiContext::resolve_terminators has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (11 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.
BidiContext::resolve_european_numbers (cognitive 25) crates/bidi/src/lib.rs:565— BidiContext::resolve_european_numbers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (8 pts), match/switch 1 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BidiContext::resolve_en) 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.
BidiContext::resolve_en (cognitive 25) crates/bidi/src/lib.rs:773— BidiContext::resolve_en has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (8 pts), match/switch 1 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BidiContext::resolve_european_numbers) 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.
BidiContext::reorder_non_spacing_marks (cognitive 18) crates/bidi/src/lib.rs:304— BidiContext::reorder_non_spacing_marks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BidiContext::resolve_one_pair (cognitive 18) crates/bidi/src/lib.rs:967— BidiContext::resolve_one_pair has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BidiContext::resolve_separators (cognitive 16) crates/bidi/src/lib.rs:676— BidiContext::resolve_separators has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 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.
TerminalState::perform_csi_mode (cyclomatic 113) term/src/terminalstate/mod.rs:1675— TerminalState::perform_csi_mode has cyclomatic complexity 113 (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.
TerminalState::perform_csi_cursor (cyclomatic 46) term/src/terminalstate/mod.rs:2562— TerminalState::perform_csi_cursor has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TerminalState::perform_csi_edit (cyclomatic 32) term/src/terminalstate/mod.rs:2364— TerminalState::perform_csi_edit 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.
TerminalState::sixel (cyclomatic 21) term/src/terminalstate/sixel.rs:10— TerminalState::sixel 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.
TerminalState::set_image (cyclomatic 20) term/src/terminalstate/iterm.rs:10— TerminalState::set_image 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.
TerminalState::kitty_img (cyclomatic 16) term/src/terminalstate/kitty.rs:175— TerminalState::kitty_img 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.
TerminalState::perform_device (cyclomatic 16) term/src/terminalstate/mod.rs:1481— TerminalState::perform_device 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.
TerminalState::mouse_wheel (cyclomatic 16) term/src/terminalstate/mouse.rs:76— TerminalState::mouse_wheel 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.
mux::parse_buffered_data (cognitive 54) mux/src/lib.rs:336— mux::parse_buffered_data has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (38 pts), match/switch 4 (12 pts), boolean chains 3, loops 1 (nesting depth added 35). 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.
mux::ssh::connect_ssh_session (cognitive 48) mux/src/ssh.rs:430— mux::ssh::connect_ssh_session has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 4 (9 pts), match/switch 3 (9 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mux::read_from_pane_pty (cognitive 39) mux/src/lib.rs:613— mux::read_from_pane_pty has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 5 (9 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.
mux::ssh::ssh_connect_with_ui (cognitive 37) mux/src/ssh.rs:62— mux::ssh::ssh_connect_with_ui has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (8 pts), match/switch 2 (6 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.
mux::tab::adjust_x_size (cognitive 23) mux/src/tab.rs:439— mux::tab::adjust_x_size has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (16 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (mux::tab::adjust_y_size) 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.
mux::tab::adjust_y_size (cognitive 23) mux/src/tab.rs:509— mux::tab::adjust_y_size has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (16 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (mux::tab::adjust_x_size) 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.
mux::pane::impl_get_logical_lines_via_get_lines (cognitive 18) mux/src/pane.rs:562— mux::pane::impl_get_logical_lines_via_get_lines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 pts), match/switch 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.
mux::pane_encoding::advance_escape (cognitive 17) mux/src/pane_encoding.rs:34— mux::pane_encoding::advance_escape has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3 (5 pts) (nesting depth added 6). 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.
Config::load_color_schemes (cognitive 37) config/src/config.rs:1965— Config::load_color_schemes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (26 pts), match/switch 1 (7 pts), loops 2 (4 pts) (nesting depth added 27). Of this number, 35 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Config::expand_tokens (cognitive 26) crates/wezterm-ssh/src/config.rs:677— Config::expand_tokens has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 2 (5 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.
Config::compute_extra_defaults (cognitive 22) config/src/config.rs:1815— Config::compute_extra_defaults has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts), match/switch 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.
Config::enumerate_hosts (cognitive 22) crates/wezterm-ssh/src/config.rs:778— Config::enumerate_hosts has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (10 pts), boolean chains 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Config::apply_cmd_defaults (cognitive 20) config/src/config.rs:2085— Config::apply_cmd_defaults has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::for_host (cognitive 19) crates/wezterm-ssh/src/config.rs:514— Config::for_host has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::try_load (cognitive 17) config/src/config.rs:1426— Config::try_load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, match/switch 3 (5 pts), boolean chains 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.
Config::load_with_window_overrides (cognitive 16) config/src/config.rs:1215— Config::load_with_window_overrides has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (15 lines × 2) crates/filedescriptor/src/unix.rs:310— crates/filedescriptor/src/unix.rs:310-324 | crates/filedescriptor/src/unix.rs:336-350 — both copies are in the same file, so extract the block into 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/wezterm-font/src/ftwrap.rs:267— crates/wezterm-font/src/ftwrap.rs:267-281 | crates/wezterm-font/src/ftwrap.rs:766-780 — both copies are in the same file, so extract the block into 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/wezterm-ssh/src/sessioninner.rs:111— crates/wezterm-ssh/src/sessioninner.rs:111-125 | crates/wezterm-ssh/src/sessioninner.rs:262-276 — both copies are in the same file, so extract the block into 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) kaku-gui/src/glyphcache.rs:1219— kaku-gui/src/glyphcache.rs:1219-1233 | kaku-gui/src/glyphcache.rs:1241-1255 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/ai_chat/state.rs:416— kaku-gui/src/overlay/ai_chat/state.rs:416-430 | kaku-gui/src/overlay/ai_chat/state.rs:439-453 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mod.rs:4326— kaku-gui/src/termwindow/mod.rs:4326-4340 | kaku-gui/src/termwindow/mod.rs:4350-4364 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:821— kaku-gui/src/update.rs:821-835 | kaku/src/update.rs:694-708 — before extracting anything, compare `kaku-gui/src/update.rs` and `kaku/src/update.rs` as WHOLE FILES: this scan already matched 6 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. 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 (15 lines × 2) termwiz/src/input.rs:735— termwiz/src/input.rs:735-751 | termwiz/src/input.rs:784-798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
kaku_remote::web::run_session (cyclomatic 116) crates/kaku-remote/src/web.rs:2785— kaku_remote::web::run_session has cyclomatic complexity 116 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kaku_remote::share::serve (cyclomatic 56) crates/kaku-remote/src/share.rs:819— kaku_remote::share::serve 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.
kaku_remote::web::handle_input (cyclomatic 40) crates/kaku-remote/src/web.rs:2484— kaku_remote::web::handle_input has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kaku_remote::p2p::wrap (cyclomatic 31) REDACTED:114— kaku_remote::p2p::wrap 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.
kaku_remote::p2p::carry (cyclomatic 31) REDACTED:705— kaku_remote::p2p::carry 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.
kaku_remote::web::handle_upload (cyclomatic 26) crates/kaku-remote/src/web.rs:1241— kaku_remote::web::handle_upload 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.
kaku_remote::share::advance (cyclomatic 21) crates/kaku-remote/src/share.rs:361— kaku_remote::share::advance 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::drain_tokens (cyclomatic 48) kaku-gui/src/overlay/ai_chat/state.rs:1823— App::drain_tokens has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
App::normalize_value (cyclomatic 23) kaku/src/config_tui/mod.rs:987— App::normalize_value 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.
App::submit (cyclomatic 23) kaku-gui/src/overlay/ai_chat/state.rs:1594— App::submit 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.
App::rebuild_display_cache (cyclomatic 22) kaku-gui/src/overlay/ai_chat/state.rs:1228— App::rebuild_display_cache 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.
App::start_edit (cyclomatic 20) kaku/src/ai_config/tui.rs:2428— App::start_edit 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.
App::to_lua_value (cyclomatic 20) kaku/src/config_tui/mod.rs:1501— App::to_lua_value 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.
App::activate_control (cyclomatic 19) kaku-gui/src/overlay/ai_chat/state.rs:1460— App::activate_control 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.
SessionInner::request_loop (cognitive 48) crates/wezterm-ssh/src/sessioninner.rs:426— SessionInner::request_loop has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 2 (10 pts), loops 4 (8 pts), boolean chains 4 (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.
SessionInner::authenticate (cognitive 35) crates/wezterm-ssh/src/auth.rs:255— SessionInner::authenticate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionInner::tick_io (cognitive 31) crates/wezterm-ssh/src/sessioninner.rs:533— SessionInner::tick_io has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionInner::pubkey_auth (cognitive 21) crates/wezterm-ssh/src/auth.rs:57— SessionInner::pubkey_auth has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (7 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionInner::authenticate_libssh (cognitive 21) crates/wezterm-ssh/src/auth.rs:132— SessionInner::authenticate_libssh has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 4 (7 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.
SessionInner::new_pty (cognitive 19) crates/wezterm-ssh/src/pty.rs:208— SessionInner::new_pty has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionInner::run_impl_libssh (cognitive 18) crates/wezterm-ssh/src/sessioninner.rs:110— SessionInner::run_impl_libssh has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 4). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: 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.
TabInner::remove_pane_if (cognitive 41) mux/src/tab.rs:2068— TabInner::remove_pane_if has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 2 (6 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.
TabInner::iter_panes_impl (cognitive 32) mux/src/tab.rs:1353— TabInner::iter_panes_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TabInner::get_pane_direction (cognitive 31) mux/src/tab.rs:1931— TabInner::get_pane_direction has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 3 (6 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabInner::split_and_insert (cognitive 31) mux/src/tab.rs:2427— TabInner::split_and_insert has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (21 pts), match/switch 5 (8 pts), boolean chains 2 (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.
TabInner::iter_splits (cognitive 30) mux/src/tab.rs:1431— TabInner::iter_splits has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabInner::toggle_pane_split_direction (cognitive 22) mux/src/tab.rs:1256— TabInner::toggle_pane_split_direction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 4 (6 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.
TabInner::adjust_pane_size (cognitive 21) mux/src/tab.rs:1851— TabInner::adjust_pane_size has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 4 (6 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (14 lines × 2) crates/wezterm-dynamic/derive/src/attr.rs:220— crates/wezterm-dynamic/derive/src/attr.rs:220-233 | crates/wezterm-dynamic/derive/src/attr.rs:240-253 — both copies are in the same file, so extract the block into 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/wezterm-escape-parser/src/csi.rs:1887— crates/wezterm-escape-parser/src/csi.rs:1887-1900 | crates/wezterm-escape-parser/src/csi.rs:1916-1929 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:338— kaku-gui/src/overlay/copy.rs:338-351 | kaku-gui/src/overlay/copy.rs:405-418 — both copies are in the same file, so extract the block into 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) kaku-gui/src/update.rs:290— kaku-gui/src/update.rs:290-303 | kaku/src/update.rs:956-969 — before extracting anything, compare `kaku-gui/src/update.rs` and `kaku/src/update.rs` as WHOLE FILES: this scan already matched 6 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) kaku/src/cli/rename_workspace.rs:38— kaku/src/cli/rename_workspace.rs:38-51 | kaku/src/cli/set_window_title.rs:38-51 — before extracting anything, compare `kaku/src/cli/rename_workspace.rs` and `kaku/src/cli/set_window_title.rs` as WHOLE FILES: this scan already matched 3 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 (14 lines × 2) mux/src/tab.rs:1310— mux/src/tab.rs:1310-1323 | mux/src/tab.rs:1332-1345 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mod.rs:5188— kaku-gui/src/termwindow/mod.rs:5188-5201 | kaku-gui/src/termwindow/mod.rs:5238-5251 — both copies are in the same file, so extract the block into 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/bidi/src/lib.rs:1162— crates/bidi/src/lib.rs:1162-1177 | crates/bidi/src/lib.rs:1186-1201 — both copies are in the same file, so extract the block into 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/color-types/src/lib.rs:673— crates/color-types/src/lib.rs:673-688 | crates/color-types/src/lib.rs:693-708 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/mod.rs:6000— kaku-gui/src/termwindow/mod.rs:6000-6015 | kaku/src/utils.rs:171-186 — 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 (16 lines × 2) mux/src/termwiztermtab.rs:495— mux/src/termwiztermtab.rs:495-510 | mux/src/termwiztermtab.rs:544-559 — both copies are in the same file, so extract the block into 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) term/src/terminalstate/mod.rs:64— term/src/terminalstate/mod.rs:64-79 | term/src/terminalstate/performer.rs:55-70 — before extracting anything, compare `term/src/terminalstate/mod.rs` and `term/src/terminalstate/performer.rs` as WHOLE FILES: this scan already matched 5 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 (16 lines × 2) crates/wezterm-ssh/src/host.rs:46— crates/wezterm-ssh/src/host.rs:46-61 | crates/wezterm-ssh/src/host.rs:160-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×5
Focus outline removed in CSS without a :focus replacement crates/kaku-remote/assets/web/index.html:70— `#bar .tab 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/kaku-remote/assets/web/index.html:122— `#find 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/kaku-remote/assets/web/index.html:169— `#dialog` 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/kaku-remote/assets/web/index.html:176— `#dialog button:focus-visible` 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/kaku-remote/assets/web/xterm.css:48— `.xterm.focus` 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.
Performer::osc_dispatch (cyclomatic 89) term/src/terminalstate/performer.rs:852— Performer::osc_dispatch 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.
Performer::remap_grapheme (cyclomatic 41) term/src/terminalstate/performer.rs:165— Performer::remap_grapheme has cyclomatic complexity 41 (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.
Performer::csi_dispatch (cyclomatic 31) term/src/terminalstate/performer.rs:596— Performer::csi_dispatch has cyclomatic complexity 31 (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.
Performer::control (cyclomatic 28) term/src/terminalstate/performer.rs:480— Performer::control 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.
Performer::perform (cyclomatic 16) term/src/terminalstate/performer.rs:350— Performer::perform 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. This is NOT this file's highest cyclomatic complexity: Performer::esc_dispatch (cyclomatic 27) 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.
CommandDef::recreate_menubar::command_rank_for_menu (cyclomatic 57) kaku-gui/src/commands.rs:721— CommandDef::recreate_menubar::command_rank_for_menu has cyclomatic complexity 57 (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 shape REPEATS in the file: 2 other methods here (CommandDef::recreate_menubar, CommandDef::recreate_menubar::separator_group_for_menu) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
CommandDef::actions_for_palette_only (cyclomatic 34) kaku-gui/src/commands.rs:208— CommandDef::actions_for_palette_only has cyclomatic complexity 34 (threshold 15). Of this number, 18 points are the body's own statements and 16 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommandDef::recreate_menubar (cyclomatic 24) kaku-gui/src/commands.rs:665— CommandDef::recreate_menubar has cyclomatic complexity 24 (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 shape REPEATS in the file: 2 other methods here (CommandDef::recreate_menubar::command_rank_for_menu, CommandDef::recreate_menubar::separator_group_for_menu) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
CommandDef::actions_for_palette_and_menubar (cyclomatic 23) kaku-gui/src/commands.rs:482— CommandDef::actions_for_palette_and_menubar 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.
CommandDef::recreate_menubar::separator_group_for_menu (cyclomatic 20) kaku-gui/src/commands.rs:801— CommandDef::recreate_menubar::separator_group_for_menu 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 shape REPEATS in the file: 2 other methods here (CommandDef::recreate_menubar, CommandDef::recreate_menubar::command_rank_for_menu) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
mux::parse_buffered_data (cyclomatic 25) mux/src/lib.rs:336— mux::parse_buffered_data 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.
mux::read_from_pane_pty (cyclomatic 22) mux/src/lib.rs:613— mux::read_from_pane_pty 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.
mux::ssh::connect_ssh_session (cyclomatic 22) mux/src/ssh.rs:430— mux::ssh::connect_ssh_session 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.
mux::pane_encoding::advance_escape (cyclomatic 17) mux/src/pane_encoding.rs:34— mux::pane_encoding::advance_escape 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.
mux::ssh::ssh_connect_with_ui (cyclomatic 16) mux/src/ssh.rs:62— mux::ssh::ssh_connect_with_ui 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.
Performer::osc_dispatch (cognitive 127) term/src/terminalstate/performer.rs:852— Performer::osc_dispatch has cognitive complexity 127 (threshold 15). Drivers by points: if/else 36 (84 pts), match/switch 13 (29 pts), loops 5 (14 pts) (nesting depth added 73). 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.
Performer::flush_print (cognitive 29) term/src/terminalstate/performer.rs:215— Performer::flush_print has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 12). Of this number, 25 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Performer::control (cognitive 29) term/src/terminalstate/performer.rs:480— Performer::control has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 3, match/switch 1 (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.
Performer::csi_dispatch (cognitive 25) term/src/terminalstate/performer.rs:596— Performer::csi_dispatch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 6 (10 pts), loops 2 (4 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Performer::device_control (cognitive 18) term/src/terminalstate/performer.rs:387— Performer::device_control has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 4 (8 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.
WindowView::key_common (cognitive 116) window/src/os/macos/window.rs:8708— WindowView::key_common has cognitive complexity 116 (threshold 15). Drivers by points: if/else 54 (78 pts), match/switch 8 (22 pts), boolean chains 16 (nesting depth added 38). Of this number, 111 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowView::did_resize (cognitive 112) window/src/os/macos/window.rs:9419— WindowView::did_resize has cognitive complexity 112 (threshold 15). Drivers by points: if/else 40 (90 pts), boolean chains 11, match/switch 4 (9 pts), loops 1 (2 pts) (nesting depth added 56). 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.
WindowView::scroll_wheel (cognitive 33) window/src/os/macos/window.rs:8565— WindowView::scroll_wheel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowView::did_exit_fullscreen (cognitive 27) window/src/os/macos/window.rs:9336— WindowView::did_exit_fullscreen has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (27 pts) (nesting depth added 16). 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.
WindowView::window_will_close (cognitive 16) window/src/os/macos/window.rs:8344— WindowView::window_will_close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
wezterm_client::domain::mux_notify_client_domain (cognitive 36) crates/wezterm-client/src/domain.rs:269— wezterm_client::domain::mux_notify_client_domain has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 5 (6 pts) (nesting depth added 20). 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.
wezterm_client::discovery::discover_gui_socks (cognitive 35) crates/wezterm-client/src/discovery.rs:78— wezterm_client::discovery::discover_gui_socks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 21). Of this number, 30 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
wezterm_client::client::unix_connect_with_retry (cognitive 19) crates/wezterm-client/src/client.rs:435— wezterm_client::client::unix_connect_with_retry has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 3 (6 pts), loops 2 (4 pts) (nesting depth added 11). 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.
wezterm_client::pane::renderable::hydrate_lines (cognitive 19) crates/wezterm-client/src/pane/renderable.rs:641— wezterm_client::pane::renderable::hydrate_lines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4, 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.
wezterm_client::client::client_thread_async (cognitive 18) crates/wezterm-client/src/client.rs:346— wezterm_client::client::client_thread_async has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Screen::scroll_up (cognitive 36) term/src/screen.rs:710— Screen::scroll_up has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (23 pts), loops 6 (9 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.
Screen::rewrap_lines (cognitive 32) term/src/screen.rs:109— Screen::rewrap_lines has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Screen::resize (cognitive 28) term/src/screen.rs:202— Screen::resize has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Screen::for_each_logical_line_in_stable_range_mut (cognitive 28) term/src/screen.rs:1063— Screen::for_each_logical_line_in_stable_range_mut has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Screen::for_each_logical_line_in_stable_range) 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.
Screen::for_each_logical_line_in_stable_range (cognitive 28) term/src/screen.rs:1142— Screen::for_each_logical_line_in_stable_range has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Screen::for_each_logical_line_in_stable_range_mut) 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.
CopyRenderable::move_to_end_of_word (cognitive 34) kaku-gui/src/overlay/copy.rs:1003— CopyRenderable::move_to_end_of_word has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (8 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CopyRenderable::move_by_zone (cognitive 24) kaku-gui/src/overlay/copy.rs:1047— CopyRenderable::move_by_zone has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (9 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.
CopyRenderable::move_forward_one_word (cognitive 20) kaku-gui/src/overlay/copy.rs:971— CopyRenderable::move_forward_one_word has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (20 pts) (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.
CopyRenderable::move_backward_one_word (cognitive 18) kaku-gui/src/overlay/copy.rs:916— CopyRenderable::move_backward_one_word has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, 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.
CopyRenderable::perform_jump (cognitive 17) kaku-gui/src/overlay/copy.rs:1099— CopyRenderable::perform_jump has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (17 lines × 2) kaku-gui/src/ai_client/mod.rs:272— kaku-gui/src/ai_client/mod.rs:272-288 | kaku-gui/src/ai_client/mod.rs:793-809 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5403— kaku-gui/src/customglyph.rs:5403-5419 | kaku-gui/src/customglyph.rs:5421-5437 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:252— kaku-gui/src/overlay/copy.rs:252-268 | kaku-gui/src/overlay/quickselect.rs:816-832 — before extracting anything, compare `kaku-gui/src/overlay/copy.rs` and `kaku-gui/src/overlay/quickselect.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 (17 lines × 2) term/src/terminalstate/mod.rs:2637— term/src/terminalstate/mod.rs:2637-2653 | term/src/terminalstate/mod.rs:2733-2749 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_tools/registry.rs:191— kaku-gui/src/ai_tools/registry.rs:191-207 | kaku-gui/src/ai_tools/registry.rs:254-270 — both copies are in the same file, so extract the block into 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 × 3) config/derive/src/attr.rs:21— config/derive/src/attr.rs:21-31 | crates/wezterm-dynamic/derive/src/attr.rs:17-27 | crates/wezterm-dynamic/derive/src/attr.rs:292-302 — before extracting anything, compare `config/derive/src/attr.rs` and `crates/wezterm-dynamic/derive/src/attr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 138 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 (11 lines × 3) crates/wezterm-escape-parser/src/csi.rs:2447— crates/wezterm-escape-parser/src/csi.rs:2447-2457 | crates/wezterm-escape-parser/src/csi.rs:2466-2476 | crates/wezterm-escape-parser/src/csi.rs:2484-2494 — 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) kaku-gui/src/termwindow/tab_rename.rs:876— kaku-gui/src/termwindow/tab_rename.rs:876-886 | kaku-gui/src/termwindow/tab_rename.rs:907-917 | kaku-gui/src/termwindow/tab_rename.rs:934-944 — 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) kaku/src/ai_config/tui/providers/mod.rs:471— kaku/src/ai_config/tui/providers/mod.rs:471-481 | kaku/src/ai_config/tui/providers/mod.rs:1545-1556 | kaku/src/ai_config/tui/providers/mod.rs:1598-1608 — 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) kaku/src/ai_config/tui/providers/mod.rs:1458— kaku/src/ai_config/tui/providers/mod.rs:1458-1468 | kaku/src/ai_config/tui/providers/mod.rs:1548-1558 | kaku/src/ai_config/tui/providers/mod.rs:1600-1610 — 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/wezterm-font/src/rasterizer/freetype.rs:654— crates/wezterm-font/src/rasterizer/freetype.rs:654-659 | crates/wezterm-font/src/rasterizer/freetype.rs:679-684 | crates/wezterm-font/src/rasterizer/freetype.rs:708-713 — 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/wezterm-font/src/rasterizer/freetype.rs:660— crates/wezterm-font/src/rasterizer/freetype.rs:660-665 | crates/wezterm-font/src/rasterizer/freetype.rs:685-690 | crates/wezterm-font/src/rasterizer/freetype.rs:714-719 — 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) kaku-gui/src/overlay/ai_chat/render.rs:842— kaku-gui/src/overlay/ai_chat/render.rs:842-847 | kaku-gui/src/overlay/ai_chat/render.rs:851-856 | kaku-gui/src/overlay/ai_chat/render.rs:866-871 — 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/wezterm-client/src/pane/clientpane.rs:360— crates/wezterm-client/src/pane/clientpane.rs:360-365 | kaku-gui/src/overlay/copy.rs:1216-1221 | mux/src/termwiztermtab.rs:235-240 — 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 (6 lines × 3) lua-api-crates/mux/src/pane.rs:211— lua-api-crates/mux/src/pane.rs:211-221 | lua-api-crates/mux/src/pane.rs:238-243 | lua-api-crates/mux/src/pane.rs:250-257 — 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.
Low cohesion: Element (LCOM4 13) kaku-gui/src/termwindow/box_model.rs:223— Element's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Config (LCOM4 9) config/src/config.rs:52— Config's methods fall into 9 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 9 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: Connection (LCOM4 9) window/src/os/macos/connection.rs:39— Connection's methods fall into 9 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 9 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: Window (LCOM4 5) window/src/os/macos/window.rs:757— Window's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: KakuAssistantConfig (LCOM4 4) kaku/src/ai_config/tui.rs:653— KakuAssistantConfig's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
GlyphCache::block_sprite (cyclomatic 73) kaku-gui/src/customglyph.rs:5175— GlyphCache::block_sprite has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent 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: BlockKey::from_char (cyclomatic 371) 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.
GlyphCache::load_glyph (cyclomatic 26) kaku-gui/src/glyphcache.rs:702— GlyphCache::load_glyph 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.
GlyphCache::line_sprite (cyclomatic 24) kaku-gui/src/glyphcache.rs:1184— GlyphCache::line_sprite 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.
GlyphCache::cached_image_impl (cyclomatic 17) kaku-gui/src/glyphcache.rs:931— GlyphCache::cached_image_impl 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.
GlyphCache::block_sprite (cognitive 97) kaku-gui/src/customglyph.rs:5175— GlyphCache::block_sprite has cognitive complexity 97 (threshold 15). Drivers by points: if/else 47 (76 pts), loops 6 (14 pts), match/switch 4 (7 pts) (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.
GlyphCache::load_glyph (cognitive 40) kaku-gui/src/glyphcache.rs:702— GlyphCache::load_glyph has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 9, 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.
GlyphCache::cached_image_impl (cognitive 36) kaku-gui/src/glyphcache.rs:931— GlyphCache::cached_image_impl has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (31 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 20). 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.
GlyphCache::line_sprite (cognitive 36) kaku-gui/src/glyphcache.rs:1184— GlyphCache::line_sprite has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 10 (13 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Face::compute_cap_height (cognitive 75) crates/wezterm-font/src/ftwrap.rs:973— Face::compute_cap_height has cognitive complexity 75 (threshold 15). Drivers by points: if/else 11 (48 pts), loops 9 (24 pts), match/switch 2, boolean chains 1 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Face::compute_coverage (cognitive 23) crates/wezterm-font/src/ftwrap.rs:386— Face::compute_coverage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Face::cell_metrics (cognitive 20) crates/wezterm-font/src/ftwrap.rs:1107— Face::cell_metrics has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Face::set_font_size (cognitive 19) crates/wezterm-font/src/ftwrap.rs:451— Face::set_font_size has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TmuxDomainState::advance (cognitive 55) mux/src/tmux.rs:87— TmuxDomainState::advance has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (45 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TmuxDomainState::sync_window_state (cognitive 50) mux/src/tmux_commands.rs:373— TmuxDomainState::sync_window_state has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 6 (17 pts), loops 4 (9 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TmuxDomainState::sync_pane_state (cognitive 43) mux/src/tmux_commands.rs:304— TmuxDomainState::sync_pane_state has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (35 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TmuxDomainState::subscribe_notification (cognitive 19) mux/src/tmux_commands.rs:569— TmuxDomainState::subscribe_notification has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 5 (8 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.
TooManyFields: Config config/src/config.rs:52— TooManyFields — 252 stored fields beside 32 methods. The bar is 30 stored fields; this is 222 over it, 8.40× 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: TermWindow kaku-gui/src/termwindow/mod.rs:1043— TooManyFields — 88 stored fields beside 306 methods. The bar is 30 stored fields; this is 58 over it, 2.93× 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: TerminalState term/src/terminalstate/mod.rs:302— TooManyFields — 74 stored fields beside 110 methods. The bar is 30 stored fields; this is 44 over it, 2.47× 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 kaku-gui/src/overlay/ai_chat/state.rs:704— TooManyFields — 47 stored fields beside 62 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×4
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×4
WindowView::key_common (cyclomatic 67) window/src/os/macos/window.rs:8708— WindowView::key_common has cyclomatic complexity 67 (threshold 15). Of this number, 65 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WindowView::did_resize (cyclomatic 51) window/src/os/macos/window.rs:9419— WindowView::did_resize has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WindowView::scroll_wheel (cyclomatic 21) window/src/os/macos/window.rs:8565— WindowView::scroll_wheel 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.
LauncherState::run_loop (cyclomatic 34) kaku-gui/src/overlay/launcher.rs:624— LauncherState::run_loop 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.
LauncherState::build_entries (cyclomatic 24) kaku-gui/src/overlay/launcher.rs:218— LauncherState::build_entries 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.
LauncherState::render (cyclomatic 20) kaku-gui/src/overlay/launcher.rs:406— LauncherState::render 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.
SessionInner::dispatch_one_request (cyclomatic 32) crates/wezterm-ssh/src/sessioninner.rs:623— SessionInner::dispatch_one_request 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.
SessionInner::request_loop (cyclomatic 20) crates/wezterm-ssh/src/sessioninner.rs:426— SessionInner::request_loop 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.
SessionInner::authenticate (cyclomatic 16) crates/wezterm-ssh/src/auth.rs:255— SessionInner::authenticate 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.
kaku_relay::device (cyclomatic 30) crates/kaku-relay/src/main.rs:508— kaku_relay::device has cyclomatic complexity 30 (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.
kaku_relay::serve_browser (cyclomatic 29) crates/kaku-relay/src/main.rs:1093— kaku_relay::serve_browser 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.
kaku_relay::serve_host (cyclomatic 26) crates/kaku-relay/src/main.rs:741— kaku_relay::serve_host 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.
GuiFrontEnd::try_new (cyclomatic 28) kaku-gui/src/frontend.rs:647— GuiFrontEnd::try_new has cyclomatic complexity 28 (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.
GuiFrontEnd::app_event_handler (cyclomatic 23) kaku-gui/src/frontend.rs:1116— GuiFrontEnd::app_event_handler has cyclomatic complexity 23 (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.
GuiFrontEnd::reconcile_workspace (cyclomatic 16) kaku-gui/src/frontend.rs:1259— GuiFrontEnd::reconcile_workspace 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.
ParsedFont::lua_fallback (cyclomatic 24) crates/wezterm-font/src/parser.rs:292— ParsedFont::lua_fallback 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.
ParsedFont::best_matching_index (cyclomatic 18) crates/wezterm-font/src/parser.rs:612— ParsedFont::best_matching_index 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.
ParsedFont::from_face (cyclomatic 17) crates/wezterm-font/src/parser.rs:385— ParsedFont::from_face 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.
TabInner::get_pane_direction (cyclomatic 20) mux/src/tab.rs:1931— TabInner::get_pane_direction 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.
TabInner::remove_pane_if (cyclomatic 17) mux/src/tab.rs:2068— TabInner::remove_pane_if 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.
TabInner::split_and_insert (cyclomatic 17) mux/src/tab.rs:2427— TabInner::split_and_insert 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.
CommandDef::recreate_menubar (cognitive 103) kaku-gui/src/commands.rs:665— CommandDef::recreate_menubar has cognitive complexity 103 (threshold 15). Drivers by points: if/else 17 (61 pts), match/switch 15 (29 pts), loops 6 (13 pts) (nesting depth added 65). Of this number, 75 points are the body's own statements and 28 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandDef::actions_for_palette_and_menubar (cognitive 57) kaku-gui/src/commands.rs:482— CommandDef::actions_for_palette_and_menubar has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 7 (11 pts), match/switch 2 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CommandDef::actions_for_palette_only (cognitive 43) kaku-gui/src/commands.rs:208— CommandDef::actions_for_palette_only has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 6 (8 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 15). Of this number, 31 points are the body's own statements and 12 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigInner::watch_path (cognitive 65) config/src/lib.rs:1864— ConfigInner::watch_path has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 6 (18 pts), loops 2 (9 pts) (nesting depth added 43). Of this number, 58 points are the body's own statements and 7 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.
ConfigInner::unwatch_stale_paths (cognitive 32) config/src/lib.rs:1998— ConfigInner::unwatch_stale_paths has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ConfigInner::apply_loaded (cognitive 20) config/src/lib.rs:2052— ConfigInner::apply_loaded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (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.
kaku_relay::serve_host (cognitive 58) crates/kaku-relay/src/main.rs:741— kaku_relay::serve_host has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (47 pts), match/switch 4 (8 pts), loops 2, boolean chains 1 (nesting depth added 38). 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.
kaku_relay::serve_browser (cognitive 54) crates/kaku-relay/src/main.rs:1093— kaku_relay::serve_browser has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (32 pts), match/switch 6 (16 pts), boolean chains 4, loops 2 (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.
kaku_relay::device (cognitive 16) crates/kaku-relay/src/main.rs:508— kaku_relay::device has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 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.
LauncherState::run_loop (cognitive 52) kaku-gui/src/overlay/launcher.rs:624— LauncherState::run_loop has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (44 pts), boolean chains 5, match/switch 1 (2 pts), loops 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.
LauncherState::render (cognitive 47) kaku-gui/src/overlay/launcher.rs:406— LauncherState::render has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (44 pts), boolean chains 2, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LauncherState::build_entries (cognitive 44) kaku-gui/src/overlay/launcher.rs:218— LauncherState::build_entries has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 7 (12 pts), match/switch 3 (10 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.
WindowInner::refresh_after_display_change (cognitive 52) window/src/os/macos/window.rs:2923— WindowInner::refresh_after_display_change has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (49 pts), boolean chains 3 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WindowInner::update_window_shadow (cognitive 28) window/src/os/macos/window.rs:2714— WindowInner::update_window_shadow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 1 (4 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.
WindowInner::toggle_simple_fullscreen (cognitive 19) window/src/os/macos/window.rs:2596— WindowInner::toggle_simple_fullscreen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParsedFont::lua_fallback (cognitive 50) crates/wezterm-font/src/parser.rs:292— ParsedFont::lua_fallback has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 4 (10 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.
ParsedFont::from_face (cognitive 27) crates/wezterm-font/src/parser.rs:385— ParsedFont::from_face has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (4 pts), match/switch 4, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParsedFont::best_matching_index (cognitive 23) crates/wezterm-font/src/parser.rs:612— ParsedFont::best_matching_index has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), match/switch 5 (9 pts), boolean chains 2 (nesting depth added 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.
FontConfigInner::match_style (cognitive 43) crates/wezterm-font/src/lib.rs:1131— FontConfigInner::match_style has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (38 pts), match/switch 2 (4 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.
FontConfigInner::resolve_font_helper_impl (cognitive 32) crates/wezterm-font/src/lib.rs:780— FontConfigInner::resolve_font_helper_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 6 (12 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.
FontConfigInner::resolve_font (cognitive 27) crates/wezterm-font/src/lib.rs:931— FontConfigInner::resolve_font has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, 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.
CellCluster::make_cluster (cognitive 43) crates/wezterm-surface/src/cellcluster.rs:50— CellCluster::make_cluster has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CellCluster::resolve_bidi (cognitive 21) crates/wezterm-surface/src/cellcluster.rs:169— CellCluster::resolve_bidi has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 3 (9 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CellCluster::add (cognitive 16) crates/wezterm-surface/src/cellcluster.rs:275— CellCluster::add has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LocalPane::search (cognitive 36) mux/src/localpane.rs:768— LocalPane::search has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (13 pts), match/switch 5 (7 pts) (nesting depth added 15). Of this number, 31 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalPane::is_dead (cognitive 32) mux/src/localpane.rs:288— LocalPane::is_dead has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 6 (12 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.
LocalPane::can_close_without_prompting (cognitive 16) mux/src/localpane.rs:654— LocalPane::can_close_without_prompting has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 4 (6 pts) (nesting depth added 7). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GuiFrontEnd::reconcile_workspace (cognitive 31) kaku-gui/src/frontend.rs:1259— GuiFrontEnd::reconcile_workspace has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuiFrontEnd::try_new (cognitive 23) kaku-gui/src/frontend.rs:647— GuiFrontEnd::try_new has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuiFrontEnd::app_event_handler (cognitive 22) kaku-gui/src/frontend.rs:1116— GuiFrontEnd::app_event_handler has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (18 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
window::os::macos::app::application_open_untitled_file (cognitive 30) window/src/os/macos/app.rs:1278— window::os::macos::app::application_open_untitled_file has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 1 (4 pts) (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.
window::os::macos::window::on_app_terminating (cognitive 26) window/src/os/macos/window.rs:1684— window::os::macos::window::on_app_terminating has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 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.
window::os::macos::app::flush_pending_service_opens (cognitive 16) window/src/os/macos/app.rs:1548— window::os::macos::app::flush_pending_service_opens has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Line::changes (cognitive 29) crates/wezterm-surface/src/line/line.rs:1187— Line::changes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 1 (nesting depth added 16). 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.
Line::compute_zones (cognitive 17) crates/wezterm-surface/src/line/line.rs:426— Line::compute_zones has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Line::apply_hyperlink_rules (cognitive 17) crates/wezterm-surface/src/line/line.rs:571— Line::apply_hyperlink_rules has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reconnectable::tls_connect (cognitive 28) crates/wezterm-client/src/client.rs:791— Reconnectable::tls_connect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (9 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.
Reconnectable::unix_connect (cognitive 24) crates/wezterm-client/src/client.rs:712— Reconnectable::unix_connect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reconnectable::try_connect (cognitive 17) crates/wezterm-client/src/client.rs:924— Reconnectable::try_connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), match/switch 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.
CommandPalette::compute (cognitive 24) kaku-gui/src/termwindow/palette.rs:543— CommandPalette::compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandPalette::mouse_event (cognitive 17) kaku-gui/src/termwindow/palette.rs:1008— CommandPalette::mouse_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
CommandPalette::computed_element (cognitive 17) kaku-gui/src/termwindow/palette.rs:1138— CommandPalette::computed_element has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (4 members, 50+ identical tokens) config/derive/src/attr.rs:15— config/derive/src/attr.rs:15-61 | config/derive/src/attr.rs:131-279 | crates/wezterm-dynamic/derive/src/attr.rs:11-57 | crates/wezterm-dynamic/derive/src/attr.rs:281-372 — 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) kaku/src/ai_config/tui/ui.rs:358— kaku/src/ai_config/tui/ui.rs:358-430 | kaku/src/ai_config/tui/ui.rs:432-538 | kaku/src/config_tui/ui.rs:367-445 | kaku/src/config_tui/ui.rs:447-517 — 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) kaku/src/cli/activate_tab.rs:48— kaku/src/cli/activate_tab.rs:48-158 | kaku/src/cli/rename_workspace.rs:26-63 | kaku/src/cli/set_tab_title.rs:25-67 | kaku/src/cli/set_window_title.rs:26-63 — 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 (29 lines × 2) crates/wezterm-font/src/ftwrap.rs:1517— crates/wezterm-font/src/ftwrap.rs:1517-1545 | crates/wezterm-font/src/rasterizer/harfbuzz.rs:378-406 — 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 (29 lines × 2) kaku-gui/src/overlay/copy.rs:1605— kaku-gui/src/overlay/copy.rs:1605-1633 | kaku-gui/src/overlay/copy.rs:1697-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 (29 lines × 2) mux/src/tab.rs:971— mux/src/tab.rs:971-999 | mux/src/tab.rs:1028-1056 — both copies are in the same file, so extract the block into 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/wezterm-surface/src/line/clusterline.rs:207— crates/wezterm-surface/src/line/clusterline.rs:207-224 | crates/wezterm-surface/src/line/clusterline.rs:252-269 — both copies are in the same file, so extract the block into 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) kaku-gui/src/customglyph.rs:5630— kaku-gui/src/customglyph.rs:5630-5647 | kaku-gui/src/customglyph.rs:5799-5816 — both copies are in the same file, so extract the block into 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) window/src/os/macos/window.rs:9890— window/src/os/macos/window.rs:9890-9907 | window/src/os/macos/window.rs:9914-9931 — both copies are in the same file, so extract the block into 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 × 3) kaku-gui/src/overlay/ai_chat/types.rs:30— kaku-gui/src/overlay/ai_chat/types.rs:30-36 | kaku/src/kaku_theme.rs:49-55 | kaku/src/tui_core/theme.rs:28-34 — 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 (7 lines × 3) kaku/src/ai_config/tui/providers/mod.rs:1401— kaku/src/ai_config/tui/providers/mod.rs:1401-1407 | kaku/src/ai_config/tui/providers/mod.rs:1808-1814 | kaku/src/ai_config/tui/providers/mod.rs:2070-2076 — 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) kaku/src/reset.rs:458— kaku/src/reset.rs:458-464 | kaku/src/reset.rs:547-553 | kaku/src/reset.rs:649-655 — 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.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×2
Animation without a prefers-reduced-motion guard crates/kaku-remote/assets/web/index.html:56— `#bar .dot.in` moves (`animation: dot-in 0.25s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/kaku-remote/assets/web/index.html:57— `#bar .dot.out` moves (`animation: dot-out 0.3s ease-in 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.
KeyCode::encode (cyclomatic 111) termwiz/src/input.rs:235— KeyCode::encode has cyclomatic complexity 111 (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.
KeyCode::try_from (cyclomatic 77) crates/wezterm-input-types/src/lib.rs:341— KeyCode::try_from has cyclomatic complexity 77 (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: PhysKeyCode::to_key_code (cyclomatic 117) 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.
TerminfoRenderer::render_to (cyclomatic 79) termwiz/src/render/terminfo.rs:337— TerminfoRenderer::render_to has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TerminfoRenderer::flush_pending_attr (cyclomatic 38) termwiz/src/render/terminfo.rs:55— TerminfoRenderer::flush_pending_attr has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CSIParser::sgr (cyclomatic 77) crates/wezterm-escape-parser/src/csi.rs:2686— CSIParser::sgr has cyclomatic complexity 77 (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.
CSIParser::window (cyclomatic 40) crates/wezterm-escape-parser/src/csi.rs:2583— CSIParser::window has cyclomatic complexity 40 (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: CSIParser::parse_next (cyclomatic 74) 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.
BidiContext::explicit_embedding_levels (cyclomatic 47) crates/bidi/src/lib.rs:1337— BidiContext::explicit_embedding_levels 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.
BidiContext::reverse_levels (cyclomatic 19) crates/bidi/src/lib.rs:355— BidiContext::reverse_levels 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.
OperatingSystemCommand::internal_parse (cyclomatic 35) crates/wezterm-escape-parser/src/osc.rs:257— OperatingSystemCommand::internal_parse has cyclomatic complexity 35 (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.
OperatingSystemCommand::fmt (cyclomatic 32) crates/wezterm-escape-parser/src/osc.rs:558— OperatingSystemCommand::fmt 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.
wezterm_mux_server_impl::dispatch::process_async (cyclomatic 31) crates/wezterm-mux-server-impl/src/dispatch.rs:37— wezterm_mux_server_impl::dispatch::process_async has cyclomatic complexity 31 (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.
wezterm_mux_server_impl::update_mux_domains_impl (cyclomatic 16) crates/wezterm-mux-server-impl/src/lib.rs:45— wezterm_mux_server_impl::update_mux_domains_impl 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.
SelectorState::run_loop (cyclomatic 31) kaku-gui/src/overlay/selector.rs:242— SelectorState::run_loop 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.
SelectorState::render (cyclomatic 16) kaku-gui/src/overlay/selector.rs:94— SelectorState::render 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.
TmuxDomainState::advance (cyclomatic 31) mux/src/tmux.rs:87— TmuxDomainState::advance 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.
TmuxDomainState::sync_window_state (cyclomatic 20) mux/src/tmux_commands.rs:373— TmuxDomainState::sync_window_state 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.
wezterm_font::rasterizer::colr::apply_sweep_gradient_patches (cyclomatic 28) crates/wezterm-font/src/rasterizer/colr.rs:298— wezterm_font::rasterizer::colr::apply_sweep_gradient_patches 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.
wezterm_font::rasterizer::harfbuzz::record_to_cairo_surface (cyclomatic 16) crates/wezterm-font/src/rasterizer/harfbuzz.rs:104— wezterm_font::rasterizer::harfbuzz::record_to_cairo_surface 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. This is NOT this file's highest cyclomatic complexity: wezterm_font::rasterizer::harfbuzz::hb_paint_mode_to_operator (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.
LocalPane::is_dead (cyclomatic 23) mux/src/localpane.rs:288— LocalPane::is_dead 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.
LocalPane::search (cyclomatic 22) mux/src/localpane.rs:768— LocalPane::search has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Screen::scroll_up (cyclomatic 22) term/src/screen.rs:710— Screen::scroll_up 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.
Screen::resize (cyclomatic 16) term/src/screen.rs:202— Screen::resize 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.
TerminfoRenderer::render_to (cognitive 163) termwiz/src/render/terminfo.rs:337— TerminfoRenderer::render_to has cognitive complexity 163 (threshold 15). Drivers by points: if/else 33 (112 pts), loops 5 (26 pts), match/switch 7 (23 pts), boolean chains 2 (nesting depth added 116). 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.
TerminfoRenderer::flush_pending_attr (cognitive 96) termwiz/src/render/terminfo.rs:55— TerminfoRenderer::flush_pending_attr has cognitive complexity 96 (threshold 15). Drivers by points: if/else 37 (74 pts), match/switch 6 (20 pts), boolean chains 2 (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.
wezterm_config_derive::attr::field_info (cognitive 101) config/derive/src/attr.rs:131— wezterm_config_derive::attr::field_info has cognitive complexity 101 (threshold 15). Drivers by points: if/else 18 (75 pts), match/switch 8 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wezterm_config_derive::attr::container_info (cognitive 28) config/derive/src/attr.rs:15— wezterm_config_derive::attr::container_info has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabBarState::new (cognitive 77) kaku-gui/src/tabbar.rs:1004— TabBarState::new has cognitive complexity 77 (threshold 15). Drivers by points: if/else 40 (56 pts), loops 6 (11 pts), boolean chains 7, match/switch 1 (3 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.
TabBarState::integrated_title_buttons (cognitive 19) kaku-gui/src/tabbar.rs:912— TabBarState::integrated_title_buttons has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wezterm_dynamic_derive::attr::field_info (cognitive 76) crates/wezterm-dynamic/derive/src/attr.rs:281— wezterm_dynamic_derive::attr::field_info has cognitive complexity 76 (threshold 15). Drivers by points: if/else 16 (68 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wezterm_dynamic_derive::attr::container_info (cognitive 28) crates/wezterm-dynamic/derive/src/attr.rs:11— wezterm_dynamic_derive::attr::container_info has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wezterm_font::rasterizer::colr::apply_sweep_gradient_patches (cognitive 73) crates/wezterm-font/src/rasterizer/colr.rs:298— wezterm_font::rasterizer::colr::apply_sweep_gradient_patches has cognitive complexity 73 (threshold 15). Drivers by points: if/else 25 (55 pts), loops 7 (17 pts), boolean chains 1 (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.
wezterm_font::rasterizer::crop_to_non_transparent (cognitive 28) crates/wezterm-font/src/rasterizer/mod.rs:69— wezterm_font::rasterizer::crop_to_non_transparent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (14 pts), match/switch 2 (8 pts), loops 4 (6 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.
SelectorState::run_loop (cognitive 47) kaku-gui/src/overlay/selector.rs:242— SelectorState::run_loop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (40 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectorState::render (cognitive 36) kaku-gui/src/overlay/selector.rs:94— SelectorState::render has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextFontLocator::locate_fallback_for_codepoints (cognitive 40) crates/wezterm-font/src/locator/core_text.rs:151— CoreTextFontLocator::locate_fallback_for_codepoints has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 5 (8 pts), boolean chains 2 (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.
CoreTextFontLocator::load_fonts (cognitive 20) crates/wezterm-font/src/locator/core_text.rs:91— CoreTextFontLocator::load_fonts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wezterm_mux_server_impl::dispatch::process_async (cognitive 37) crates/wezterm-mux-server-impl/src/dispatch.rs:37— wezterm_mux_server_impl::dispatch::process_async has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (25 pts), match/switch 4 (11 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.
wezterm_mux_server_impl::update_mux_domains_impl (cognitive 30) crates/wezterm-mux-server-impl/src/lib.rs:45— wezterm_mux_server_impl::update_mux_domains_impl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (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.
Surface::repaint_all (cognitive 36) crates/wezterm-surface/src/lib.rs:580— Surface::repaint_all has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 5 (13 pts), loops 3, 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.
Surface::print_text (cognitive 21) crates/wezterm-surface/src/lib.rs:430— Surface::print_text has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 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.
InputParser::process_bytes (cognitive 34) termwiz/src/input.rs:1064— InputParser::process_bytes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 3 (10 pts), boolean chains 3, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputParser::build_basic_key_map (cognitive 33) termwiz/src/input.rs:640— InputParser::build_basic_key_map has cognitive complexity 33 (threshold 15). Drivers by points: loops 17 (26 pts), match/switch 1 (4 pts), if/else 1 (3 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CopyOverlay::with_lines_mut (cognitive 32) kaku-gui/src/overlay/copy.rs:1522— CopyOverlay::with_lines_mut has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (8 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopyOverlay::get_lines (cognitive 29) kaku-gui/src/overlay/copy.rs:1645— CopyOverlay::get_lines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (8 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderableInner::apply_changes_to_surface (cognitive 26) crates/wezterm-client/src/pane/renderable.rs:303— RenderableInner::apply_changes_to_surface has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 7 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RenderableInner::apply_lines (cognitive 18) crates/wezterm-client/src/pane/renderable.rs:531— RenderableInner::apply_lines has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (10 pts), match/switch 2 (7 pts), if/else 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MuxPane::get_text_from_semantic_zone (cognitive 25) lua-api-crates/mux/src/pane.rs:22— MuxPane::get_text_from_semantic_zone has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MuxPane::add_methods (cognitive 16) lua-api-crates/mux/src/pane.rs:88— MuxPane::add_methods has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (8 pts), loops 4 (6 pts), if/else 2 (nesting depth added 4). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SerializedLines::extract_data (cognitive 22) crates/codec/src/lib.rs:989— SerializedLines::extract_data has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (11 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.
SerializedLines::from (cognitive 20) crates/codec/src/lib.rs:1018— SerializedLines::from has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), match/switch 1 (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.
config::collect_user_color_schemes (cognitive 20) config/src/lib.rs:225— config::collect_user_color_schemes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config::lua::config_builder_new_index (cognitive 19) config/src/lua.rs:103— config::lua::config_builder_new_index has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), loops 1 (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.
Tui::drain_stream (cognitive 20) kaku-gui/src/cli_chat/mod.rs:354— Tui::drain_stream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (3 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.
Tui::all_display_lines (cognitive 18) kaku-gui/src/cli_chat/mod.rs:311— Tui::all_display_lines has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
tabout::tabulate_output (cognitive 16) crates/tabout/src/lib.rs:62— tabout::tabulate_output has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (7 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. This shape REPEATS in the file: one other method here (tabout::tabulate_for_terminal) 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.
tabout::tabulate_for_terminal (cognitive 16) crates/tabout/src/lib.rs:165— tabout::tabulate_for_terminal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (7 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. This shape REPEATS in the file: one other method here (tabout::tabulate_output) 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.
Duplicated block (61 lines × 2) config/derive/src/attr.rs:203— config/derive/src/attr.rs:203-263 | crates/wezterm-dynamic/derive/src/attr.rs:299-359 — before extracting anything, compare `config/derive/src/attr.rs` and `crates/wezterm-dynamic/derive/src/attr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 138 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 (61 lines × 2) crates/wezterm-font/src/rasterizer/freetype.rs:845— crates/wezterm-font/src/rasterizer/freetype.rs:845-905 | crates/wezterm-font/src/rasterizer/harfbuzz.rs:176-236 — 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 (25 lines × 2) crates/wezterm-cell/src/lib.rs:231— crates/wezterm-cell/src/lib.rs:231-255 | crates/wezterm-cell/src/lib.rs:267-291 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/launcher.rs:415— kaku-gui/src/overlay/launcher.rs:415-439 | kaku-gui/src/overlay/selector.rs:102-126 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (23 lines × 2) kaku-gui/src/inputmap.rs:179— kaku-gui/src/inputmap.rs:179-201 | kaku-gui/src/inputmap.rs:251-273 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/ui.rs:408— kaku/src/ai_config/tui/ui.rs:408-430 | kaku/src/config_tui/ui.rs:495-517 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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 (22 lines × 2) kaku-gui/src/overlay/launcher.rs:521— kaku-gui/src/overlay/launcher.rs:521-542 | kaku-gui/src/overlay/selector.rs:184-205 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 lines × 2) kaku-gui/src/termwindow/box_model.rs:982— kaku-gui/src/termwindow/box_model.rs:982-1003 | kaku-gui/src/termwindow/box_model.rs:1013-1034 — both copies are in the same file, so extract the block into 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 × 3) crates/wezterm-font/src/rasterizer/freetype.rs:194— crates/wezterm-font/src/rasterizer/freetype.rs:194-205 | crates/wezterm-font/src/rasterizer/freetype.rs:246-258 | crates/wezterm-font/src/rasterizer/freetype.rs:299-311 — 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 × 3) kaku-gui/src/ai_chat_engine/mod.rs:566— kaku-gui/src/ai_chat_engine/mod.rs:566-578 | kaku-gui/src/ai_chat_engine/mod.rs:584-595 | kaku-gui/src/ai_chat_engine/mod.rs:601-612 — 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 × 4) config/derive/src/attr.rs:37— config/derive/src/attr.rs:37-48 | config/derive/src/attr.rs:226-237 | crates/wezterm-dynamic/derive/src/attr.rs:33-44 | crates/wezterm-dynamic/derive/src/attr.rs:322-333 — before extracting anything, compare `config/derive/src/attr.rs` and `crates/wezterm-dynamic/derive/src/attr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 138 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 × 4) kaku/src/cli/activate_tab.rs:73— kaku/src/cli/activate_tab.rs:73-84 | kaku/src/cli/rename_workspace.rs:38-49 | kaku/src/cli/set_tab_title.rs:37-48 | kaku/src/cli/set_window_title.rs:38-49 — before extracting anything, compare `kaku/src/cli/rename_workspace.rs` and `kaku/src/cli/set_window_title.rs` as WHOLE FILES: this scan already matched 3 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 (12 lines × 3) mux/src/tab.rs:1782— mux/src/tab.rs:1782-1795 | mux/src/tab.rs:1824-1835 | mux/src/tab.rs:2082-2095 — 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) mux/src/tmux_commands.rs:1003— mux/src/tmux_commands.rs:1003-1014 | mux/src/tmux_commands.rs:1087-1098 | mux/src/tmux_commands.rs:1201-1212 — 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–12 lines × 2) crates/codec/src/lib.rs:214— crates/codec/src/lib.rs:214-223 | crates/codec/src/lib.rs:260-271 — both copies are in the same file, so extract the block into 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–12 lines × 2) kaku-gui/src/overlay/ai_chat/render.rs:467— kaku-gui/src/overlay/ai_chat/render.rs:467-478 | kaku-gui/src/overlay/ai_chat/render.rs:751-760 — both copies are in the same file, so extract the block into 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) kaku-gui/src/glyphcache.rs:1208— kaku-gui/src/glyphcache.rs:1208-1217 | kaku-gui/src/glyphcache.rs:1231-1239 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/copy.rs:357— kaku-gui/src/overlay/copy.rs:357-365 | kaku-gui/src/overlay/copy.rs:424-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) mux/src/lib.rs:1763— mux/src/lib.rs:1763-1770 | mux/src/lib.rs:1820-1829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) mux/src/tmux_commands.rs:703— mux/src/tmux_commands.rs:703-712 | mux/src/tmux_commands.rs:813-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 × 3) kaku-gui/src/termwindow/mod.rs:5253— kaku-gui/src/termwindow/mod.rs:5253-5261 | kaku-gui/src/termwindow/mod.rs:5266-5274 | kaku-gui/src/termwindow/mod.rs:5282-5290 — 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) kaku/src/cli/rename_workspace.rs:27— kaku/src/cli/rename_workspace.rs:27-35 | kaku/src/cli/set_tab_title.rs:26-34 | kaku/src/cli/set_window_title.rs:27-35 — before extracting anything, compare `kaku/src/cli/rename_workspace.rs` and `kaku/src/cli/set_window_title.rs` as WHOLE FILES: this scan already matched 3 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 × 3) kaku-gui/src/termwindow/tab_rename.rs:864— kaku-gui/src/termwindow/tab_rename.rs:864-868 | kaku-gui/src/termwindow/tab_rename.rs:894-898 | kaku-gui/src/termwindow/tab_rename.rs:928-932 — 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) kaku/src/ai_config/tui/providers/assistant.rs:518— kaku/src/ai_config/tui/providers/assistant.rs:518-522 | kaku/src/ai_config/tui/providers/assistant.rs:524-528 | kaku/src/ai_config/tui/providers/assistant.rs:557-561 — 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.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark crates/kaku-remote/assets/web/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
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 2 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.
PhysKeyCode::for_each_code (cyclomatic 321) crates/wezterm-input-types/src/lib.rs:1018— PhysKeyCode::for_each_code has cyclomatic complexity 321 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KeyEvent::encode_kitty (cyclomatic 111) crates/wezterm-input-types/src/lib.rs:1660— KeyEvent::encode_kitty has cyclomatic complexity 111 (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: PhysKeyCode::to_key_code (cyclomatic 117) 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.
SessionHandler::process_one (cyclomatic 58) crates/wezterm-mux-server-impl/src/sessionhandler.rs:246— SessionHandler::process_one has cyclomatic complexity 58 (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.
ITermProprietary::parse (cyclomatic 51) crates/wezterm-escape-parser/src/osc.rs:1467— ITermProprietary::parse has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Sgr::fmt (cyclomatic 50) crates/wezterm-escape-parser/src/csi.rs:1507— Sgr::fmt has cyclomatic complexity 50 (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: CSIParser::parse_next (cyclomatic 74) 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.
TabBarState::new (cyclomatic 42) kaku-gui/src/tabbar.rs:1004— TabBarState::new has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Value::add_methods (cyclomatic 41) lua-api-crates/share-data/src/lib.rs:273— Value::add_methods has cyclomatic complexity 41 (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.
wezterm_config_derive::attr::field_info (cyclomatic 35) config/derive/src/attr.rs:131— wezterm_config_derive::attr::field_info 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.
AiClient::chat_step (cyclomatic 33) kaku-gui/src/ai_client/mod.rs:461— AiClient::chat_step 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.
Cursor::fmt (cyclomatic 31) crates/wezterm-escape-parser/src/csi.rs:1296— Cursor::fmt has cyclomatic complexity 31 (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: CSIParser::parse_next (cyclomatic 74) 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.
MouseReport::fmt (cyclomatic 30) crates/wezterm-escape-parser/src/csi.rs:686— MouseReport::fmt has cyclomatic complexity 30 (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: CSIParser::parse_next (cyclomatic 74) 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.
HarfbuzzShaper::do_shape (cyclomatic 30) crates/wezterm-font/src/shaper/harfbuzz.rs:203— HarfbuzzShaper::do_shape 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.
LineEditor::apply_action (cyclomatic 29) termwiz/src/lineedit/mod.rs:677— LineEditor::apply_action 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.
wezterm_escape_parser::tmux_cc::unvis_bytes::unvis_byte (cyclomatic 28) crates/wezterm-escape-parser/src/tmux_cc/mod.rs:538— wezterm_escape_parser::tmux_cc::unvis_bytes::unvis_byte has cyclomatic complexity 28 (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: wezterm_escape_parser::tmux_cc::parse_line (cyclomatic 29) 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.
ProgramStatus::parse (cyclomatic 27) crates/wezterm-escape-parser/src/osc.rs:985— ProgramStatus::parse has cyclomatic complexity 27 (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.
Face::compute_cap_height (cyclomatic 27) crates/wezterm-font/src/ftwrap.rs:973— Face::compute_cap_height has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: wezterm_font::ftwrap::composite_mode_to_operator (cyclomatic 29) 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.
VTParser::action (cyclomatic 26) crates/vtparse/src/lib.rs:526— VTParser::action has cyclomatic complexity 26 (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.
ParsedConfigFile::parse_impl (cyclomatic 26) crates/wezterm-ssh/src/config.rs:228— ParsedConfigFile::parse_impl has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SrgbaTuple::from_str (cyclomatic 25) crates/color-types/src/lib.rs:778— SrgbaTuple::from_str has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
luahelper::lua_value_to_dynamic_impl (cyclomatic 25) crates/luahelper/src/lib.rs:108— luahelper::lua_value_to_dynamic_impl has cyclomatic complexity 25 (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.
share_data::lua_value_to_gvalue_impl (cyclomatic 25) lua-api-crates/share-data/src/lib.rs:101— share_data::lua_value_to_gvalue_impl has cyclomatic complexity 25 (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.
serde_funcs::lua_value_to_json_value (cyclomatic 25) lua-api-crates/serde-funcs/src/lib.rs:152— serde_funcs::lua_value_to_json_value has cyclomatic complexity 25 (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.
ToolState::load_with_usage (cyclomatic 23) kaku/src/ai_config/tui.rs:194— ToolState::load_with_usage has cyclomatic complexity 23 (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.
InputParser::build_basic_key_map (cyclomatic 23) termwiz/src/input.rs:640— InputParser::build_basic_key_map has cyclomatic complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LineEditBuffer::eval_movement (cyclomatic 23) termwiz/src/lineedit/buffer.rs:83— LineEditBuffer::eval_movement 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.
ValuePrinterHelper::fmt (cyclomatic 22) crates/luahelper/src/lib.rs:344— ValuePrinterHelper::fmt has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
wezterm_dynamic_derive::attr::field_info (cyclomatic 22) crates/wezterm-dynamic/derive/src/attr.rs:281— wezterm_dynamic_derive::attr::field_info 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.
ConfigInner::watch_path (cyclomatic 21) config/src/lib.rs:1864— ConfigInner::watch_path has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FinalTermSemanticPrompt::parse (cyclomatic 21) crates/wezterm-escape-parser/src/osc.rs:767— FinalTermSemanticPrompt::parse 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.
Surface::repaint_all (cyclomatic 21) crates/wezterm-surface/src/lib.rs:580— Surface::repaint_all 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.
WebGpuState::new_impl (cyclomatic 21) kaku-gui/src/termwindow/webgpu.rs:225— WebGpuState::new_impl 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.
ClientDomain::process_pane_list (cyclomatic 20) crates/wezterm-client/src/domain.rs:504— ClientDomain::process_pane_list 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.
wezterm_client::domain::mux_notify_client_domain (cyclomatic 20) crates/wezterm-client/src/domain.rs:269— wezterm_client::domain::mux_notify_client_domain 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.
FontConfigInner::match_style (cyclomatic 20) crates/wezterm-font/src/lib.rs:1131— FontConfigInner::match_style 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.
Tui::drain_stream (cyclomatic 20) kaku-gui/src/cli_chat/mod.rs:354— Tui::drain_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.
WcLookupTable::new (cyclomatic 19) crates/wezterm-char-props/src/widechar_width.rs:1603— WcLookupTable::new has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
svg_to_poly.parse (cyclomatic 19) scripts/svg_to_poly.py:16— svg_to_poly.parse 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.
config::proxy::parse_scutil_proxy (cyclomatic 18) config/src/proxy.rs:47— config::proxy::parse_scutil_proxy has cyclomatic complexity 18 (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.
Shown::update (cyclomatic 18) crates/kaku-remote/src/web.rs:2026— Shown::update 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.
CoreTextFontLocator::locate_fallback_for_codepoints (cyclomatic 18) crates/wezterm-font/src/locator/core_text.rs:151— CoreTextFontLocator::locate_fallback_for_codepoints 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.
CharSelector::key_down (cyclomatic 18) kaku-gui/src/termwindow/charselect.rs:604— CharSelector::key_down has cyclomatic complexity 18 (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.
LocalDomain::fixup_command (cyclomatic 18) mux/src/domain.rs:313— LocalDomain::fixup_command 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.
ColorPalette::from (cyclomatic 18) config/src/color.rs:313— ColorPalette::from 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.
CellCluster::make_cluster (cyclomatic 17) crates/wezterm-surface/src/cellcluster.rs:50— CellCluster::make_cluster 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.
LayoutState::update_widget_constraint (cyclomatic 17) termwiz/src/widgets/layout.rs:309— LayoutState::update_widget_constraint 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.
WindowInner::refresh_after_display_change (cyclomatic 17) window/src/os/macos/window.rs:2923— WindowInner::refresh_after_display_change 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: window::os::macos::window::function_key_to_keycode (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Config::expand_tokens (cyclomatic 16) crates/wezterm-ssh/src/config.rs:677— Config::expand_tokens 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.
ProbeCapabilities::screen_size (cyclomatic 16) termwiz/src/caps/probed.rs:108— ProbeCapabilities::screen_size 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.
Window::new_window (cyclomatic 16) window/src/os/macos/window.rs:1763— Window::new_window has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: window::os::macos::window::function_key_to_keycode (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
No assertions: an upload waiting for relay authentication settles when its socket closes crates/kaku-remote/tests/web.test.cjs:1046— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
PhysKeyCode::for_each_code (cognitive 427) crates/wezterm-input-types/src/lib.rs:1018— PhysKeyCode::for_each_code has cognitive complexity 427 (threshold 15). Drivers by points: if/else 319 (426 pts), loops 1 (nesting depth added 107). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyCode::encode (cognitive 86) termwiz/src/input.rs:235— KeyCode::encode has cognitive complexity 86 (threshold 15). Drivers by points: if/else 32 (52 pts), match/switch 10 (19 pts), boolean chains 15 (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.
KeyEvent::encode_kitty (cognitive 76) crates/wezterm-input-types/src/lib.rs:1660— KeyEvent::encode_kitty has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (44 pts), match/switch 11 (19 pts), boolean chains 10, loops 1 (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.
HarfbuzzShaper::do_shape (cognitive 72) crates/wezterm-font/src/shaper/harfbuzz.rs:203— HarfbuzzShaper::do_shape has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (53 pts), loops 5 (8 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 41). 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.
SessionHandler::process_one (cognitive 69) crates/wezterm-mux-server-impl/src/sessionhandler.rs:246— SessionHandler::process_one has cognitive complexity 69 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 6 (17 pts), match/switch 8 (15 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ITermProprietary::parse (cognitive 66) crates/wezterm-escape-parser/src/osc.rs:1467— ITermProprietary::parse has cognitive complexity 66 (threshold 15). Drivers by points: if/else 32 (49 pts), boolean chains 16, match/switch 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.
AiClient::chat_step (cognitive 63) kaku-gui/src/ai_client/mod.rs:461— AiClient::chat_step has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (42 pts), loops 5 (10 pts), match/switch 3 (7 pts), boolean chains 4 (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.
Value::add_methods (cognitive 63) lua-api-crates/share-data/src/lib.rs:273— Value::add_methods has cognitive complexity 63 (threshold 15). Drivers by points: match/switch 16 (33 pts), if/else 9 (27 pts), loops 1 (3 pts) (nesting depth added 37). 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.
Publish::try_spawn (cognitive 57) kaku-gui/src/main.rs:559— Publish::try_spawn has cognitive complexity 57 (threshold 15). Drivers by points: if/else 11 (34 pts), match/switch 3 (12 pts), loops 2 (11 pts) (nesting depth added 41). 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.
ParsedConfigFile::parse_impl (cognitive 53) crates/wezterm-ssh/src/config.rs:228— ParsedConfigFile::parse_impl has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 4 (11 pts), match/switch 1 (5 pts), boolean chains 3 (nesting depth added 31). Of this number, 34 points are the body's own statements and 19 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientDomain::process_pane_list (cognitive 47) crates/wezterm-client/src/domain.rs:504— ClientDomain::process_pane_list has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 3 (10 pts), loops 5 (8 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.
WebGpuState::new_impl (cognitive 46) kaku-gui/src/termwindow/webgpu.rs:225— WebGpuState::new_impl has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (42 pts), loops 1 (2 pts), match/switch 1 (2 pts) (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.
SrgbaTuple::from_str (cognitive 45) crates/color-types/src/lib.rs:778— SrgbaTuple::from_str has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (35 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 18). Of this number, 31 points are the body's own statements and 14 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValuePrinterHelper::fmt (cognitive 45) crates/luahelper/src/lib.rs:344— ValuePrinterHelper::fmt has cognitive complexity 45 (threshold 15). Drivers by points: match/switch 7 (18 pts), if/else 6 (17 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 28). 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.
ActivateTab::run (cognitive 42) kaku/src/cli/activate_tab.rs:48— ActivateTab::run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LineEditBuffer::eval_movement (cognitive 42) termwiz/src/lineedit/buffer.rs:83— LineEditBuffer::eval_movement has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 7 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 22). 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.
serde_funcs::lua_value_to_json_value (cognitive 38) lua-api-crates/serde-funcs/src/lib.rs:152— serde_funcs::lua_value_to_json_value has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 8 (13 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
luahelper::lua_value_to_dynamic_impl (cognitive 37) crates/luahelper/src/lib.rs:108— luahelper::lua_value_to_dynamic_impl has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 5 (9 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 22). 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.
share_data::lua_value_to_gvalue_impl (cognitive 37) lua-api-crates/share-data/src/lib.rs:101— share_data::lua_value_to_gvalue_impl has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 5 (9 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 22). 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.
LocalDomain::fixup_command (cognitive 33) mux/src/domain.rs:313— LocalDomain::fixup_command has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 7 (15 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.
svg_to_poly.parse (cognitive 31) scripts/svg_to_poly.py:16— svg_to_poly.parse has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (12 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpawnCommand::run (cognitive 29) kaku/src/cli/spawn_command.rs:54— SpawnCommand::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (7 pts), match/switch 2 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineEditor::apply_action (cognitive 29) termwiz/src/lineedit/mod.rs:677— LineEditor::apply_action has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 pts), match/switch 2 (nesting depth added 14). 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.
env_bootstrap::ringlog::prune_old_logs (cognitive 28) crates/env-bootstrap/src/ringlog.rs:241— env_bootstrap::ringlog::prune_old_logs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandBuilder::search_path (cognitive 28) crates/pty/src/cmdbuilder.rs:331— CommandBuilder::search_path has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FinalTermSemanticPrompt::parse (cognitive 28) crates/wezterm-escape-parser/src/osc.rs:767— FinalTermSemanticPrompt::parse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 5 (10 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WcLookupTable::new (cognitive 27) crates/wezterm-char-props/src/widechar_width.rs:1603— WcLookupTable::new has cognitive complexity 27 (threshold 15). Drivers by points: loops 18 (27 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Client::new (cognitive 27) crates/wezterm-client/src/client.rs:1022— Client::new has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MovePaneToNewTab::run (cognitive 27) kaku/src/cli/move_pane_to_new_tab.rs:33— MovePaneToNewTab::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (7 pts), match/switch 2 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Node::lookup (cognitive 27) termwiz/src/keymap.rs:40— Node::lookup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 6 (12 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.
Clipboard::cleanup_runtime_image_dir_static (cognitive 27) window/src/os/macos/clipboard.rs:210— Clipboard::cleanup_runtime_image_dir_static has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (4 pts), loops 2 (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.
Shown::update (cognitive 26) crates/kaku-remote/src/web.rs:2026— Shown::update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ImageDataType::decode (cognitive 26) crates/wezterm-cell/src/image.rs:374— ImageDataType::decode has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 7 (18 pts), if/else 4 (8 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Capabilities::new_with_hints (cognitive 26) termwiz/src/caps/mod.rs:194— Capabilities::new_with_hints has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProbeCapabilities::screen_size (cognitive 26) termwiz/src/caps/probed.rs:108— ProbeCapabilities::screen_size has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnixTerminal::poll_input (cognitive 26) termwiz/src/terminal/unix.rs:409— UnixTerminal::poll_input has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 2 (4 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.
wezterm_char_props_codegen::emit_variation_map (cognitive 25) crates/wezterm-char-props/codegen/src/main.rs:74— wezterm_char_props_codegen::emit_variation_map has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts), match/switch 1 (5 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GlState::with_egl_lib (cognitive 24) window/src/egl.rs:392— GlState::with_egl_lib has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 3 (12 pts), if/else 5 (9 pts), loops 2 (3 pts) (nesting depth added 14). 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.
Helper::spawn (cognitive 23) crates/kaku-remote/src/desktop.rs:203— Helper::spawn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InlineThinkFilter::feed (cognitive 23) kaku-gui/src/ai_client/think_filter.rs:49— InlineThinkFilter::feed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabRenameModal::compute (cognitive 23) kaku-gui/src/termwindow/tab_rename.rs:799— TabRenameModal::compute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_incidents.problems (cognitive 23) scripts/check_incidents.py:108— check_incidents.problems has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Error::possible_matches (cognitive 22) crates/wezterm-dynamic/src/error.rs:238— Error::possible_matches has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), match/switch 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.
FreeTypeRasterizer::rasterize_mono (cognitive 22) crates/wezterm-font/src/rasterizer/freetype.rs:126— FreeTypeRasterizer::rasterize_mono has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (11 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.
PaneSelector::perform_selection (cognitive 22) kaku-gui/src/termwindow/paneselect.rs:160— PaneSelector::perform_selection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 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.
Mux::remove_window_internal (cognitive 22) mux/src/lib.rs:1323— Mux::remove_window_internal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (9 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
termwiz::caps::version_ge (cognitive 22) termwiz/src/caps/mod.rs:364— termwiz::caps::version_ge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (16 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VTParser::action (cognitive 21) crates/vtparse/src/lib.rs:526— VTParser::action has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (6 pts), loops 1 (3 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.
OperatingSystemCommand::internal_parse (cognitive 21) crates/wezterm-escape-parser/src/osc.rs:257— OperatingSystemCommand::internal_parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectionRange::cols_for_row (cognitive 21) kaku-gui/src/selection.rs:363— SelectionRange::cols_for_row has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inner::run (cognitive 21) kaku-gui/src/stats.rs:146— Inner::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (10 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.
CachedGradient::compute (cognitive 21) kaku-gui/src/termwindow/background.rs:37— CachedGradient::compute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
termwiz_funcs::permute_mods (cognitive 21) lua-api-crates/termwiz-funcs/src/lib.rs:205— termwiz_funcs::permute_mods has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 1 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LayoutState::update_widget_constraint (cognitive 21) termwiz/src/widgets/layout.rs:309— LayoutState::update_widget_constraint has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 7 (15 pts), if/else 4, loops 1 (2 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.
Window::new_window (cognitive 21) window/src/os/macos/window.rs:1763— Window::new_window has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Logger::log (cognitive 20) crates/env-bootstrap/src/ringlog.rs:160— Logger::log has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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.
ITermFileData::parse (cognitive 20) crates/wezterm-escape-parser/src/osc.rs:1262— ITermFileData::parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalPaneDCSHandler::handle_device_control (cognitive 20) mux/src/localpane.rs:989— LocalPaneDCSHandler::handle_device_control has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, match/switch 1 (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.
ColorPalette::from (cognitive 20) config/src/color.rs:313— ColorPalette::from has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 5 (7 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.
wezterm_escape_parser::tmux_cc::unvis_bytes::unvis_byte (cognitive 19) crates/wezterm-escape-parser/src/tmux_cc/mod.rs:538— wezterm_escape_parser::tmux_cc::unvis_bytes::unvis_byte has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 2 (3 pts) (nesting depth added 6). 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.
KittyImageData::load_data (cognitive 18) crates/wezterm-escape-parser/src/apc.rs:177— KittyImageData::load_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (looks_like_temp_path, read_from_file). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ToolState::load_with_usage (cognitive 18) kaku/src/ai_config/tui.rs:194— ToolState::load_with_usage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 4 (5 pts), boolean chains 4 (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.
ColorSchemeRegistry::load_scheme (cognitive 17) config/src/lib.rs:306— ColorSchemeRegistry::load_scheme has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 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.
Base91Decoder::write (cognitive 17) crates/base91/src/lib.rs:176— Base91Decoder::write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ProgramStatus::parse (cognitive 17) crates/wezterm-escape-parser/src/osc.rs:985— ProgramStatus::parse has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (7 pts), if/else 3 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::process_guarded_line (cognitive 17) crates/wezterm-escape-parser/src/tmux_cc/mod.rs:883— Parser::process_guarded_line has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 6). 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.
ZoomPane::run (cognitive 17) kaku/src/cli/zoom_pane.rs:33— ZoomPane::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColorEase::intensity_one_shot (cognitive 17) kaku-gui/src/colorease.rs:60— ColorEase::intensity_one_shot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LauncherArgs::new (cognitive 17) kaku-gui/src/overlay/launcher.rs:81— LauncherArgs::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
Element::with_line (cognitive 17) kaku-gui/src/termwindow/box_model.rs:268— Element::with_line has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyTableState::lookup_key (cognitive 17) kaku-gui/src/termwindow/keyevent.rs:139— KeyTableState::lookup_key has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaneInputEncoder::encode (cognitive 17) mux/src/pane_encoding.rs:124— PaneInputEncoder::encode 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. This shape REPEATS in the file: one other method here (PaneOutputDecoder::decode) 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.
PaneOutputDecoder::decode (cognitive 17) mux/src/pane_encoding.rs:231— PaneOutputDecoder::decode 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. This shape REPEATS in the file: one other method here (PaneInputEncoder::encode) 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.
LocalProcessInfo::with_root_pid (cognitive 16) crates/procinfo/src/macos.rs:68— LocalProcessInfo::with_root_pid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (all_pids, build_proc, info_for_pid, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ClientInner::expire_stale_mappings (cognitive 16) crates/wezterm-client/src/domain.rs:37— ClientInner::expire_stale_mappings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (7 pts), match/switch 2 (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.
CSIParser::sgr (cognitive 16) crates/wezterm-escape-parser/src/csi.rs:2686— CSIParser::sgr has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2, loops 1 (2 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.
SixelBuilder::finish_command (cognitive 16) crates/wezterm-escape-parser/src/parser/sixel.rs:96— SixelBuilder::finish_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). 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.
Blob::from_source (cognitive 16) crates/wezterm-font/src/hbwrap.rs:86— Blob::from_source has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FallbackResolveInfo::process (cognitive 16) crates/wezterm-font/src/lib.rs:337— FallbackResolveInfo::process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelWrap::exit_status (cognitive 16) crates/wezterm-ssh/src/channelwrap.rs:23— ChannelWrap::exit_status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). 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.
MatchGroup::is_match (cognitive 16) crates/wezterm-ssh/src/config.rs:101— MatchGroup::is_match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeSequence::add (cognitive 16) crates/wezterm-surface/src/change.rs:215— ChangeSequence::add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 7). 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.
ListAllWindows::process_result (cognitive 16) mux/src/tmux_commands.rs:805— ListAllWindows::process_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Resize::get_command (cognitive 16) mux/src/tmux_commands.rs:901— Resize::get_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 6, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TooManyFunctions: kaku_remote::pairing crates/kaku-remote/src/pairing.rs:41— TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×1
Near-duplicate member pair (69 shared lines) kaku-gui/src/overlay/launcher.rs:406— kaku-gui/src/overlay/launcher.rs:406-542 | kaku-gui/src/overlay/selector.rs:94-205 — These two members are variants of one another: 69 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 (33 shared lines) kaku-gui/src/termwindow/charselect.rs:388— kaku-gui/src/termwindow/charselect.rs:388-548 | kaku-gui/src/termwindow/paneselect.rs:57-158 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Duplicated block (46 lines × 2) config/derive/src/attr.rs:16— config/derive/src/attr.rs:16-61 | crates/wezterm-dynamic/derive/src/attr.rs:12-57 — before extracting anything, compare `config/derive/src/attr.rs` and `crates/wezterm-dynamic/derive/src/attr.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 138 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 (42 lines × 2) crates/wezterm-escape-parser/src/csi.rs:689— crates/wezterm-escape-parser/src/csi.rs:689-730 | crates/wezterm-escape-parser/src/csi.rs:732-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41 lines × 2) crates/wezterm-font/src/rasterizer/freetype.rs:469— crates/wezterm-font/src/rasterizer/freetype.rs:469-509 | crates/wezterm-font/src/rasterizer/harfbuzz.rs:61-101 — 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 (40–41 lines × 2) kaku-gui/src/overlay/quickselect.rs:587— kaku-gui/src/overlay/quickselect.rs:587-627 | kaku-gui/src/overlay/quickselect.rs:680-719 — both copies are in the same file, so extract the block into 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) kaku-gui/src/overlay/launcher.rs:701— kaku-gui/src/overlay/launcher.rs:701-739 | kaku-gui/src/overlay/selector.rs:314-352 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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–37 lines × 2) term/src/screen.rs:643— term/src/screen.rs:643-679 | term/src/screen.rs:913-948 — both copies are in the same file, so extract the block into 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 lines × 2) kaku-gui/src/overlay/launcher.rs:642— kaku-gui/src/overlay/launcher.rs:642-675 | kaku-gui/src/overlay/selector.rs:260-293 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (33 lines × 2) crates/wezterm-font/src/rasterizer/freetype.rs:230— crates/wezterm-font/src/rasterizer/freetype.rs:230-262 | crates/wezterm-font/src/rasterizer/freetype.rs:283-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 (29–31 lines × 2) kaku/src/ai_config/tui.rs:3007— kaku/src/ai_config/tui.rs:3007-3035 | kaku/src/ai_config/tui/providers/codex.rs:332-362 — 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 (27–29 lines × 2) mux/src/tab.rs:1502— mux/src/tab.rs:1502-1530 | mux/src/tab.rs:1548-1574 — both copies are in the same file, so extract the block into 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–28 lines × 2) mux/src/tab.rs:1666— mux/src/tab.rs:1666-1693 | mux/src/tab.rs:1699-1722 — both copies are in the same file, so extract the block into 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) termwiz/src/widgets/layout.rs:381— termwiz/src/widgets/layout.rs:381-406 | termwiz/src/widgets/layout.rs:408-433 — both copies are in the same file, so extract the block into 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–24 lines × 2) kaku-gui/src/overlay/launcher.rs:497— kaku-gui/src/overlay/launcher.rs:497-518 | kaku-gui/src/overlay/selector.rs:159-182 — before extracting anything, compare `kaku-gui/src/overlay/launcher.rs` and `kaku-gui/src/overlay/selector.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 178 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 (21–23 lines × 2) mux/src/tab.rs:1773— mux/src/tab.rs:1773-1795 | mux/src/tab.rs:1815-1835 — both copies are in the same file, so extract the block into 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) kaku-gui/src/ai_tools/search.rs:101— kaku-gui/src/ai_tools/search.rs:101-120 | kaku-gui/src/ai_tools/web.rs:310-330 — 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 (21 lines × 2) kaku/src/ai_config/tui/ui.rs:449— kaku/src/ai_config/tui/ui.rs:449-469 | kaku/src/config_tui/ui.rs:377-397 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–21 lines × 2) kaku/src/doctor.rs:1079— kaku/src/doctor.rs:1079-1099 | kaku/src/doctor.rs:1130-1143 — both copies are in the same file, so extract the block into 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) kaku-gui/src/glyphcache.rs:576— kaku-gui/src/glyphcache.rs:576-595 | kaku-gui/src/glyphcache.rs:605-624 — both copies are in the same file, so extract the block into 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) kaku/src/cli/set_tab_title.rs:28— kaku/src/cli/set_tab_title.rs:28-46 | kaku/src/cli/set_window_title.rs:29-47 — before extracting anything, compare `kaku/src/cli/set_tab_title.rs` and `kaku/src/cli/set_window_title.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 × 6) kaku-gui/src/customglyph.rs:5833— kaku-gui/src/customglyph.rs:5833-5852 | kaku-gui/src/customglyph.rs:5863-5886 | kaku-gui/src/customglyph.rs:5897-5922 | kaku-gui/src/customglyph.rs:5933-5950 | kaku-gui/src/customglyph.rs:5961-5986 | kaku-gui/src/customglyph.rs:5995-6016 — 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 (17–18 lines × 2) mux/src/pane_encoding.rs:144— mux/src/pane_encoding.rs:144-161 | mux/src/pane_encoding.rs:251-267 — both copies are in the same file, so extract the block into 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 × 3) crates/wezterm-escape-parser/src/csi.rs:2506— crates/wezterm-escape-parser/src/csi.rs:2506-2522 | crates/wezterm-escape-parser/src/csi.rs:2523-2539 | crates/wezterm-escape-parser/src/csi.rs:2551-2567 — 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–16 lines × 3) crates/wezterm-ssh/src/sftp/file.rs:156— crates/wezterm-ssh/src/sftp/file.rs:156-168 | crates/wezterm-ssh/src/sftp/file.rs:200-215 | crates/wezterm-ssh/src/sftp/file.rs:232-244 — 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 (14–16 lines × 2) kaku-gui/src/termwindow/mod.rs:6215— kaku-gui/src/termwindow/mod.rs:6215-6230 | kaku-gui/src/termwindow/mod.rs:6251-6264 — both copies are in the same file, so extract the block into 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) kaku/src/ai_config/tui/providers/mod.rs:1667— kaku/src/ai_config/tui/providers/mod.rs:1667-1682 | kaku/src/ai_config/tui/providers/mod.rs:1885-1899 — both copies are in the same file, so extract the block into 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–15 lines × 2) kaku-gui/src/termwindow/mod.rs:4089— kaku-gui/src/termwindow/mod.rs:4089-4101 | kaku/src/cli/activate_tab.rs:120-134 — 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 (12–14 lines × 2) window/src/os/macos/window.rs:9276— window/src/os/macos/window.rs:9276-9289 | window/src/os/macos/window.rs:9349-9360 — both copies are in the same file, so extract the block into 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/wezterm-dynamic/derive/src/attr.rs:173— crates/wezterm-dynamic/derive/src/attr.rs:173-185 | crates/wezterm-dynamic/derive/src/attr.rs:201-212 — both copies are in the same file, so extract the block into 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) kaku-gui/src/termwindow/box_model.rs:692— kaku-gui/src/termwindow/box_model.rs:692-704 | kaku-gui/src/termwindow/box_model.rs:827-837 — both copies are in the same file, so extract the block into 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–12 lines × 2) kaku/src/ai_config/tui/ui.rs:18— kaku/src/ai_config/tui/ui.rs:18-29 | kaku/src/config_tui/ui.rs:98-108 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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 (11 lines × 7) kaku-gui/src/customglyph.rs:5780— kaku-gui/src/customglyph.rs:5780-5790 | kaku-gui/src/customglyph.rs:5820-5830 | kaku-gui/src/customglyph.rs:5850-5860 | kaku-gui/src/customglyph.rs:5884-5894 | kaku-gui/src/customglyph.rs:5920-5930 | kaku-gui/src/customglyph.rs:5948-5958 | kaku-gui/src/customglyph.rs:5984-5994 — all 7 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 × 4) kaku/src/ai_config/tui/ui.rs:372— kaku/src/ai_config/tui/ui.rs:372-382 | kaku/src/ai_config/tui/ui.rs:458-468 | kaku/src/config_tui/ui.rs:386-396 | kaku/src/config_tui/ui.rs:454-464 — before extracting anything, compare `kaku/src/ai_config/tui/ui.rs` and `kaku/src/config_tui/ui.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 112 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–11 lines × 3) kaku/src/ai_config/tui.rs:2825— kaku/src/ai_config/tui.rs:2825-2834 | kaku/src/ai_config/tui.rs:2836-2845 | kaku/src/ai_config/tui.rs:2930-2940 — 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–11 lines × 2) crates/wezterm-font/src/ftwrap.rs:1355— crates/wezterm-font/src/ftwrap.rs:1355-1363 | crates/wezterm-font/src/hbwrap.rs:90-100 — 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–10 lines × 5) crates/wezterm-mux-server-impl/src/sessionhandler.rs:434— crates/wezterm-mux-server-impl/src/sessionhandler.rs:434-442 | crates/wezterm-mux-server-impl/src/sessionhandler.rs:472-480 | crates/wezterm-mux-server-impl/src/sessionhandler.rs:492-500 | crates/wezterm-mux-server-impl/src/sessionhandler.rs:661-670 | crates/wezterm-mux-server-impl/src/sessionhandler.rs:692-700 — 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 (9–10 lines × 3) crates/wezterm-dynamic/derive/src/attr.rs:145— crates/wezterm-dynamic/derive/src/attr.rs:145-154 | crates/wezterm-dynamic/derive/src/attr.rs:172-180 | crates/wezterm-dynamic/derive/src/attr.rs:200-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 (10 lines × 3) kaku-gui/src/termwindow/charselect.rs:522— kaku-gui/src/termwindow/charselect.rs:522-531 | kaku-gui/src/termwindow/palette.rs:771-780 | kaku-gui/src/termwindow/paneselect.rs:125-134 — before extracting anything, compare `kaku-gui/src/termwindow/charselect.rs` and `kaku-gui/src/termwindow/paneselect.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–9 lines × 2) crates/bidi/src/lib.rs:568— crates/bidi/src/lib.rs:568-576 | crates/bidi/src/lib.rs:776-782 — both copies are in the same file, so extract the block into 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) kaku-gui/src/glyphcache.rs:1185— kaku-gui/src/glyphcache.rs:1185-1192 | kaku-gui/src/utilsprites.rs:187-195 — 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–8 lines × 2) crates/wezterm-client/src/domain.rs:918— crates/wezterm-client/src/domain.rs:918-925 | mux/src/domain.rs:195-200 — 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 (7–8 lines × 2) kaku-gui/src/stats.rs:53— kaku-gui/src/stats.rs:53-59 | kaku-gui/src/stats.rs:68-75 — both copies are in the same file, so extract the block into 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 × 4) crates/wezterm-client/src/client.rs:216— crates/wezterm-client/src/client.rs:216-222 | crates/wezterm-client/src/client.rs:244-250 | crates/wezterm-client/src/client.rs:280-286 | crates/wezterm-client/src/client.rs:300-306 — 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 × 6) kaku-gui/src/overlay/ai_chat/render.rs:420— kaku-gui/src/overlay/ai_chat/render.rs:420-425 | kaku-gui/src/overlay/ai_chat/render.rs:526-531 | kaku-gui/src/overlay/ai_chat/render.rs:575-580 | kaku-gui/src/overlay/ai_chat/render.rs:657-662 | kaku-gui/src/overlay/ai_chat/render.rs:787-792 | kaku-gui/src/overlay/ai_chat/render.rs:852-857 — 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 (5–6 lines × 2) kaku-gui/src/termwindow/tab_rename.rs:769— kaku-gui/src/termwindow/tab_rename.rs:769-774 | kaku-gui/src/termwindow/tab_rename.rs:778-782 — both copies are in the same file, so extract the block into 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) kaku-gui/src/scripting/guiwin.rs:210— kaku-gui/src/scripting/guiwin.rs:210-218 | kaku-gui/src/scripting/guiwin.rs:224-232 | kaku-gui/src/scripting/guiwin.rs:242-250 | kaku-gui/src/scripting/guiwin.rs:256-264 — 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 (5 lines × 6) kaku-gui/src/scripting/guiwin.rs:203— kaku-gui/src/scripting/guiwin.rs:203-207 | kaku-gui/src/scripting/guiwin.rs:217-221 | kaku-gui/src/scripting/guiwin.rs:231-235 | kaku-gui/src/scripting/guiwin.rs:249-253 | kaku-gui/src/scripting/guiwin.rs:263-267 | kaku-gui/src/scripting/guiwin.rs:278-282 — 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.
End-of-life runtime: Rust 1.95 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.95 as this project's toolchain file, and Rust 1.95, superseded by 1.96 on 2026-05-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-28 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Outbound HTTP without resilience crates/wezterm-char-props/codegen/src/main.rs:22— `reqwest::blocking::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.
Orphaned file crates/lfucache/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file lua-api-crates/mux/src/pane.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-cell/src/image.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file lua-api-crates/share-data/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-escape-parser/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pty/src/cmdbuilder.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file termwiz/src/widgets/mod.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file termwiz/src/terminal/unix.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-font/src/rasterizer/colr.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file kaku-gui/src/overlay/selector.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file lua-api-crates/serde-funcs/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file window/src/bitmaps/mod.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/filedescriptor/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file term/src/terminalstate/mouse.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file kaku-gui/src/stats.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-font/src/rasterizer/harfbuzz.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-ssh/src/auth.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file config/src/background.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file kaku-gui/src/scripting/guiwin.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-ssh/src/sftp/mod.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pty/src/unix.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-dynamic/derive/src/fromdynamic.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file kaku-gui/src/termwindow/render/window_buttons.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file kaku-gui/src/quad.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/wezterm-dynamic/src/error.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate kaku/src/ai_config/tui.rs:3026— `!found && !new_val.is_empty() && new_val != "-"` appears character-identically in 2 files — kaku/src/ai_config/tui.rs, kaku/src/ai_config/tui/providers/codex.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 kaku/src/reset.rs:381— `!io::stdin().is_terminal() || !io::stdout().is_terminal()` appears character-identically in 2 files — kaku/src/reset.rs, kaku/src/update.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 kaku/src/ai_config/tui.rs:3155— `!key.modifiers.contains(KeyModifiers::CONTROL) && !key.modifiers.contains(KeyModifiers::SUPER)` appears character-identically in 2 files — kaku/src/ai_config/tui.rs, kaku/src/config_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 kaku-gui/src/termwindow/render/paint.rs:275— `!self.window_background.is_empty() || self.config.window_background_opacity != 1.0` appears character-identically in 2 files — kaku-gui/src/termwindow/render/paint.rs, kaku-gui/src/termwindow/render/tab_bar.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 kaku/src/doctor.rs:81— `answer.is_empty() || answer == "y" || answer == "yes"` appears character-identically in 2 files — kaku/src/doctor.rs, kaku/src/reset.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 kaku-gui/src/termwindow/mod.rs:1645— `config.enable_tab_bar && !config.hide_tab_bar_if_only_one_tab` appears character-identically in 2 files — kaku-gui/src/termwindow/mod.rs, kaku-gui/src/termwindow/resize.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/wezterm-dynamic/derive/src/fromdynamic.rs:140— `input.generics.lt_token.is_some() || input.generics.where_clause.is_some()` appears character-identically in 2 files — crates/wezterm-dynamic/derive/src/fromdynamic.rs, crates/wezterm-dynamic/derive/src/todynamic.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/wezterm-input-types/src/lib.rs:1974— `mods.contains(Modifiers::CTRL) && ctrl_mapping(c).is_some()` appears character-identically in 2 files — crates/wezterm-input-types/src/lib.rs, termwiz/src/input.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 kaku-gui/src/ai_client/assistant_config.rs:301— `name.eq_ignore_ascii_case("authorization") || name.eq_ignore_ascii_case("content-type")` appears character-identically in 2 files — kaku-gui/src/ai_client/assistant_config.rs, kaku/src/ai_config/tui.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 kaku-gui/src/ai_chat_engine/mod.rs:1100— `self.client.config().effective_api_mode() == ApiMode::Responses && !msg.responses_items.is_empty()` appears character-identically in 2 files — kaku-gui/src/ai_chat_engine/mod.rs, kaku-gui/src/overlay/ai_chat/state.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 kaku-gui/src/overlay/launcher.rs:682— `self.filter_term.pop().is_none() && !self.always_fuzzy` appears character-identically in 2 files — kaku-gui/src/overlay/launcher.rs, kaku-gui/src/overlay/selector.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 kaku-gui/src/overlay/launcher.rs:527— `self.filtering || !self.filter_term.is_empty()` appears character-identically in 2 files — kaku-gui/src/overlay/launcher.rs, kaku-gui/src/overlay/selector.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 kaku-gui/src/termwindow/mod.rs:3962— `self.show_tab_bar && !self.config.tab_bar_at_bottom` appears character-identically in 5 files — kaku-gui/src/termwindow/mod.rs, kaku-gui/src/termwindow/render/agent_title.rs, kaku-gui/src/termwindow/render/borders.rs, kaku-gui/src/termwindow/render/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 kaku-gui/src/termwindow/render/paint.rs:368— `self.show_tab_bar && self.config.tab_bar_at_bottom` appears character-identically in 2 files — kaku-gui/src/termwindow/render/paint.rs, kaku-gui/src/termwindow/render/pane.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 kaku-gui/src/termwindow/charselect.rs:395— `term_window.show_tab_bar && !term_window.config.tab_bar_at_bottom` appears character-identically in 3 files — kaku-gui/src/termwindow/charselect.rs, kaku-gui/src/termwindow/palette.rs, kaku-gui/src/termwindow/paneselect.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/wezterm-font/src/rasterizer/freetype.rs:472— `width as usize == 0 || height as usize == 0` appears character-identically in 2 files — crates/wezterm-font/src/rasterizer/freetype.rs, crates/wezterm-font/src/rasterizer/harfbuzz.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 kaku-gui/src/overlay/launcher.rs:734— `y > 0 && y as usize <= self.filtered_entries.len()` appears character-identically in 2 files — kaku-gui/src/overlay/launcher.rs, kaku-gui/src/overlay/selector.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.
Interpolated log message defeats structured logging crates/kaku-relay/src/main.rs:767— `info!` at line 767 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/kaku-relay/src/main.rs:858— `info!` at line 858 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/kaku-relay/src/main.rs:863— `info!` at line 863 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/kaku-relay/src/main.rs:1028— `info!` at line 1028 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/kaku-relay/src/main.rs:1264— `warn!` at line 1264 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/kaku-relay/src/main.rs:1272— `warn!` at line 1272 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/kaku-relay/src/main.rs:1301— `info!` at line 1301 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/kaku-relay/src/main.rs:1320— `info!` at line 1320 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/kaku-relay/src/main.rs:1333— `info!` at line 1333 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`.
Silent fallback default on Err crates/wezterm-font/src/ftwrap.rs:733— `get_palette_data` 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 kaku/src/diagnostics.rs:322— `newest_files` turns every `Err` into `Vec::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 kaku-gui/src/ai_conversations.rs:196— `load_index` turns every `Err` into `vec![]` — 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 kaku-gui/src/overlay/ai_chat/state.rs:368— `read_file_preview` turns every `Err` into `"[unreadable file omitted]".to_string()` — 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 window/src/os/macos/connection.rs:167— `name` turns every `Err` into `"macOS".to_string()` — 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 26 significant file(s) lose their only recent owner: kaku-gui/src/customglyph.rs, kaku-gui/src/ai_chat_engine/mod.rs, crates/wezterm-cell/src/lib.rs, crates/color-types/src/lib.rs, kaku-gui/src/ai_tools/search.rs, kaku-gui/src/ai_chat_engine/approval.rs, kaku-gui/src/overlay/ai_chat/input.rs, kaku-gui/src/ai_tools/registry.rs (+18 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 10 significant file(s) lose their only recent owner: kaku-gui/src/ai_client/mod.rs, kaku-gui/src/ai_client/responses.rs, crates/wezterm-escape-parser/src/parser/mod.rs, termwiz/src/lineedit/mod.rs, kaku-gui/src/ai_client/assistant_config.rs, kaku/src/ai_config/tui/providers/codex.rs, mux/src/connui.rs, kaku-gui/src/ai_client/think_filter.rs (+2 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: term/src/terminalstate/kitty.rs, crates/wezterm-client/src/pane/clientpane.rs, kaku-gui/src/shapecache.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 1 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 (40 single-owned of 330 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; 330 of the 432 production source files in this repository met that bar). They are 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/wezterm-font/src/ftwrap.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 — 2 of 64 project(s) overshoot their size bounds, lowering Project Cohesion to 9.4/10. The most over is `kaku-gui` (77276 LoC, 256 module-visible types across 12 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 118 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: crates/lfucache/src/lib.rs, lua-api-crates/mux/src/pane.rs, crates/wezterm-cell/src/image.rs, lua-api-crates/share-data/src/lib.rs, crates/wezterm-escape-parser/src/lib.rs, crates/pty/src/cmdbuilder.rs, termwiz/src/widgets/mod.rs, termwiz/src/terminal/unix.rs (and 110 more) (142 orphaned of 330 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; 330 of the 432 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
README/code drift term/README.md:18— term/README.md links to `terminal/struct.Terminal.html`, but `term/terminal/struct.Terminal.html` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 377/529 types (71%) 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 25/26 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/wezterm-char-props/codegen`.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
Security headers incomplete — Set: Referrer-Policy. Missing: Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−2.0 on this card.) The server: `axum::serve(` (crates/kaku-remote/src/lib.rs:709).
No inbound request validation detected — No handler of this repository's Rust server answers 400, 413 or 422 (`StatusCode::BAD_REQUEST`, `HttpResponse::BadRequest()`, `Status::BadRequest`, tonic `Status::invalid_argument`), and nothing declares validation — no `validator`/`garde` derive, no body limit (`DefaultBodyLimit::max`, `RequestBodyLimitLayer`, `JsonConfig::default().limit(…)`, Rocket `Limits`) — nothing shows inbound requests being checked, and refused, before a handler acts on them. A check that answers its failure with 200 and an error body is not seen. (−2.0 on this card.) The server: `axum::serve(` (crates/kaku-remote/src/lib.rs:709).
Subsumed condition operand kaku-gui/src/ai_chat_engine/mod.rs:1426— `prompt.contains("SHELL SAFETY")` can never decide this `||` — every value satisfying `prompt.contains("SHELL SAFETY")` also satisfies `prompt.contains("SAFETY")`, 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.
Outdated: anyhow — `anyhow` is locked at 1.0.103 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in config/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-executor — `async-executor` is locked at 1.13.3 but 1.14.0 is the current stable release on crates.io, and it already satisfies the `"1.11"` requirement declared in crates/promise/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-executor` 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 mux/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/kaku-relay/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum` and commit the updated REDACTED.
Outdated: backtrace — `backtrace` is locked at 0.3.76 but 0.3.77 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/env-bootstrap/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p backtrace` and commit the updated REDACTED.
Outdated: bstr — `bstr` is locked at 1.12.1 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/luahelper/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bstr` and commit the updated REDACTED.
Outdated: bytemuck — `bytemuck` is locked at 1.24.0 but 1.25.2 is the current stable release on crates.io, and it already satisfies the `"1.4"` requirement declared in kaku-gui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytemuck` 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.0"` requirement declared in window/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
Outdated: camino — `camino` is locked at 1.2.1 but 1.2.6 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/wezterm-ssh/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p camino` and commit the updated REDACTED.
Outdated: cc — `cc` is locked at 1.2.57 but 1.10.0 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in deps/cairo/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cc` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.42 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in kaku-gui/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.5.51 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.0"` requirement declared in kaku-gui/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.5.60 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4.4"` requirement declared in kaku/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 mux/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam` and commit the updated REDACTED.
Outdated: encoding_rs — `encoding_rs` is locked at 0.8.35 but 0.8.42 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in mux/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated REDACTED.
Outdated: euclid — `euclid` is locked at 0.22.11 but 0.22.14 is the current stable release on crates.io, and it already satisfies the `"0.22"` requirement declared in kaku-gui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p euclid` and commit the updated REDACTED.
Outdated: fastrand — `fastrand` is locked at 2.3.0 but 2.5.0 is the current stable release on crates.io, and it already satisfies the `"2.0"` requirement declared in kaku-gui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fastrand` and commit the updated REDACTED.
Outdated: filenamegen — `filenamegen` is locked at 0.2.7 but 0.2.8 is the current stable release on crates.io, and it already satisfies the `"0.2.6"` requirement declared in crates/wezterm-ssh/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p filenamegen` and commit the updated REDACTED.
Outdated: fixed — `fixed` is locked at 1.29.0 but 1.31.0 is the current stable release on crates.io, and it already satisfies the `"1.23"` requirement declared in deps/freetype/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fixed` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.5 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1.1"` requirement declared in crates/kaku-remote/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: futures — `futures` is locked at 0.3.31 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in kaku-gui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
Outdated: futures-util — `futures-util` is locked at 0.3.31 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/kaku-relay/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
Outdated: hdrhistogram — `hdrhistogram` is locked at 7.5.4 but 7.6.0 is the current stable release on crates.io, and it already satisfies the `"7.1"` requirement declared in kaku-gui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hdrhistogram` and commit the updated REDACTED.
Outdated: hostname — `hostname` is locked at 0.4.1 but 0.4.2 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in config/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hostname` and commit the updated REDACTED.
Outdated: humantime — `humantime` is locked at 2.3.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.1"` requirement declared in kaku/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p humantime` and commit the updated REDACTED.
Skipped (documented): a lost WebGL context hands the grid to the DOM at once and comes back crates/kaku-remote/tests/web.test.cjs:1749— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): switching tabs never shows a frame of wrong letters while WebGL merges glyph pages crates/kaku-remote/tests/web.test.cjs:1781— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): the grid draws with WebGL where the browser has it, and with the DOM otherwise crates/kaku-remote/tests/web.test.cjs:1917— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): an icon drawn before its font loaded is redrawn once the font is in crates/kaku-remote/tests/web.test.cjs:2239— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `crates/kaku-remote/assets/web/xterm-webgl.js` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a17f51-51df-7740-ad33-fc5fa7e71cd4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 66 · Warnings: 1435 · Recommendations: 167 · Info: 62 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 27-10-2026 @ 21:43 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.