Public report of koharu-rs/koharu, published 28 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 28 October 2026, 02:19 UTC · Survey ID cd_2a04a051e485454cbf9a6ea0c58d9e6d
koharu-rs/koharu
Measured 28 October 2026, 02:01 UTC, at code version 0b8206b
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.
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 3 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: 117,385 lines of product code in 27 projects, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Accessibility, 51
Findings by how serious they are
60 critical637 serious47 minor
9 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
28 October 2026, 02:01 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 ▸
81of 81 dimensions measured by tools.
712of 744 findings point to an exact file and line, so you can open each one in the code. The other 32 concern the repository as a whole, such as missing documentation.
81dimensions across 8 lenses, read from 117,385 lines of product code in 27 projects.
koharu-rs/koharu 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 59 out of 100 and is rated Adequate, and 57 of its 60 critical findings are security problems.
Accessibility, at 51, is the weakest lens and counts most in the score. The best first step is making the controls keyboard-usable, worth about 4 points. Recording design decisions comes next, worth about 2 points. Raising Accessibility to 65 would lift the score to about 63.
Twenty-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fourteen secrets can leak from the build pipeline, and thirteen known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, limiting each secret to its own step and updating the vulnerable packages would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once. The page or frame without a title needs a descriptive title.
The product code is 117,385 lines, about €130,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.
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: 9 findings
These 9 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one.
Large Files · packages/koharu/components/editor/CanvasWorkspace.tsx: 894 lines of code packages/koharu/components/editor/CanvasWorkspace.tsx
Rebuild cost: about €130,000 · Estimate
Cost to rebuild
€43,000 to €220,000, for 717 to 2,276 hours of work, about 0.9 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 59. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 117,385 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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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 €130,000 to build again, about 0.9 person-years of work. Its weakest lens is Accessibility, at 51 (Adequate). 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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. 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
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.
382 modules, with 1013 dependencies between them. 10 loops run through 65 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 342 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.
koharu_rasterizer.prepared uses koharu_app.commands.canvas, so a change to koharu_app.commands.canvas can break koharu_rasterizer.prepared, while a change to koharu_rasterizer.prepared can't break koharu_app.commands.canvas.
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.
koharu_scene.id uses koharu_storage.ids, so a change to koharu_storage.ids can break koharu_scene.id, while a change to koharu_scene.id can't break koharu_storage.ids.
Position
Below the diagonal: koharu_scene.id uses a module listed above it, which is the healthy direction.
koharu_torch.wrappers.tensor uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_torch.wrappers.tensor, while a change to koharu_torch.wrappers.tensor can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_torch.wrappers.tensor uses a module listed above it, which is the healthy direction.
8→11 koharu_torch.wrappers.tensor uses koharu_torch.nn.initpart of a loop✕
Connections
1 pair of types, where a type in koharu_torch.wrappers.tensor uses a type in koharu_torch.nn.init.
koharu_torch.wrappers.tensor uses koharu_torch.nn.init, so a change to koharu_torch.nn.init can break koharu_torch.wrappers.tensor, while a change to koharu_torch.wrappers.tensor can't break koharu_torch.nn.init.
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.
8→19 koharu_torch.wrappers.tensor uses koharu_ml.comic_layout_yolo26s.modelpart of a loop✕
Connections
1 pair of types, where a type in koharu_torch.wrappers.tensor uses a type in koharu_ml.comic_layout_yolo26s.model.
koharu_torch.wrappers.tensor uses koharu_ml.comic_layout_yolo26s.model, so a change to koharu_ml.comic_layout_yolo26s.model can break koharu_torch.wrappers.tensor, while a change to koharu_torch.wrappers.tensor can't break koharu_ml.comic_layout_yolo26s.model.
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.
koharu_renderer.frame uses koharu_storage.ids, so a change to koharu_storage.ids can break koharu_renderer.frame, while a change to koharu_renderer.frame can't break koharu_storage.ids.
Position
Below the diagonal: koharu_renderer.frame uses a module listed above it, which is the healthy direction.
koharu_renderer.frame uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_renderer.frame, while a change to koharu_renderer.frame can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_renderer.frame uses a module listed above it, which is the healthy direction.
koharu_renderer.frame uses koharu_scene.id, so a change to koharu_scene.id can break koharu_renderer.frame, while a change to koharu_renderer.frame can't break koharu_scene.id.
Position
Below the diagonal: koharu_renderer.frame uses a module listed above it, which is the healthy direction.
9→38 koharu_renderer.frame uses koharu_app.commands.projectpart of a loop✕
Connections
5 pairs of types, where a type in koharu_renderer.frame uses a type in koharu_app.commands.project.
koharu_renderer.frame uses koharu_app.commands.project, so a change to koharu_app.commands.project can break koharu_renderer.frame, while a change to koharu_renderer.frame can't break koharu_app.commands.project.
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.
koharu_scene.component uses koharu_storage.ids, so a change to koharu_storage.ids can break koharu_scene.component, while a change to koharu_scene.component can't break koharu_storage.ids.
Position
Below the diagonal: koharu_scene.component uses a module listed above it, which is the healthy direction.
koharu_scene.component uses koharu_scene.id, so a change to koharu_scene.id can break koharu_scene.component, while a change to koharu_scene.component can't break koharu_scene.id.
Position
Below the diagonal: koharu_scene.component uses a module listed above it, which is the healthy direction.
koharu_torch.nn.init uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_torch.nn.init, while a change to koharu_torch.nn.init can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_torch.nn.init uses a module listed above it, which is the healthy direction.
koharu_torch.nn.init uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_torch.nn.init, while a change to koharu_torch.nn.init can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_torch.nn.init uses a module listed above it, which is the healthy direction.
koharu_torch.nn.batch_norm uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_torch.nn.batch_norm, while a change to koharu_torch.nn.batch_norm can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_torch.nn.batch_norm uses a module listed above it, which is the healthy direction.
koharu_torch.nn.batch_norm uses koharu_torch.nn.init, so a change to koharu_torch.nn.init can break koharu_torch.nn.batch_norm, while a change to koharu_torch.nn.batch_norm can't break koharu_torch.nn.init.
Position
Below the diagonal: koharu_torch.nn.batch_norm uses a module listed above it, which is the healthy direction.
koharu_torch.nn.layer_norm uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_torch.nn.layer_norm, while a change to koharu_torch.nn.layer_norm can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_torch.nn.layer_norm uses a module listed above it, which is the healthy direction.
koharu_torch.nn.layer_norm uses koharu_torch.nn.init, so a change to koharu_torch.nn.init can break koharu_torch.nn.layer_norm, while a change to koharu_torch.nn.layer_norm can't break koharu_torch.nn.init.
Position
Below the diagonal: koharu_torch.nn.layer_norm uses a module listed above it, which is the healthy direction.
koharu_torch.nn.linear uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_torch.nn.linear, while a change to koharu_torch.nn.linear can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_torch.nn.linear uses a module listed above it, which is the healthy direction.
koharu_torch.nn.linear uses koharu_torch.nn.init, so a change to koharu_torch.nn.init can break koharu_torch.nn.linear, while a change to koharu_torch.nn.linear can't break koharu_torch.nn.init.
Position
Below the diagonal: koharu_torch.nn.linear uses a module listed above it, which is the healthy direction.
koharu_torch.nn.var_store uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_torch.nn.var_store, while a change to koharu_torch.nn.var_store can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_torch.nn.var_store uses a module listed above it, which is the healthy direction.
koharu_torch.nn.var_store uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_torch.nn.var_store, while a change to koharu_torch.nn.var_store can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_torch.nn.var_store uses a module listed above it, which is the healthy direction.
koharu_torch.nn.var_store uses koharu_torch.nn.init, so a change to koharu_torch.nn.init can break koharu_torch.nn.var_store, while a change to koharu_torch.nn.var_store can't break koharu_torch.nn.init.
Position
Below the diagonal: koharu_torch.nn.var_store uses a module listed above it, which is the healthy direction.
15→19 koharu_torch.nn.var_store uses koharu_ml.comic_layout_yolo26s.modelpart of a loop✕
Connections
1 pair of types, where a type in koharu_torch.nn.var_store uses a type in koharu_ml.comic_layout_yolo26s.model.
koharu_torch.nn.var_store uses koharu_ml.comic_layout_yolo26s.model, so a change to koharu_ml.comic_layout_yolo26s.model can break koharu_torch.nn.var_store, while a change to koharu_torch.nn.var_store can't break koharu_ml.comic_layout_yolo26s.model.
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.
koharu_config uses koharu_agent.config, so a change to koharu_agent.config can break koharu_config, while a change to koharu_config can't break koharu_agent.config.
Position
Below the diagonal: koharu_config uses a module listed above it, which is the healthy direction.
koharu_config uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_config, while a change to koharu_config can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_config uses a module listed above it, which is the healthy direction.
koharu_diffusion.params uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_diffusion.params, while a change to koharu_diffusion.params can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_diffusion.params uses a module listed above it, which is the healthy direction.
koharu_ml.aot_inpainting.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.aot_inpainting.model, while a change to koharu_ml.aot_inpainting.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.aot_inpainting.model uses a module listed above it, which is the healthy direction.
koharu_ml.aot_inpainting.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.aot_inpainting.model, while a change to koharu_ml.aot_inpainting.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.aot_inpainting.model uses a module listed above it, which is the healthy direction.
koharu_ml.aot_inpainting.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.aot_inpainting.model, while a change to koharu_ml.aot_inpainting.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.aot_inpainting.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_layout_yolo26s.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.comic_layout_yolo26s.model, while a change to koharu_ml.comic_layout_yolo26s.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.comic_layout_yolo26s.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_layout_yolo26s.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.comic_layout_yolo26s.model, while a change to koharu_ml.comic_layout_yolo26s.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.comic_layout_yolo26s.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_layout_yolo26s.model uses koharu_torch.nn.batch_norm, so a change to koharu_torch.nn.batch_norm can break koharu_ml.comic_layout_yolo26s.model, while a change to koharu_ml.comic_layout_yolo26s.model can't break koharu_torch.nn.batch_norm.
Position
Below the diagonal: koharu_ml.comic_layout_yolo26s.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_layout_yolo26s.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.comic_layout_yolo26s.model, while a change to koharu_ml.comic_layout_yolo26s.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.comic_layout_yolo26s.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_text_mask.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.manga_text_mask.model, while a change to koharu_ml.manga_text_mask.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.manga_text_mask.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_text_mask.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.manga_text_mask.model, while a change to koharu_ml.manga_text_mask.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.manga_text_mask.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_text_mask.model uses koharu_torch.nn.batch_norm, so a change to koharu_torch.nn.batch_norm can break koharu_ml.manga_text_mask.model, while a change to koharu_ml.manga_text_mask.model can't break koharu_torch.nn.batch_norm.
Position
Below the diagonal: koharu_ml.manga_text_mask.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_text_mask.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.manga_text_mask.model, while a change to koharu_ml.manga_text_mask.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.manga_text_mask.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_bubble_detector.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in koharu_ml.comic_text_bubble_detector.model uses a type in koharu_torch.wrappers.tensor. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.batch_norm, so a change to koharu_torch.nn.batch_norm can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_torch.nn.batch_norm.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.layer_norm, so a change to koharu_torch.nn.layer_norm can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_torch.nn.layer_norm.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.linear, so a change to koharu_torch.nn.linear can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_torch.nn.linear.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_bubble_detector.model uses koharu_diffusion.params, so a change to koharu_diffusion.params can break koharu_ml.comic_text_bubble_detector.model, while a change to koharu_ml.comic_text_bubble_detector.model can't break koharu_diffusion.params.
Position
Below the diagonal: koharu_ml.comic_text_bubble_detector.model uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_detector.processor uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.comic_text_detector.processor, while a change to koharu_ml.comic_text_detector.processor can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.comic_text_detector.processor uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_detector.processor uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.comic_text_detector.processor, while a change to koharu_ml.comic_text_detector.processor can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.comic_text_detector.processor uses a module listed above it, which is the healthy direction.
koharu_ml.comic_text_detector.processor uses koharu_ml.comic_layout_yolo26s.model, so a change to koharu_ml.comic_layout_yolo26s.model can break koharu_ml.comic_text_detector.processor, while a change to koharu_ml.comic_text_detector.processor can't break koharu_ml.comic_layout_yolo26s.model.
Position
Below the diagonal: koharu_ml.comic_text_detector.processor uses a module listed above it, which is the healthy direction.
koharu_ml.hayai_ocr.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.hayai_ocr.model, while a change to koharu_ml.hayai_ocr.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.hayai_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.hayai_ocr.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.hayai_ocr.model, while a change to koharu_ml.hayai_ocr.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.hayai_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.hayai_ocr.model uses koharu_torch.nn.layer_norm, so a change to koharu_torch.nn.layer_norm can break koharu_ml.hayai_ocr.model, while a change to koharu_ml.hayai_ocr.model can't break koharu_torch.nn.layer_norm.
Position
Below the diagonal: koharu_ml.hayai_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.hayai_ocr.model uses koharu_torch.nn.linear, so a change to koharu_torch.nn.linear can break koharu_ml.hayai_ocr.model, while a change to koharu_ml.hayai_ocr.model can't break koharu_torch.nn.linear.
Position
Below the diagonal: koharu_ml.hayai_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.hayai_ocr.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.hayai_ocr.model, while a change to koharu_ml.hayai_ocr.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.hayai_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.hayai_ocr.model uses koharu_diffusion.params, so a change to koharu_diffusion.params can break koharu_ml.hayai_ocr.model, while a change to koharu_ml.hayai_ocr.model can't break koharu_diffusion.params.
Position
Below the diagonal: koharu_ml.hayai_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.llm uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.llm, while a change to koharu_ml.llm can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.llm uses a module listed above it, which is the healthy direction.
koharu_ml.llm uses koharu_ml.aot_inpainting.model, so a change to koharu_ml.aot_inpainting.model can break koharu_ml.llm, while a change to koharu_ml.llm can't break koharu_ml.aot_inpainting.model.
Position
Below the diagonal: koharu_ml.llm uses a module listed above it, which is the healthy direction.
koharu_ml.manga_ocr.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.manga_ocr.model, while a change to koharu_ml.manga_ocr.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.manga_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_ocr.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.manga_ocr.model, while a change to koharu_ml.manga_ocr.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.manga_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_ocr.model uses koharu_torch.nn.layer_norm, so a change to koharu_torch.nn.layer_norm can break koharu_ml.manga_ocr.model, while a change to koharu_ml.manga_ocr.model can't break koharu_torch.nn.layer_norm.
Position
Below the diagonal: koharu_ml.manga_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_ocr.model uses koharu_torch.nn.linear, so a change to koharu_torch.nn.linear can break koharu_ml.manga_ocr.model, while a change to koharu_ml.manga_ocr.model can't break koharu_torch.nn.linear.
Position
Below the diagonal: koharu_ml.manga_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_ocr.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.manga_ocr.model, while a change to koharu_ml.manga_ocr.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.manga_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.manga_ocr.model uses koharu_diffusion.params, so a change to koharu_diffusion.params can break koharu_ml.manga_ocr.model, while a change to koharu_ml.manga_ocr.model can't break koharu_diffusion.params.
Position
Below the diagonal: koharu_ml.manga_ocr.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.wrappers.tensor, so a change to koharu_torch.wrappers.tensor can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_torch.wrappers.tensor.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.batch_norm, so a change to koharu_torch.nn.batch_norm can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_torch.nn.batch_norm.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.layer_norm, so a change to koharu_torch.nn.layer_norm can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_torch.nn.layer_norm.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.linear, so a change to koharu_torch.nn.linear can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_torch.nn.linear.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.var_store, so a change to koharu_torch.nn.var_store can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_torch.nn.var_store.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_ml.pp_ocr_v6.rec.model uses koharu_ml.comic_layout_yolo26s.model, so a change to koharu_ml.comic_layout_yolo26s.model can break koharu_ml.pp_ocr_v6.rec.model, while a change to koharu_ml.pp_ocr_v6.rec.model can't break koharu_ml.comic_layout_yolo26s.model.
Position
Below the diagonal: koharu_ml.pp_ocr_v6.rec.model uses a module listed above it, which is the healthy direction.
koharu_llama.model uses koharu_ml.hayai_ocr.model, so a change to koharu_ml.hayai_ocr.model can break koharu_llama.model, while a change to koharu_llama.model can't break koharu_ml.hayai_ocr.model.
Position
Below the diagonal: koharu_llama.model uses a module listed above it, which is the healthy direction.
koharu_pipeline.config uses koharu_ml.manga_ocr.model, so a change to koharu_ml.manga_ocr.model can break koharu_pipeline.config, while a change to koharu_pipeline.config can't break koharu_ml.manga_ocr.model.
Position
Below the diagonal: koharu_pipeline.config uses a module listed above it, which is the healthy direction.
koharu_scene.edit uses koharu_scene.id, so a change to koharu_scene.id can break koharu_scene.edit, while a change to koharu_scene.edit can't break koharu_scene.id.
Position
Below the diagonal: koharu_scene.edit uses a module listed above it, which is the healthy direction.
koharu_scene.edit uses koharu_scene.component, so a change to koharu_scene.component can break koharu_scene.edit, while a change to koharu_scene.edit can't break koharu_scene.component.
Position
Below the diagonal: koharu_scene.edit uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in koharu_scene.edit uses a type in koharu_config.
The types involved
koharu_scene.edit.Edit → koharu_config.State
Direction
koharu_scene.edit uses koharu_config, so a change to koharu_config can break koharu_scene.edit, while a change to koharu_scene.edit can't break koharu_config.
Position
Below the diagonal: koharu_scene.edit uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in koharu_scene.edit uses a type in koharu_ml.llm.
The types involved
koharu_scene.edit.Edit → koharu_ml.llm.Generation
Direction
koharu_scene.edit uses koharu_ml.llm, so a change to koharu_ml.llm can break koharu_scene.edit, while a change to koharu_scene.edit can't break koharu_ml.llm.
Position
Below the diagonal: koharu_scene.edit uses a module listed above it, which is the healthy direction.
29→30 koharu_scene.edit uses koharu_scene.snapshotpart of a loop✕
Connections
1 pair of types, where a type in koharu_scene.edit uses a type in koharu_scene.snapshot.
koharu_scene.edit uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_scene.edit, while a change to koharu_scene.edit can't break koharu_scene.snapshot.
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.
29→38 koharu_scene.edit uses koharu_app.commands.projectpart of a loop✕
Connections
1 pair of types, where a type in koharu_scene.edit uses a type in koharu_app.commands.project.
koharu_scene.edit uses koharu_app.commands.project, so a change to koharu_app.commands.project can break koharu_scene.edit, while a change to koharu_scene.edit can't break koharu_app.commands.project.
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.
koharu_scene.snapshot uses koharu_storage.ids, so a change to koharu_storage.ids can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_storage.ids.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_scene.snapshot uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_scene.snapshot uses koharu_scene.id, so a change to koharu_scene.id can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_scene.id.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_scene.snapshot uses koharu_scene.component, so a change to koharu_scene.component can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_scene.component.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_scene.snapshot uses koharu_config, so a change to koharu_config can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_config.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_scene.snapshot uses koharu_ml.llm, so a change to koharu_ml.llm can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_ml.llm.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_scene.snapshot uses koharu_scene.edit, so a change to koharu_scene.edit can break koharu_scene.snapshot, while a change to koharu_scene.snapshot can't break koharu_scene.edit.
Position
Below the diagonal: koharu_scene.snapshot uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_pipeline.stages, while a change to koharu_pipeline.stages can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_pipeline.stages uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages uses koharu_scene.id, so a change to koharu_scene.id can break koharu_pipeline.stages, while a change to koharu_pipeline.stages can't break koharu_scene.id.
Position
Below the diagonal: koharu_pipeline.stages uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages uses koharu_ml.manga_text_mask.model, so a change to koharu_ml.manga_text_mask.model can break koharu_pipeline.stages, while a change to koharu_pipeline.stages can't break koharu_ml.manga_text_mask.model.
Position
Below the diagonal: koharu_pipeline.stages uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages uses koharu_pipeline.config, so a change to koharu_pipeline.config can break koharu_pipeline.stages, while a change to koharu_pipeline.stages can't break koharu_pipeline.config.
Position
Below the diagonal: koharu_pipeline.stages uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages uses koharu_scene.edit, so a change to koharu_scene.edit can break koharu_pipeline.stages, while a change to koharu_pipeline.stages can't break koharu_scene.edit.
Position
Below the diagonal: koharu_pipeline.stages uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_pipeline.stages, while a change to koharu_pipeline.stages can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_pipeline.stages uses a module listed above it, which is the healthy direction.
koharu_renderer.renderer uses koharu_agent.config, so a change to koharu_agent.config can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_agent.config.
Position
Below the diagonal: koharu_renderer.renderer uses a module listed above it, which is the healthy direction.
koharu_renderer.renderer uses koharu_storage.ids, so a change to koharu_storage.ids can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_storage.ids.
Position
Below the diagonal: koharu_renderer.renderer uses a module listed above it, which is the healthy direction.
koharu_renderer.renderer uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_renderer.renderer uses a module listed above it, which is the healthy direction.
koharu_renderer.renderer uses koharu_scene.id, so a change to koharu_scene.id can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_scene.id.
Position
Below the diagonal: koharu_renderer.renderer uses a module listed above it, which is the healthy direction.
koharu_renderer.renderer uses koharu_renderer.frame, so a change to koharu_renderer.frame can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_renderer.frame.
Position
Below the diagonal: koharu_renderer.renderer uses a module listed above it, which is the healthy direction.
koharu_renderer.renderer uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_renderer.renderer uses a module listed above it, which is the healthy direction.
32→36 koharu_renderer.renderer uses koharu_desktoppart of a loop✕
Connections
1 pair of types, where a type in koharu_renderer.renderer uses a type in koharu_desktop.
koharu_renderer.renderer uses koharu_desktop, so a change to koharu_desktop can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_desktop.
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.
32→38 koharu_renderer.renderer uses koharu_app.commands.projectpart of a loop✕
Connections
4 pairs of types, where a type in koharu_renderer.renderer uses a type in koharu_app.commands.project.
koharu_renderer.renderer uses koharu_app.commands.project, so a change to koharu_app.commands.project can break koharu_renderer.renderer, while a change to koharu_renderer.renderer can't break koharu_app.commands.project.
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.
koharu_scene.patch uses koharu_storage.ids, so a change to koharu_storage.ids can break koharu_scene.patch, while a change to koharu_scene.patch can't break koharu_storage.ids.
Position
Below the diagonal: koharu_scene.patch uses a module listed above it, which is the healthy direction.
koharu_scene.patch uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_scene.patch, while a change to koharu_scene.patch can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_scene.patch uses a module listed above it, which is the healthy direction.
koharu_scene.patch uses koharu_scene.id, so a change to koharu_scene.id can break koharu_scene.patch, while a change to koharu_scene.patch can't break koharu_scene.id.
Position
Below the diagonal: koharu_scene.patch uses a module listed above it, which is the healthy direction.
koharu_scene.patch uses koharu_scene.component, so a change to koharu_scene.component can break koharu_scene.patch, while a change to koharu_scene.patch can't break koharu_scene.component.
Position
Below the diagonal: koharu_scene.patch uses a module listed above it, which is the healthy direction.
koharu_scene.patch uses koharu_config, so a change to koharu_config can break koharu_scene.patch, while a change to koharu_scene.patch can't break koharu_config.
Position
Below the diagonal: koharu_scene.patch uses a module listed above it, which is the healthy direction.
koharu_scene.patch uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_scene.patch, while a change to koharu_scene.patch can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_scene.patch uses a module listed above it, which is the healthy direction.
koharu_pipeline.stage_runner uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_pipeline.stage_runner, while a change to koharu_pipeline.stage_runner can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_pipeline.stage_runner uses a module listed above it, which is the healthy direction.
koharu_pipeline.stage_runner uses koharu_scene.id, so a change to koharu_scene.id can break koharu_pipeline.stage_runner, while a change to koharu_pipeline.stage_runner can't break koharu_scene.id.
Position
Below the diagonal: koharu_pipeline.stage_runner uses a module listed above it, which is the healthy direction.
koharu_pipeline.stage_runner uses koharu_ml.manga_text_mask.model, so a change to koharu_ml.manga_text_mask.model can break koharu_pipeline.stage_runner, while a change to koharu_pipeline.stage_runner can't break koharu_ml.manga_text_mask.model.
Position
Below the diagonal: koharu_pipeline.stage_runner uses a module listed above it, which is the healthy direction.
koharu_pipeline.stage_runner uses koharu_pipeline.config, so a change to koharu_pipeline.config can break koharu_pipeline.stage_runner, while a change to koharu_pipeline.stage_runner can't break koharu_pipeline.config.
Position
Below the diagonal: koharu_pipeline.stage_runner uses a module listed above it, which is the healthy direction.
koharu_pipeline.stage_runner uses koharu_pipeline.stages, so a change to koharu_pipeline.stages can break koharu_pipeline.stage_runner, while a change to koharu_pipeline.stage_runner can't break koharu_pipeline.stages.
Position
Below the diagonal: koharu_pipeline.stage_runner uses a module listed above it, which is the healthy direction.
koharu_scene.session uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_scene.session, while a change to koharu_scene.session can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_scene.session uses a module listed above it, which is the healthy direction.
koharu_scene.session uses koharu_scene.id, so a change to koharu_scene.id can break koharu_scene.session, while a change to koharu_scene.session can't break koharu_scene.id.
Position
Below the diagonal: koharu_scene.session uses a module listed above it, which is the healthy direction.
koharu_scene.session uses koharu_config, so a change to koharu_config can break koharu_scene.session, while a change to koharu_scene.session can't break koharu_config.
Position
Below the diagonal: koharu_scene.session uses a module listed above it, which is the healthy direction.
koharu_scene.session uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_scene.session, while a change to koharu_scene.session can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_scene.session uses a module listed above it, which is the healthy direction.
koharu_scene.session uses koharu_scene.patch, so a change to koharu_scene.patch can break koharu_scene.session, while a change to koharu_scene.session can't break koharu_scene.patch.
Position
Below the diagonal: koharu_scene.session uses a module listed above it, which is the healthy direction.
koharu_desktop uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_desktop, while a change to koharu_desktop can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_desktop uses a module listed above it, which is the healthy direction.
koharu_desktop uses koharu_scene.id, so a change to koharu_scene.id can break koharu_desktop, while a change to koharu_desktop can't break koharu_scene.id.
Position
Below the diagonal: koharu_desktop uses a module listed above it, which is the healthy direction.
koharu_desktop uses koharu_ml.comic_layout_yolo26s.model, so a change to koharu_ml.comic_layout_yolo26s.model can break koharu_desktop, while a change to koharu_desktop can't break koharu_ml.comic_layout_yolo26s.model.
Position
Below the diagonal: koharu_desktop uses a module listed above it, which is the healthy direction.
koharu_desktop uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_desktop, while a change to koharu_desktop can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_desktop uses a module listed above it, which is the healthy direction.
koharu_desktop uses koharu_renderer.renderer, so a change to koharu_renderer.renderer can break koharu_desktop, while a change to koharu_desktop can't break koharu_renderer.renderer.
Position
Below the diagonal: koharu_desktop uses a module listed above it, which is the healthy direction.
koharu_desktop uses koharu_scene.session, so a change to koharu_scene.session can break koharu_desktop, while a change to koharu_desktop can't break koharu_scene.session.
Position
Below the diagonal: koharu_desktop uses a module listed above it, which is the healthy direction.
36→39 koharu_desktop uses koharu_app.commands.canvaspart of a loop✕
Connections
1 pair of types, where a type in koharu_desktop uses a type in koharu_app.commands.canvas.
koharu_desktop uses koharu_app.commands.canvas, so a change to koharu_app.commands.canvas can break koharu_desktop, while a change to koharu_desktop can't break koharu_app.commands.canvas.
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.
koharu_pipeline.execution uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_pipeline.execution, while a change to koharu_pipeline.execution can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_pipeline.execution uses a module listed above it, which is the healthy direction.
koharu_pipeline.execution uses koharu_scene.id, so a change to koharu_scene.id can break koharu_pipeline.execution, while a change to koharu_pipeline.execution can't break koharu_scene.id.
Position
Below the diagonal: koharu_pipeline.execution uses a module listed above it, which is the healthy direction.
koharu_pipeline.execution uses koharu_ml.manga_text_mask.model, so a change to koharu_ml.manga_text_mask.model can break koharu_pipeline.execution, while a change to koharu_pipeline.execution can't break koharu_ml.manga_text_mask.model.
Position
Below the diagonal: koharu_pipeline.execution uses a module listed above it, which is the healthy direction.
koharu_pipeline.execution uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_pipeline.execution, while a change to koharu_pipeline.execution can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_pipeline.execution uses a module listed above it, which is the healthy direction.
koharu_pipeline.execution uses koharu_scene.patch, so a change to koharu_scene.patch can break koharu_pipeline.execution, while a change to koharu_pipeline.execution can't break koharu_scene.patch.
Position
Below the diagonal: koharu_pipeline.execution uses a module listed above it, which is the healthy direction.
koharu_pipeline.execution uses koharu_pipeline.stage_runner, so a change to koharu_pipeline.stage_runner can break koharu_pipeline.execution, while a change to koharu_pipeline.execution can't break koharu_pipeline.stage_runner.
Position
Below the diagonal: koharu_pipeline.execution uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_scene.id, so a change to koharu_scene.id can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_scene.id.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_scene.edit, so a change to koharu_scene.edit can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_scene.edit.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_scene.patch, so a change to koharu_scene.patch can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_scene.patch.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_scene.session, so a change to koharu_scene.session can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_scene.session.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
koharu_app.commands.project uses koharu_desktop, so a change to koharu_desktop can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_desktop.
Position
Below the diagonal: koharu_app.commands.project uses a module listed above it, which is the healthy direction.
38→39 koharu_app.commands.project uses koharu_app.commands.canvaspart of a loop✕
Connections
2 pairs of types, where a type in koharu_app.commands.project uses a type in koharu_app.commands.canvas.
koharu_app.commands.project uses koharu_app.commands.canvas, so a change to koharu_app.commands.canvas can break koharu_app.commands.project, while a change to koharu_app.commands.project can't break koharu_app.commands.canvas.
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.
koharu_app.commands.canvas uses koharu_rasterizer.prepared, so a change to koharu_rasterizer.prepared can break koharu_app.commands.canvas, while a change to koharu_app.commands.canvas can't break koharu_rasterizer.prepared.
Position
Below the diagonal: koharu_app.commands.canvas uses a module listed above it, which is the healthy direction.
koharu_app.commands.canvas uses koharu_scene.id, so a change to koharu_scene.id can break koharu_app.commands.canvas, while a change to koharu_app.commands.canvas can't break koharu_scene.id.
Position
Below the diagonal: koharu_app.commands.canvas uses a module listed above it, which is the healthy direction.
koharu_app.commands.canvas uses koharu_config, so a change to koharu_config can break koharu_app.commands.canvas, while a change to koharu_app.commands.canvas can't break koharu_config.
Position
Below the diagonal: koharu_app.commands.canvas uses a module listed above it, which is the healthy direction.
koharu_app.commands.canvas uses koharu_desktop, so a change to koharu_desktop can break koharu_app.commands.canvas, while a change to koharu_app.commands.canvas can't break koharu_desktop.
Position
Below the diagonal: koharu_app.commands.canvas uses a module listed above it, which is the healthy direction.
koharu_app.commands.canvas uses koharu_app.commands.project, so a change to koharu_app.commands.project can break koharu_app.commands.canvas, while a change to koharu_app.commands.canvas can't break koharu_app.commands.project.
Position
Below the diagonal: koharu_app.commands.canvas uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_diffusion.system, so a change to koharu_diffusion.system can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_diffusion.system.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_scene.id, so a change to koharu_scene.id can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_scene.id.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_ml.llm, so a change to koharu_ml.llm can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_ml.llm.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_pipeline.config, so a change to koharu_pipeline.config can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_pipeline.config.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_scene.edit, so a change to koharu_scene.edit can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_scene.edit.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_scene.snapshot, so a change to koharu_scene.snapshot can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_scene.snapshot.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_pipeline.stages, so a change to koharu_pipeline.stages can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_pipeline.stages.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
koharu_pipeline.stages.detection uses koharu_app.commands.project, so a change to koharu_app.commands.project can break koharu_pipeline.stages.detection, while a change to koharu_pipeline.stages.detection can't break koharu_app.commands.project.
Position
Below the diagonal: koharu_pipeline.stages.detection uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2025 — Software Supply Chain Failures
65
High / Critical
A05:2025 — Injection
47
High / Critical
Roadmap
First, ensure custom controls are fully keyboard-operable and anchors have valid hrefs to improve immediate user interaction. Next, resolve the 14 static analysis findings regarding secrets in release workflows to secure the build pipeline. Then, enforce accessibility standards by enabling jsx-a11y in the linter, asserting with vitest-axe, and gating checks in CI. Finally, fix page structure issues like missing language attributes and landmarks, and address the lack of architectural decision records to complete the health baseline.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Enforce accessibility in the toolchain you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
God Classes: FileTooLong: comic_text_bubble_detector/model.rs
How the grades work
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 — 60
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 — 637
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 — 47
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 9
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. 81 of 81 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 — 81 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 712 of 744 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.
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 98 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 29 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 reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/koharu/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
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 reliability for the vitest suite in packages/koharu/ was NOT MEASURED: the dependency install for packages/koharu/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — 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. This repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For crates/koharu-diffusion/src/enums.rs, crates/koharu-translator/src/provider.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (55 contributor(s) across 2411 commit(s) sampled, automation and bot accounts excluded). One of them holds 85% of the history; the other 54 hold 0.3% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — 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. `packages/koharu/components/editor/CanvasWorkspace.tsx`, `packages/koharu/components/editor/ToolBar.tsx`, `packages/koharu/components/preferences/PipelinePreferences.tsx`, `packages/koharu/components/preferences/models.ts`, `packages/koharu/lib/i18n.ts`, … (+1 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
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 DevServer (dev). the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence.
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, c 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, c 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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
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.
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.
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 Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
36 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was CanvasWorkspace.CanvasWorkspace at 148. A further 24 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 koharu_ml::bin::pp_doclayout_v3::glyph_bits at 42 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: crates/koharu-ml/src/bin/pp_doclayout_v3.rs (koharu_ml::bin::pp_doclayout_v3::glyph_bits at 42), crates/koharu-diffusion/src/enums.rs (WeightType::try_from at 39), crates/koharu-translator/src/remote/deepl.rs (koharu_translator::remote::deepl::target at 35), crates/koharu-llama/src/context/params.rs (KvCacheType::from at 33), crates/koharu-torch/src/wrappers/kind.rs (Kind::from_c_int at 21), and 5 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.
+ 26 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with CanvasWorkspace.CanvasWorkspace (cyclomatic 148). — Refactoring it lifts Cyclomatic Complexity from 5.6 to about 6.5/10.
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.
+ 44 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 60 down to 60 or less in Cognitive Complexity — start with TextLayout::run_with_size (cognitive 157), koharu_ml::comic_text_detector::processor::rearranged_inference (cognitive 99). — 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 2 together lifts Cognitive Complexity from 5.5 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.1 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 36 FileTooLong finding(s) in God Classes — start with model.rs (14), processor.rs (2), web.rs. — One of this dimension's main actionable groups (36 warning-level).
Resolve the 26 FunctionTooLong finding(s) in God Classes — start with Inspector.tsx (4), CanvasWorkspace.tsx, AgentPanel.tsx. — One of this dimension's main actionable groups (26 warning-level).
Resolve the 19 MethodTooLong finding(s) in God Classes — start with model.rs (4), layout.rs (2), processor.rs (2). — One of this dimension's main actionable groups (19 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.
214 duplicated block group(s) detected. A further 14 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 69 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 27 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with model.rs (10), processor.rs (4), frame.rs (3). — One of this dimension's main actionable groups (27 warning-level).
Resolve the 23 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with model.rs (9), processor.rs (6), host.rs. — One of this dimension's main actionable groups (23 warning-level).
Resolve the 17 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with model.rs (5), processor.rs (4), comic_layout_yolo26s.rs. — One of this dimension's main actionable groups (17 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.1 / 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.
26 production modules (Cargo+npm), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 24 of the 26 (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: @koharu/ui · ×7
Unstable project koharu-app
Unstable project koharu-pipeline
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project koharu-app finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project koharu-pipeline 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.
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
493 test methods: 483 unit, 10 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 98 `it`/`test` case(s) across 12 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 395 `#[test]` function(s) across 112 file(s) declaring at least one; its unit/integration split is Cargo's own — 2 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 98 tests. Measured on the JavaScript/TypeScript suite only — at least 29 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
Mock-dominated test: lets a cached canvas frame paint before synchronizing native page statepackages/koharu/tests/components/editor-components.test.tsx:563
✓ On the Gold path — maintain.
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.
7 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: icu_normalizer · ×7
✓ On the Gold path — maintain.
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 1048 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 17 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. This repository publishes itself under MIT OR Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: packages/koharu/components/editor/CanvasWorkspace.tsx (14×148=2072); crates/koharu-renderer/src/layout.rs (16×58=928); packages/koharu/components/editor/Inspector.tsx (15×37=555) Repeated repair below the complexity floor: crates/koharu-runtime/src/runtime/packages/torch.rs (18 of 25 changes were fixes); crates/koharu-runtime/src/runtime/packages/rocm.rs (11 of 19 changes were fixes); crates/koharu-runtime/src/hardware/mod.rs (6 of 7 changes were fixes)
Resolve the 24 Hotspot finding(s) in Churn × Complexity Hotspots — start with CanvasWorkspace.tsx, layout.rs, Inspector.tsx. — One of this dimension's main actionable groups (24 warning-level).
Resolve the 10 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (2), model.rs (2), torch.rs. — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
9 deducted task-comment markers across 117385 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 8 TodoComment finding(s) in Explicit Debt — start with convert.rs (2), model.rs (2), jit.rs. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with npy.rs. — One of this dimension's main actionable groups (1 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. 95 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).
47 finding(s): 0 critical, 44 high, 3 medium, 0 low. 29 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 19 file(s) — `crates/koharu-diffusion-sys/include/stable-diffusion.h`, `crates/koharu-llama-sys/include/ggml-alloc.h` (line 21, line 22, line 50, …), `crates/koharu-llama-sys/include/ggml-backend.h` (line 37, line 40, line 41, …), `crates/koharu-llama-sys/include/ggml-cpu.h` (line 37, line 38, line 40, …), `crates/koharu-llama-sys/include/ggml-opt.h` (line 46, line 49, line 50, …), … (+14 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.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 14 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (14). — One of this dimension's main actionable groups (14 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 29 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (29 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 21 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (21). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 13 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13). — One of this dimension's main actionable groups (13 issue-level).
Resolve the 10 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 330 of the 468 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with diffusion.rs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Change coupling finding(s) in Change Coupling — start with mod.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 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.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text 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 & labels6.5 / 10Strong✓ 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 UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — packages/koharu/components/preferences/SettingsPage.tsx:277
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.
A page with no <title> gives no name in the tab, history or screen-reader page list. Declare it the way this router does — Next App Router `export const metadata = { title }`, React Router/Remix `export function meta`, TanStack Start `head`, or a Helmet/Head component. — packages/koharu/app/global-error.tsx:22
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — packages/koharu/app/layout.tsx:24
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".
This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its only behaviour is bound to wheel, pointerdown, pointerup and pointermove, pointer gestures a keyboard cannot produce, and there is no key handler. The tab stop leads nowhere. Bind the same behaviour to a key handler, or provide an equivalent control elsewhere. Give it a role as well, so assistive tech can announce what it is. — packages/koharu/components/editor/CanvasWorkspace.tsx:591
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — packages/koharu/components/editor/PageRail.tsx:472
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — packages/koharu/components/editor/CanvasWorkspace.tsx:591
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 — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 97 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`Canvas` declares 20 required operations: `resize`, `setView`, `stageManifest`, `installResource`, `hasActiveManifest`, `activateFrame`, `activatePage`, `cacheFrame`, `clear`, `previewOpacity`, `beginTransform`, `updateTransform`, `finishTransform`, `cancelTransform`, `beginStroke`, `extendStroke`, `finishStroke`, `cancelStroke`, `sampleColor`, `dispose`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — packages/bridge/src/canvas.ts:17
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
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 a README to the 15 of 27 project(s) that lack one — worth up to 1.1 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Only 15/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/koharu-bindgen`, `packages/koharu`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Dependabot is configured but does not watch `npm` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Performance — Whether 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.
Do you agree with this assessment?
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
8 duplicated blocks under packages/koharu/components/ have copies in at least two of the sibling directories app, controls, editor, preferences, start — 3 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/koharu/components/controls/OutputPicker.tsx:130
packages/ui/src/components/context-menu.tsx:37 · packages/ui/src/components/dropdown-menu.tsx:28 — the two spans are one implementation copied and then locally edited — 707 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/components/context-menu.tsx:37
packages/ui/src/components/dialog.tsx:10 · packages/ui/src/components/sheet.tsx:10 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/components/dialog.tsx:10
packages/ui/src/components/combobox.tsx:93 · packages/ui/src/components/select.tsx:64 — the two spans are one implementation copied and then locally edited — 240 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/components/combobox.tsx:93
packages/ui/src/components/drawer.tsx:163 · packages/ui/src/components/popover.tsx:46 · packages/ui/src/components/sheet.tsx:79 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/drawer.tsx:163
packages/ui/src/components/empty.tsx:34 · packages/ui/src/components/item.tsx:91 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/empty.tsx:34
packages/ui/src/components/field.tsx:10 · packages/ui/src/components/message.tsx:5 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/components/field.tsx:10
packages/ui/src/components/context-menu.tsx:155 · packages/ui/src/components/menubar.tsx:109 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/ui/src/components/context-menu.tsx:155
packages/ui/src/components/popover.tsx:8 · packages/ui/src/components/tooltip.tsx:20 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/components/popover.tsx:8
packages/ui/src/components/carousel.tsx:174 · packages/ui/src/components/carousel.tsx:204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/ui/src/components/carousel.tsx:174
packages/koharu/components/editor/PageRail.tsx:328 · packages/koharu/components/start/StartView.tsx:107 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/koharu/components/editor/PageRail.tsx:328
packages/ui/src/components/context-menu.tsx:27 · packages/ui/src/components/hover-card.tsx:13 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/context-menu.tsx:27
packages/koharu/components/preferences/GenerationPreferences.tsx:38 · packages/koharu/components/preferences/GenerationPreferences.tsx:54 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/koharu/components/preferences/GenerationPreferences.tsx:38
packages/koharu/components/controls/ModelPicker.tsx:55 · packages/koharu/components/controls/OutputPicker.tsx:103 — the two spans are one implementation copied and then locally edited — 61 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/koharu/components/controls/ModelPicker.tsx:55
packages/koharu/components/controls/ModelPicker.tsx:53 · packages/koharu/components/editor/InferenceControl.tsx:386 — the two spans are one implementation copied and then locally edited — 54 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/koharu/components/controls/ModelPicker.tsx:53
packages/ui/src/components/attachment.tsx:59 · packages/ui/src/components/empty.tsx:37 · packages/ui/src/components/item.tsx:94 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/attachment.tsx:59
packages/ui/src/components/breadcrumb.tsx:36 · packages/ui/src/components/bubble.tsx:59 · packages/ui/src/components/button-group.tsx:35 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/breadcrumb.tsx:36
packages/ui/src/components/button-group.tsx:25 · packages/ui/src/components/field.tsx:72 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/components/button-group.tsx:25
packages/koharu/components/editor/ActivityCenter.tsx:117 · packages/koharu/components/editor/ActivityCenter.tsx:170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/koharu/components/editor/ActivityCenter.tsx:117
packages/ui/src/components/accordion.tsx:11 · packages/ui/src/components/avatar.tsx:23 · packages/ui/src/components/combobox.tsx:165 · packages/ui/src/components/combobox.tsx:185 · +7 more site(s) not listed — the 11 copies are spread across 10 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/accordion.tsx:11
packages/ui/src/components/alert.tsx:37 · packages/ui/src/components/attachment.tsx:83 · packages/ui/src/components/avatar.tsx:73 · packages/ui/src/components/breadcrumb.tsx:19 · +13 more site(s) not listed — the 17 copies are spread across 13 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/alert.tsx:37
packages/ui/src/components/alert.tsx:32 · packages/ui/src/components/attachment.tsx:75 · packages/ui/src/components/avatar.tsx:68 · packages/ui/src/components/breadcrumb.tsx:14 · +14 more site(s) not listed — the 18 copies are spread across 13 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/alert.tsx:32
packages/ui/src/components/button.tsx:43 · packages/ui/src/components/toggle.tsx:30 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/components/button.tsx:43
packages/koharu/components/editor/ActivityCenter.tsx:90 · packages/koharu/components/editor/ActivityCenter.tsx:183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/koharu/components/editor/ActivityCenter.tsx:90
packages/koharu/components/editor/AgentPanel.tsx:157 · packages/koharu/components/editor/Inspector.tsx:297 · packages/koharu/components/preferences/SettingsPage.tsx:288 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — packages/koharu/components/editor/AgentPanel.tsx:157
packages/ui/src/components/item.tsx:61 · packages/ui/src/components/marker.tsx:23 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/components/item.tsx:61
packages/koharu/components/editor/CanvasWorkspace.tsx:901 · packages/koharu/components/editor/Inspector.tsx:1032 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/koharu/components/editor/CanvasWorkspace.tsx:901
packages/koharu/components/preferences/GenerationPreferences.tsx:46 · packages/koharu/components/preferences/PipelinePreferences.tsx:122 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/koharu/components/preferences/GenerationPreferences.tsx:46
packages/ui/src/components/alert-dialog.tsx:4 · packages/ui/src/components/dialog.tsx:6 · packages/ui/src/components/sheet.tsx:6 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/components/alert-dialog.tsx:4
packages/bridge/src/canvas.ts:258 · packages/koharu/components/editor/useCanvas.ts:173 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/bridge/src/canvas.ts:258
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
(anonymous) has cyclomatic complexity 33 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:601
TypeInspector has cyclomatic complexity 27 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/Inspector.tsx:131
layerFrame has cyclomatic complexity 21 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/lib/geometry.ts:65
SettingsPage has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/preferences/SettingsPage.tsx:58
RuntimeSelector has cyclomatic complexity 20 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/InferenceControl.tsx:86
down has cyclomatic complexity 19 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:343
(anonymous) has cyclomatic complexity 18 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:202
finishGesture has cyclomatic complexity 17 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:503
Updater has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/app/Updater.tsx:31
(anonymous) has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/controls/ModelPicker.tsx:112
moveGesture has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:431
TitleBar has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/app/TitleBar.tsx:40
CanvasWorkspace has cyclomatic complexity 16 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:91
AgentPanel has cyclomatic complexity 14 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/AgentPanel.tsx:38
replaceStage has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/preferences/models.ts:59
ModelPicker has cyclomatic complexity 13 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/controls/ModelPicker.tsx:18
(anonymous) has cyclomatic complexity 12 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:763
getPayloadConfigFromPayload has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:330
scriptRank has cyclomatic complexity 12 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/controls/FontPicker.tsx:510
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files7.9 / 10Strong✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
packages/koharu/components/editor/Inspector.tsx has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/koharu/components/editor/Inspector.tsx:1
packages/koharu/components/editor/CanvasWorkspace.tsx has 978 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/koharu/components/editor/CanvasWorkspace.tsx:1
packages/ui/src/components/sidebar.tsx has 674 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/components/sidebar.tsx:1
packages/koharu/components/editor/PageRail.tsx has 555 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/koharu/components/editor/PageRail.tsx:1
packages/koharu/components/controls/FontPicker.tsx has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/koharu/components/controls/FontPicker.tsx:1
packages/koharu/components/editor/InferenceControl.tsx has 433 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/koharu/components/editor/InferenceControl.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.1 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×11) — packages/koharu/components/editor/AgentPanel.tsx:1, REDACTED:1, packages/koharu/components/editor/Editor.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.9 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 71 application, 6 tooling and 14 test entry point(s) detected in this repo. Gate removals on `bun run build` — an undetected custom entry would make these reachable.
no import path from any entry point (71 application, 6 tooling, 14 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make — packages/koharu/instrumentation-client.ts
Nothing imports this binding — it is safe to review for removal. — packages/koharu/lib/backend.ts:31
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. — packages/koharu/components/editor/ToolBar.tsx:181
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
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 unescaped3.5 / 10Weak✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`Object.entries(THEMES).map(([theme,prefix])=>`
${prefix} [data-chart=${id}] {
${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:96
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
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.
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 `REDACTED` 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.
`debug!` at line 212 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/koharu-diffusion/src/callbacks.rs:212
`info!` at line 214 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/koharu-diffusion/src/callbacks.rs:214
`warn!` at line 215 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/koharu-diffusion/src/callbacks.rs:215
`error!` at line 216 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/koharu-diffusion/src/callbacks.rs:216
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
3/4 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~0.9 `!` null assertions per 1k TypeScript source lines — 16 assertion(s) across the 17436 source line(s) of the 106 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: packages/koharu/components/editor/CanvasWorkspace.tsx (6), REDACTED (5), packages/koharu/components/editor/Inspector.tsx (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 19 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 49 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust, TypeScript 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. 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, .ts, .tsx, 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.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 6 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 MEASURED: the JavaScript/TypeScript half could not be measured — packages/koharu/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 66 value object(s); 2 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Rust source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `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. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R5 Dependency Freshness — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
S1 Web-Security Posture — No web surface: 374 Rust file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation and obsolete TLS versions, and none was found. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker. If this codebase starts serving HTTP, the dimension reactivates automatically.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC3 · Page structure· Document without a <title> · ×1
Document without a <title> packages/koharu/app/global-error.tsx:22— A page with no <title> gives no name in the tab, history or screen-reader page list. Declare it the way this router does — Next App Router `export const metadata = { title }`, React Router/Remix `export function meta`, TanStack Start `head`, or a Helmet/Head component.
Focusable <div> isn't keyboard-operable packages/koharu/components/editor/CanvasWorkspace.tsx:591— This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its only behaviour is bound to wheel, pointerdown, pointerup and pointermove, pointer gestures a keyboard cannot produce, and there is no key handler. The tab stop leads nowhere. Bind the same behaviour to a key handler, or provide an equivalent control elsewhere. Give it a role as well, so assistive tech can announce what it is.
AC4 · Keyboard semantics· Click handler on a non-interactive <article> · ×1
Click handler on a non-interactive <article> packages/koharu/components/editor/PageRail.tsx:472— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
FileTooLong: pp_doclayout_v3/model.rs crates/koharu-ml/src/pp_doclayout_v3/model.rs— FileTooLong — 1778 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 1278 over it, 3.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/web.rs crates/koharu-canvas/src/web.rs— FileTooLong — 1536 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 1036 over it, 3.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/layout.rs crates/koharu-renderer/src/layout.rs— FileTooLong — 1536 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 1036 over it, 3.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: stages/detection.rs crates/koharu-pipeline/src/stages/detection.rs— FileTooLong — 1368 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 868 over it, 2.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: comic_text_bubble_detector/model.rs crates/koharu-ml/src/comic_text_bubble_detector/model.rs— FileTooLong — 1324 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 824 over it, 2.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/renderer.rs crates/koharu-renderer/src/renderer.rs— FileTooLong — 1301 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 801 over it, 2.60× 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: commands/project.rs crates/koharu-app/src/commands/project.rs— FileTooLong — 1034 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: Project (2 blocks, 254-1238). The bar is 500 significant lines; this is 534 over it, 2.07× 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: comic_text_detector/processor.rs crates/koharu-ml/src/comic_text_detector/processor.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 43 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/params.rs crates/koharu-diffusion/src/params.rs— FileTooLong — 977 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 477 over it, 1.95× 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: local/catalog.rs crates/koharu-translator/src/local/catalog.rs— FileTooLong — 924 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 424 over it, 1.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: editor/Inspector.tsx packages/koharu/components/editor/Inspector.tsx— FileTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 399 over it, 1.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: koharu_layout_rfdetr_seg_2xl/model.rs crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs— FileTooLong — 892 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 392 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/fonts.rs crates/koharu-renderer/src/fonts.rs— FileTooLong — 869 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 369 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: editor/CanvasWorkspace.tsx packages/koharu/components/editor/CanvasWorkspace.tsx— FileTooLong — 843 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: CanvasWorkspace (91-899). The bar is 500 significant lines; this is 343 over it, 1.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/state.rs crates/koharu-scene/src/state.rs— FileTooLong — 816 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 316 over it, 1.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: paddle_ocr_vl/model.rs crates/koharu-ml/src/paddle_ocr_vl/model.rs— FileTooLong — 783 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 283 over it, 1.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/compositor.rs crates/koharu-rasterizer/src/compositor.rs— FileTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 60% of them inside a single declaration: GpuCompositor (2 blocks, 195-789). The bar is 500 significant lines; this is 265 over it, 1.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: manga_ocr/model.rs crates/koharu-ml/src/manga_ocr/model.rs— FileTooLong — 741 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 241 over it, 1.48× 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: baberu_ocr/model.rs crates/koharu-ml/src/baberu_ocr/model.rs— FileTooLong — 718 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 218 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: comic_text_detector/model.rs crates/koharu-ml/src/comic_text_detector/model.rs— FileTooLong — 710 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 210 over it, 1.42× 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/edit.rs crates/koharu-scene/src/edit.rs— FileTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: Edit (2 blocks, 31-905). The bar is 500 significant lines; this is 205 over it, 1.41× 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/prepared.rs crates/koharu-rasterizer/src/prepared.rs— FileTooLong — 655 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 155 over it, 1.31× 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: stages/inpainting.rs crates/koharu-pipeline/src/stages/inpainting.rs— FileTooLong — 651 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 151 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: recognizer/model.rs crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs— FileTooLong — 634 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 134 over it, 1.27× 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: llm/model.rs crates/koharu-ml/src/llm/model.rs— FileTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: Model (3 blocks, 41-576). The bar is 500 significant lines; this is 104 over it, 1.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
Duplicated block (6 lines × 2) crates/koharu-app/src/commands/canvas.rs:148— crates/koharu-app/src/commands/canvas.rs:148-153 | crates/koharu-app/src/commands/canvas.rs:174-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/koharu-diffusion/src/params.rs:838— crates/koharu-diffusion/src/params.rs:838-843 | crates/koharu-diffusion/src/params.rs:1055-1060 — both copies are in the same file, so extract the block into 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/koharu-ml/src/aot_inpainting/processor.rs:187— crates/koharu-ml/src/aot_inpainting/processor.rs:187-192 | crates/koharu-ml/src/lama/processor.rs:287-292 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-ml/src/baberu_ocr/model.rs:897— crates/koharu-ml/src/baberu_ocr/model.rs:897-902 | crates/koharu-ml/src/hayai_ocr/model.rs:804-809 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-ml/src/bin/aot_inpainting.rs:27— crates/koharu-ml/src/bin/aot_inpainting.rs:27-32 | crates/koharu-ml/src/bin/lama.rs:24-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:117— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:117-122 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:117-122 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:360— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:360-365 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:328-333 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:122— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:122-127 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:146-151 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/comic_text_detector/model.rs:701— crates/koharu-ml/src/comic_text_detector/model.rs:701-706 | crates/koharu-ml/src/comic_text_detector/model.rs:831-836 — both copies are in the same file, so extract the block into 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/koharu-ml/src/flux2_klein/mod.rs:81— crates/koharu-ml/src/flux2_klein/mod.rs:81-86 | crates/koharu-ml/src/flux2_klein/mod.rs:233-238 — both copies are in the same file, so extract the block into 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/koharu-ml/src/speech_bubble_yolo11n/processor.rs:399— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:399-404 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:399-406 — `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 131 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:422— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:422-427 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:424-429 — `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 131 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-pipeline/src/stages/inpainting.rs:817— crates/koharu-pipeline/src/stages/inpainting.rs:817-823 | crates/koharu-renderer/src/bubble.rs:502-507 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-rasterizer/src/frame.rs:34— crates/koharu-rasterizer/src/frame.rs:34-39 | crates/koharu-renderer/src/frame.rs:41-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-renderer/src/renderer.rs:727— crates/koharu-renderer/src/renderer.rs:727-732 | crates/koharu-renderer/src/renderer.rs:946-951 — both copies are in the same file, so extract the block into 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/koharu-torch/src/nn/batch_norm.rs:48— crates/koharu-torch/src/nn/batch_norm.rs:48-53 | crates/koharu-torch/src/nn/group_norm.rs:46-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/koharu-torch/src/wrappers/jit.rs:686— crates/koharu-torch/src/wrappers/jit.rs:686-691 | crates/koharu-torch/src/wrappers/jit.rs:699-704 — both copies are in the same file, so extract the block into 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/koharu-ml/src/baberu_ocr/model.rs:889— crates/koharu-ml/src/baberu_ocr/model.rs:889-894 | crates/koharu-ml/src/paddle_ocr_vl/model.rs:901-906 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:418— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:418-423 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:421-426 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1730— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1730-1735 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2262-2267 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/pp_doclayout_v3/model.rs:813— crates/koharu-ml/src/pp_doclayout_v3/model.rs:813-818 | crates/koharu-ml/src/pp_ocr_v6/pp_lcnet_v4.rs:275-280 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:581— crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:581-586 | crates/koharu-ml/src/speech_bubble_yolov8m/model.rs:648-653 — `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 32 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:588— crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:588-593 | crates/koharu-ml/src/speech_bubble_yolov8m/model.rs:674-679 — `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 32 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) crates/koharu-rasterizer/src/frame.rs:77— crates/koharu-rasterizer/src/frame.rs:77-82 | crates/koharu-renderer/src/frame.rs:81-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/koharu-rasterizer/src/frame.rs:299— crates/koharu-rasterizer/src/frame.rs:299-304 | crates/koharu-rasterizer/src/prepared.rs:596-601 — 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.
FunctionTooLong: CanvasWorkspace.CanvasWorkspace packages/koharu/components/editor/CanvasWorkspace.tsx:91— FunctionTooLong — CanvasWorkspace runs 670 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 570 over it, 6.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AgentPanel.AgentPanel packages/koharu/components/editor/AgentPanel.tsx:38— FunctionTooLong — AgentPanel runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: PageRail.PageRail packages/koharu/components/editor/PageRail.tsx:69— FunctionTooLong — PageRail runs 269 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 169 over it, 2.69× 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: Inspector.TypeInspector packages/koharu/components/editor/Inspector.tsx:131— FunctionTooLong — TypeInspector runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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: StartView.StartView packages/koharu/components/start/StartView.tsx:27— FunctionTooLong — StartView runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: InferenceControl.RuntimeSelector packages/koharu/components/editor/InferenceControl.tsx:86— FunctionTooLong — RuntimeSelector runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) 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: TitleBar.TitleBar packages/koharu/components/app/TitleBar.tsx:40— FunctionTooLong — TitleBar runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: koharu_psd::engine_data::encode_engine_data crates/koharu-psd/src/engine_data.rs:46— FunctionTooLong — koharu_psd::engine_data::encode_engine_data runs 166 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 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: koharu_ml::comic_text_detector::processor::rearranged_inference crates/koharu-ml/src/comic_text_detector/processor.rs:114— FunctionTooLong — koharu_ml::comic_text_detector::processor::rearranged_inference runs 162 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 62 over it, 1.62× 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: SettingsPage.SettingsPage packages/koharu/components/preferences/SettingsPage.tsx:58— FunctionTooLong — SettingsPage runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× 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: koharu_app::app::run crates/koharu-app/src/app.rs:56— FunctionTooLong — koharu_app::app::run runs 144 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 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ModelPicker.ModelPicker packages/koharu/components/controls/ModelPicker.tsx:18— FunctionTooLong — ModelPicker runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: FontPicker.FontPicker packages/koharu/components/controls/FontPicker.tsx:50— FunctionTooLong — FontPicker runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: calendar.Calendar packages/ui/src/components/calendar.tsx:15— FunctionTooLong — Calendar runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: Updater.Updater packages/koharu/components/app/Updater.tsx:31— FunctionTooLong — Updater runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: koharu_app::commands::processing::process crates/koharu-app/src/commands/processing.rs:77— FunctionTooLong — koharu_app::commands::processing::process runs 123 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 23 over it, 1.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: TranslationPreferences.TranslationPreferences packages/koharu/components/preferences/TranslationPreferences.tsx:32— FunctionTooLong — TranslationPreferences runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: Inspector.LayerEditor packages/koharu/components/editor/Inspector.tsx:771— FunctionTooLong — LayerEditor runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: Inspector.LayersInspector packages/koharu/components/editor/Inspector.tsx:493— FunctionTooLong — LayersInspector runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: OutputPicker.OutputPicker packages/koharu/components/controls/OutputPicker.tsx:24— FunctionTooLong — OutputPicker runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: Inspector.LayerRow packages/koharu/components/editor/Inspector.tsx:643— FunctionTooLong — LayerRow runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useCanvas.useCanvas packages/koharu/components/editor/useCanvas.ts:25— FunctionTooLong — useCanvas runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SelectionControls.SelectionControls packages/koharu/components/editor/SelectionControls.tsx:46— FunctionTooLong — SelectionControls runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: koharu_psd::document::build crates/koharu-psd/src/document.rs:88— FunctionTooLong — koharu_psd::document::build runs 111 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 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: TypesettingPreferences.TypesettingPreferences packages/koharu/components/preferences/TypesettingPreferences.tsx:13— FunctionTooLong — TypesettingPreferences runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: packages/koharu/components/editor/CanvasWorkspace.tsx packages/koharu/components/editor/CanvasWorkspace.tsx:91— packages/koharu/components/editor/CanvasWorkspace.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in CanvasWorkspace.CanvasWorkspace at line 91. 2 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/editor/CanvasWorkspace.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-renderer/src/layout.rs crates/koharu-renderer/src/layout.rs:463— crates/koharu-renderer/src/layout.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in TextLayout::run_with_size at line 463. 4 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-renderer/src/layout.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: packages/koharu/components/editor/Inspector.tsx packages/koharu/components/editor/Inspector.tsx:493— packages/koharu/components/editor/Inspector.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in Inspector.LayersInspector at line 493. 2 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/editor/Inspector.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/koharu/components/editor/InferenceControl.tsx packages/koharu/components/editor/InferenceControl.tsx:86— packages/koharu/components/editor/InferenceControl.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in InferenceControl.RuntimeSelector at line 86. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/editor/InferenceControl.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/koharu/components/preferences/SettingsPage.tsx packages/koharu/components/preferences/SettingsPage.tsx:58— packages/koharu/components/preferences/SettingsPage.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in SettingsPage.SettingsPage at line 58. 1 of those changes was a fix/bug commit, 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/preferences/SettingsPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/koharu/components/editor/PageRail.tsx packages/koharu/components/editor/PageRail.tsx:69— packages/koharu/components/editor/PageRail.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in PageRail.PageRail at line 69. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/editor/PageRail.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-renderer/src/text_renderer.rs crates/koharu-renderer/src/text_renderer.rs:148— crates/koharu-renderer/src/text_renderer.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in TextRenderer::render_descriptor at line 148. 3 of those changes were fix/bug commits, and the other 9 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-renderer/src/text_renderer.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/koharu-renderer/src/bubble.rs crates/koharu-renderer/src/bubble.rs:116— crates/koharu-renderer/src/bubble.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in koharu_renderer::bubble::decompose_lobes at line 116. 2 of those changes were fix/bug commits, and the other 8 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-renderer/src/bubble.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: packages/koharu/components/controls/FontPicker.tsx packages/koharu/components/controls/FontPicker.tsx:50— packages/koharu/components/controls/FontPicker.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in FontPicker.FontPicker at line 50. 1 of those changes was a fix/bug commit, and the other 8 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/controls/FontPicker.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-rasterizer/src/compositor.rs crates/koharu-rasterizer/src/compositor.rs:453— crates/koharu-rasterizer/src/compositor.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in GpuCompositor::render at line 453. 1 of those changes was a fix/bug commit, and the other 8 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-rasterizer/src/compositor.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/koharu-translator/src/bin/translate.rs crates/koharu-translator/src/bin/translate.rs:107— crates/koharu-translator/src/bin/translate.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in koharu_translator::bin::translate::prepare_secret at line 107. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-translator/src/bin/translate.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: packages/koharu/components/editor/CanvasOverlay.tsx packages/koharu/components/editor/CanvasOverlay.tsx:33— packages/koharu/components/editor/CanvasOverlay.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in CanvasOverlay.CanvasOverlay at line 33. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/editor/CanvasOverlay.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/koharu/components/app/TitleBar.tsx packages/koharu/components/app/TitleBar.tsx:40— packages/koharu/components/app/TitleBar.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in TitleBar.TitleBar at line 40. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/app/TitleBar.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-diffusion/src/enums.rs crates/koharu-diffusion/src/enums.rs:69— crates/koharu-diffusion/src/enums.rs changed 4 times in last 90 days, max cyclomatic complexity 39 in WeightType::try_from at line 69. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-diffusion/src/enums.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/koharu-pipeline/src/stages/inpainting.rs crates/koharu-pipeline/src/stages/inpainting.rs:177— crates/koharu-pipeline/src/stages/inpainting.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Model::run at line 177. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-pipeline/src/stages/inpainting.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: packages/koharu/components/editor/AgentPanel.tsx packages/koharu/components/editor/AgentPanel.tsx:38— packages/koharu/components/editor/AgentPanel.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in AgentPanel.AgentPanel at line 38. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/editor/AgentPanel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-scene/src/edit.rs crates/koharu-scene/src/edit.rs:202— crates/koharu-scene/src/edit.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in Edit::remove_entity at line 202. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-scene/src/edit.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: packages/koharu/components/app/Updater.tsx packages/koharu/components/app/Updater.tsx:31— packages/koharu/components/app/Updater.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Updater.Updater at line 31. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/app/Updater.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-scene/src/schema.rs crates/koharu-scene/src/schema.rs:75— crates/koharu-scene/src/schema.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in koharu_scene::schema::validate_entity at line 75. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-scene/src/schema.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/koharu-pipeline/src/stages/ocr.rs crates/koharu-pipeline/src/stages/ocr.rs:92— crates/koharu-pipeline/src/stages/ocr.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Model::run at line 92. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-pipeline/src/stages/ocr.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: packages/koharu/components/controls/OutputPicker.tsx packages/koharu/components/controls/OutputPicker.tsx:24— packages/koharu/components/controls/OutputPicker.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in OutputPicker.OutputPicker at line 24. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/controls/OutputPicker.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/koharu/components/controls/ModelPicker.tsx packages/koharu/components/controls/ModelPicker.tsx:18— packages/koharu/components/controls/ModelPicker.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ModelPicker.ModelPicker at line 18. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/controls/ModelPicker.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/koharu-translator/src/provider.rs crates/koharu-translator/src/provider.rs:90— crates/koharu-translator/src/provider.rs changed 5 times in last 90 days, max cyclomatic complexity 16 in ProvidersConfig::from_entries at line 90. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-translator/src/provider.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/koharu-psd/src/document.rs crates/koharu-psd/src/document.rs:88— crates/koharu-psd/src/document.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in koharu_psd::document::build at line 88. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-psd/src/document.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.
Duplicated block (5 lines × 2) crates/koharu-app/src/commands/agent/host.rs:37— crates/koharu-app/src/commands/agent/host.rs:37-41 | crates/koharu-app/src/commands/agent/host.rs:242-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-app/src/commands/canvas.rs:390— crates/koharu-app/src/commands/canvas.rs:390-394 | crates/koharu-app/src/commands/project.rs:1274-1278 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:145— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:145-149 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:145-149 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:314— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:314-318 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:207-211 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:321— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:321-326 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:373-377 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:609— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:609-613 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:560-564 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:205— crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:205-209 | crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:468-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:992— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:992-996 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1116-1120 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/processor.rs:67— crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/processor.rs:67-71 | crates/koharu-ml/src/manga_text_mask/processor.rs:28-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/koharu-ml/src/pp_doclayout_v3/model.rs:2229— crates/koharu-ml/src/pp_doclayout_v3/model.rs:2229-2233 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2235-2239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-pipeline/src/resources/vram.rs:159— crates/koharu-pipeline/src/resources/vram.rs:159-163 | crates/koharu-pipeline/src/resources/windows.rs:106-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/koharu-pipeline/src/stages/detection.rs:1430— crates/koharu-pipeline/src/stages/detection.rs:1430-1434 | crates/koharu-pipeline/src/stages/inpainting.rs:497-501 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/koharu-torch/src/vision/resnet.rs:67— crates/koharu-torch/src/vision/resnet.rs:67-71 | crates/koharu-torch/src/vision/resnet.rs:160-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-torch/src/vision/rust_image.rs:96— crates/koharu-torch/src/vision/rust_image.rs:96-100 | crates/koharu-torch/src/vision/rust_image.rs:108-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-ml/src/baberu_ocr/model.rs:875— crates/koharu-ml/src/baberu_ocr/model.rs:875-879 | crates/koharu-ml/src/paddle_ocr_vl/model.rs:887-891 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/koharu-ml/src/bin/comic_onomatopoeia.rs:124— crates/koharu-ml/src/bin/comic_onomatopoeia.rs:124-128 | crates/koharu-ml/src/bin/koharu_layout_rfdetr_seg_2xl.rs:92-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:230— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:230-234 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:310-314 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:151— crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:151-155 | crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:511-515 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:60— crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:60-64 | crates/koharu-ml/src/pp_ocr_v6/rec/processor.rs:70-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/koharu-torch/src/wrappers/jit.rs:616— crates/koharu-torch/src/wrappers/jit.rs:616-620 | crates/koharu-torch/src/wrappers/tensor.rs:565-569 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:67— crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:67-71 | crates/koharu-ml/src/pp_ocr_v6/rec/processor.rs:77-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_text_detector/model.rs:762— crates/koharu-ml/src/comic_text_detector/model.rs:762-766 | crates/koharu-ml/src/comic_text_detector/model.rs:792-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-ml/src/comic_text_detector/processor.rs:861— crates/koharu-ml/src/comic_text_detector/processor.rs:861-865 | crates/koharu-ml/src/comic_text_detector/processor.rs:868-872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×21
MethodTooLong: TextLayout.run_with_size crates/koharu-renderer/src/layout.rs:463— MethodTooLong — run_with_size runs 319 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 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: KoharuHost.invoke crates/koharu-app/src/commands/agent/host.rs:233— MethodTooLong — invoke runs 162 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 62 over it, 1.62× 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: Model.run crates/koharu-pipeline/src/stages/inpainting.rs:177— MethodTooLong — run 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.
MethodTooLong: TextRenderer.render_descriptor crates/koharu-renderer/src/text_renderer.rs:148— MethodTooLong — render_descriptor runs 145 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 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: YoloV5.new crates/koharu-ml/src/comic_text_detector/model.rs:360— MethodTooLong — new runs 142 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 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GpuCompositor.render crates/koharu-rasterizer/src/compositor.rs:453— MethodTooLong — render 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.
MethodTooLong: KoharuLayoutRFDetrImageProcessor.postprocess crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/processor.rs:75— MethodTooLong — postprocess 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.
MethodTooLong: ContextParams.to_native crates/koharu-diffusion/src/params.rs:199— MethodTooLong — to_native runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RTDetrV2Model.new crates/koharu-ml/src/comic_text_bubble_detector/model.rs:111— MethodTooLong — new runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PPDocLayoutV3Model.new crates/koharu-ml/src/pp_doclayout_v3/model.rs:90— MethodTooLong — new runs 124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Operation.apply crates/koharu-scene/src/patch.rs:76— MethodTooLong — apply runs 119 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VideoGenerationParams.to_native crates/koharu-diffusion/src/params.rs:1039— MethodTooLong — to_native runs 118 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 18 over it, 1.18× 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: Flux2KleinInpaint.inference crates/koharu-ml/src/flux2_klein/mod.rs:149— MethodTooLong — inference runs 115 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 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Traversal.text_draft crates/koharu-renderer/src/renderer.rs:714— MethodTooLong — text_draft runs 112 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 12 over it, 1.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: PPDocLayoutV3Model.forward crates/koharu-ml/src/pp_doclayout_v3/model.rs:243— MethodTooLong — forward runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TextLayout.append_balanced_segment_lines crates/koharu-renderer/src/layout.rs:955— MethodTooLong — append_balanced_segment_lines runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PPDocLayoutV3ImageProcessor.postprocess_batch crates/koharu-ml/src/pp_doclayout_v3/processor.rs:128— MethodTooLong — postprocess_batch runs 109 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 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Traversal.visit_children crates/koharu-renderer/src/renderer.rs:584— MethodTooLong — visit_children runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Project.apply_raster_stroke crates/koharu-app/src/commands/project.rs:741— MethodTooLong — apply_raster_stroke runs 101 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 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (9 lines × 2) crates/koharu-ml/src/bin/comic_layout_yolo26s.rs:162— crates/koharu-ml/src/bin/comic_layout_yolo26s.rs:162-170 | crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:73-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:174— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:174-182 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:254-262 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:203— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:203-211 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:283-291 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:158— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:158-166 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:184-192 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:346— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:346-354 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:394-402 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:826— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:826-834 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:937-945 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/koharu-ml/src/paddle_ocr_vl/model.rs:969— crates/koharu-ml/src/paddle_ocr_vl/model.rs:969-977 | crates/koharu-ml/src/paddle_ocr_vl/model.rs:978-986 — both copies are in the same file, so extract the block into 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/koharu-runtime/src/runtime/packages/diffusion.rs:159— crates/koharu-runtime/src/runtime/packages/diffusion.rs:159-167 | crates/koharu-runtime/src/runtime/packages/llama.rs:159-167 — before extracting anything, compare `crates/koharu-runtime/src/runtime/packages/diffusion.rs` and `crates/koharu-runtime/src/runtime/packages/llama.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/koharu-torch/src/nn/conv.rs:124— crates/koharu-torch/src/nn/conv.rs:124-132 | crates/koharu-torch/src/nn/conv_transpose.rs:63-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/koharu-torch/src/tensor/npy.rs:187— crates/koharu-torch/src/tensor/npy.rs:187-195 | crates/koharu-torch/src/tensor/npy.rs:210-218 — both copies are in the same file, so extract the block into 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/koharu-torch/src/vision/resnet.rs:72— crates/koharu-torch/src/vision/resnet.rs:72-80 | crates/koharu-torch/src/vision/resnet.rs:165-173 — both copies are in the same file, so extract the block into 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/koharu-ml/src/bin/comic_onomatopoeia.rs:221— crates/koharu-ml/src/bin/comic_onomatopoeia.rs:221-229 | crates/koharu-ml/src/bin/pp_ocr_v6.rs:84-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/koharu-torch/src/vision/densenet.rs:10— crates/koharu-torch/src/vision/densenet.rs:10-18 | crates/koharu-torch/src/vision/resnet.rs:7-15 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/koharu-ml/src/lama/model.rs:332— crates/koharu-ml/src/lama/model.rs:332-340 | crates/koharu-ml/src/lama/model.rs:341-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 (9 lines × 2) crates/koharu-translator/src/remote/lm_studio.rs:85— crates/koharu-translator/src/remote/lm_studio.rs:85-93 | crates/koharu-translator/src/remote/openai_compatible.rs:85-93 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai_compatible.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 140 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/koharu-ml/src/lama/processor.rs:157— crates/koharu-ml/src/lama/processor.rs:157-165 | crates/koharu-ml/src/lama/processor.rs:169-177 — both copies are in the same file, so extract the block into 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/koharu-ml/src/comic_layout_yolo26s/processor.rs:335— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:335-343 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:383-391 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/koharu-llama/src/context/kv_cache.rs:60— crates/koharu-llama/src/context/kv_cache.rs:60-67 | crates/koharu-llama/src/context/kv_cache.rs:146-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 (8 lines × 2) crates/koharu-ml/src/aot_inpainting/processor.rs:102— crates/koharu-ml/src/aot_inpainting/processor.rs:102-109 | crates/koharu-ml/src/rorem_mixed/processor.rs:139-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/koharu-ml/src/aot_inpainting/processor.rs:136— crates/koharu-ml/src/aot_inpainting/processor.rs:136-143 | crates/koharu-ml/src/rorem_mixed/processor.rs:164-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:320— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:320-327 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:264-271 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:653— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:653-660 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:604-611 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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/koharu-ml/src/comic_text_bubble_detector/model.rs:1738— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1738-1745 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2270-2277 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/koharu-ml/src/comic_text_detector/processor.rs:1227— crates/koharu-ml/src/comic_text_detector/processor.rs:1227-1234 | crates/koharu-ml/src/comic_text_detector/processor.rs:1248-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 (8 lines × 2) crates/koharu-ml/src/manga_ocr/model.rs:551— crates/koharu-ml/src/manga_ocr/model.rs:551-558 | crates/koharu-ml/src/manga_ocr/model.rs:916-923 — both copies are in the same file, so extract the block into 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/koharu-pipeline/src/stages/detection.rs:979— crates/koharu-pipeline/src/stages/detection.rs:979-986 | crates/koharu-pipeline/src/stages/detection.rs:990-997 — both copies are in the same file, so extract the block into 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/koharu-torch/src/wrappers/tensor.rs:587— crates/koharu-torch/src/wrappers/tensor.rs:587-594 | crates/koharu-torch/src/wrappers/tensor.rs:613-620 — both copies are in the same file, so extract the block into 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/koharu-ml/src/aot_inpainting/processor.rs:173— crates/koharu-ml/src/aot_inpainting/processor.rs:173-180 | crates/koharu-ml/src/lama/processor.rs:330-337 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1570— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1570-1577 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2083-2090 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1579— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1579-1586 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2092-2099 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/koharu-pipeline/src/resources/linux.rs:139— crates/koharu-pipeline/src/resources/linux.rs:139-146 | crates/koharu-pipeline/src/resources/windows.rs:120-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/koharu-translator/src/remote/lm_studio.rs:130— crates/koharu-translator/src/remote/lm_studio.rs:130-137 | crates/koharu-translator/src/remote/openai_compatible.rs:127-134 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai_compatible.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 140 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.
koharu_ml::comic_text_detector::processor::rearranged_inference (cognitive 99) crates/koharu-ml/src/comic_text_detector/processor.rs:114— koharu_ml::comic_text_detector::processor::rearranged_inference has cognitive complexity 99 (threshold 15). Drivers by points: loops 17 (58 pts), if/else 20 (39 pts), boolean chains 2 (nesting depth added 60). 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.
koharu_ml::comic_text_detector::processor::connected_components (cognitive 42) crates/koharu-ml/src/comic_text_detector/processor.rs:1128— koharu_ml::comic_text_detector::processor::connected_components has cognitive complexity 42 (threshold 15). Drivers by points: if/else 4 (21 pts), loops 5 (15 pts), boolean chains 6 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::bin::koharu_layout_rfdetr_seg_2xl::draw_detections (cognitive 32) crates/koharu-ml/src/bin/koharu_layout_rfdetr_seg_2xl.rs:98— koharu_ml::bin::koharu_layout_rfdetr_seg_2xl::draw_detections 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.
koharu_ml::bin::comic_layout_yolo26s::annotated_image (cognitive 28) crates/koharu-ml/src/bin/comic_layout_yolo26s.rs:172— koharu_ml::bin::comic_layout_yolo26s::annotated_image has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::comic_onomatopoeia::detector::processor::fill_polygon (cognitive 22) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:500— koharu_ml::comic_onomatopoeia::detector::processor::fill_polygon has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (10 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.
koharu_ml::comic_text_detector::processor::try_merge_text_line (cognitive 22) crates/koharu-ml/src/comic_text_detector/processor.rs:752— koharu_ml::comic_text_detector::processor::try_merge_text_line has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::pp_ocr_v6::det::processor::opencv_fill_polygon (cognitive 22) crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:449— koharu_ml::pp_ocr_v6::det::processor::opencv_fill_polygon has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (10 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.
koharu_ml::comic_text_detector::processor::sort_regions (cognitive 18) crates/koharu-ml/src/comic_text_detector/processor.rs:818— koharu_ml::comic_text_detector::processor::sort_regions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::manga_text_mask::processor::fill_holes (cognitive 18) crates/koharu-ml/src/manga_text_mask/processor.rs:292— koharu_ml::manga_text_mask::processor::fill_holes has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 4 (7 pts), boolean chains 2 (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.
koharu_ml::speech_bubble_yolov8m::processor::non_max_suppression (cognitive 18) crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:308— koharu_ml::speech_bubble_yolov8m::processor::non_max_suppression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::comic_onomatopoeia::detector::processor::draw_line_8_connected (cognitive 17) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:557— koharu_ml::comic_onomatopoeia::detector::processor::draw_line_8_connected has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::pp_ocr_v6::det::processor::draw_line_8_connected (cognitive 17) crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:507— koharu_ml::pp_ocr_v6::det::processor::draw_line_8_connected has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_ml::speech_bubble_yolo11n::processor::non_max_suppression (cognitive 17) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:304— koharu_ml::speech_bubble_yolo11n::processor::non_max_suppression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (7 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:152— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:152-158 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:152-158 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:369— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:369-375 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:337-343 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:578— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:578-584 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:518-524 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:247— crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:247-253 | crates/koharu-ml/src/comic_text_bubble_detector/model.rs:402-408 — 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) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:662— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:662-668 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:613-619 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1628— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1628-1634 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2132-2138 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/mod.rs:74— crates/koharu-ml/src/speech_bubble_yolo11n/mod.rs:74-80 | crates/koharu-ml/src/speech_bubble_yolov8m/mod.rs:74-80 — 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) crates/koharu-torch/src/nn/var_store.rs:215— crates/koharu-torch/src/nn/var_store.rs:215-221 | crates/koharu-torch/src/nn/var_store.rs:276-282 — both copies are in the same file, so extract the block into 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/koharu-ml/src/comic_layout_yolo26s/model.rs:490— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:490-496 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:493-499 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/recognizer/mod.rs:53— crates/koharu-ml/src/comic_onomatopoeia/recognizer/mod.rs:53-59 | crates/koharu-ml/src/pp_ocr_v6/rec/mod.rs:70-76 — 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) crates/koharu-ml/src/pp_doclayout_v3/processor.rs:100— crates/koharu-ml/src/pp_doclayout_v3/processor.rs:100-106 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:95-102 — 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) crates/koharu-ml/src/comic_text_detector/processor.rs:95— crates/koharu-ml/src/comic_text_detector/processor.rs:95-101 | crates/koharu-ml/src/comic_text_detector/processor.rs:304-310 — both copies are in the same file, so extract the block into 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/koharu-ml/src/comic_layout_yolo26s/model.rs:612— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:612-618 | crates/koharu-ml/src/comic_layout_yolo26s/model.rs:626-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R4 · Test Coverage· No test reaches this file · ×11
No test reaches this file packages/koharu/components/editor/AgentPanel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/components/editor/Editor.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/components/app/KoharuApp.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/components/editor/RightSidebar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/download_bluearchive_comics.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/app/global-error.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/app/layout.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/instrumentation-client.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/app/(app)/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/koharu/app/(app)/layout.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Repeated repair: crates/koharu-runtime/src/runtime/packages/torch.rs crates/koharu-runtime/src/runtime/packages/torch.rs:116— crates/koharu-runtime/src/runtime/packages/torch.rs changed 25 times in last 90 days and 18 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 Torch::discover at line 116), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): update Torch to v2.13.0.6”; “fix(runtime): update native dependencies”; “fix(runtime): update Torch to v2.13.0.3”; “fix(runtime): update Torch release”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-runtime/src/runtime/packages/torch.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/koharu-runtime/src/runtime/packages/rocm.rs crates/koharu-runtime/src/runtime/packages/rocm.rs:133— crates/koharu-runtime/src/runtime/packages/rocm.rs changed 19 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is koharu_runtime::runtime::packages::rocm::wheel_platform at line 133), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): align ROCm targets with llama.cpp”; “fix(runtime): drop unsupported gfx1250”; “fix(runtime): use exact ROCm library paths”; “fix(runtime): update ROCm to 10.0”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-runtime/src/runtime/packages/rocm.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/koharu-runtime/src/hardware/mod.rs crates/koharu-runtime/src/hardware/mod.rs:26— crates/koharu-runtime/src/hardware/mod.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Hardware::probe at line 26), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): improve accelerator detection”; “fix(runtime): reject unsupported CUDA architectures”; “fix: runtime discover”; “fix: support multiple GPUs”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-runtime/src/hardware/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.
Repeated repair: crates/koharu-runtime/src/runtime/graph.rs crates/koharu-runtime/src/runtime/graph.rs:27— crates/koharu-runtime/src/runtime/graph.rs changed 6 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 5 (its worst body is Component::dependencies at line 27), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): improve accelerator detection”; “fix: runtime discover”; “fix: support multiple GPUs”; “fix: only enable bf16 when compute capability >= 80”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-runtime/src/runtime/graph.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/koharu-runtime/src/runtime/loader.rs crates/koharu-runtime/src/runtime/loader.rs:28— crates/koharu-runtime/src/runtime/loader.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 2 (its worst body is koharu_runtime::runtime::loader::open at line 28), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): improve accelerator detection”; “fix(runtime): load ROCm libraries globally”; “Fix AppImage runtime library exclusions”; “Fix Linux Torch runtime bundling”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-runtime/src/runtime/loader.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/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs:1139— crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.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 4 (its worst body is Mlp::new at line 1139), 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(ml): align RF-DETR inference with upstream”; “fix: support multiple GPUs”; “fix: only enable bf16 when compute capability >= 80”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.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: packages/koharu/components/app/WindowChrome.tsx packages/koharu/components/app/WindowChrome.tsx:32— packages/koharu/components/app/WindowChrome.tsx 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 8 (its worst body is WindowChrome.WindowControls at line 32), 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(app): restore frameless window resizing”; “fix(macos): titlebar style”; “chore(dev): fix macos development”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- packages/koharu/components/app/WindowChrome.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/koharu-ml/src/paddle_ocr_vl/model.rs crates/koharu-ml/src/paddle_ocr_vl/model.rs:237— crates/koharu-ml/src/paddle_ocr_vl/model.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 Model::get_rope_index at line 237), 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: support multiple GPUs”; “fix: only enable bf16 when compute capability >= 80”; “Fix tests”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-ml/src/paddle_ocr_vl/model.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/koharu-ml/src/backend.rs crates/koharu-ml/src/backend.rs:10— crates/koharu-ml/src/backend.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 9 (its worst body is Device::try_into_device at line 10), 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: disable MIOpen on Windows”; “fix(ml): disable MIOpen on Windows gfx10”; “fix(ml): select precision by device capability”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-ml/src/backend.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/koharu-runtime/src/runtime/mod.rs crates/koharu-runtime/src/runtime/mod.rs:73— crates/koharu-runtime/src/runtime/mod.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 7 (its worst body is Runtime::plan at line 73), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): improve accelerator detection”; “fix: runtime discover”; “fix: support multiple GPUs”. 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 20:57:56 +00:00' --until='2026-10-27 20:57:56 +00:00' --full-history --no-merges -- crates/koharu-runtime/src/runtime/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.
koharu_renderer::layout::exact_profiled_line_breaks (cognitive 42) crates/koharu-renderer/src/layout.rs:1632— koharu_renderer::layout::exact_profiled_line_breaks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
koharu_renderer::layout::optimal_uniform_line_breaks (cognitive 34) crates/koharu-renderer/src/layout.rs:1430— koharu_renderer::layout::optimal_uniform_line_breaks has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
koharu_renderer::bubble::decompose_lobes (cognitive 33) crates/koharu-renderer/src/bubble.rs:116— koharu_renderer::bubble::decompose_lobes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (7 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_renderer::renderer::resolve_balloon_flows (cognitive 32) crates/koharu-renderer/src/renderer.rs:919— koharu_renderer::renderer::resolve_balloon_flows has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 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.
koharu_renderer::bubble::anchor_flow_cells (cognitive 31) crates/koharu-renderer/src/bubble.rs:373— koharu_renderer::bubble::anchor_flow_cells has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_renderer::shape::shape_script_runs (cognitive 22) crates/koharu-renderer/src/shape.rs:123— koharu_renderer::shape::shape_script_runs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 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.
koharu_renderer::text_renderer::draw_layout (cognitive 20) crates/koharu-renderer/src/text_renderer.rs:367— koharu_renderer::text_renderer::draw_layout has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). 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.
koharu_renderer::layout::largest_fitting_font_size (cognitive 19) crates/koharu-renderer/src/layout.rs:194— koharu_renderer::layout::largest_fitting_font_size has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
koharu_renderer::bubble::geometry_frame (cognitive 18) crates/koharu-renderer/src/bubble.rs:643— koharu_renderer::bubble::geometry_frame has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_renderer::layout::justify_lines (cognitive 18) crates/koharu-renderer/src/layout.rs:1362— koharu_renderer::layout::justify_lines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, 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. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
TooManyMethods: Tensor crates/koharu-torch/src/wrappers/tensor.rs:17— TooManyMethods — 5422 methods, declared across 11 files: wrappers/tensor_fallible_generated.rs (2657), wrappers/tensor_generated.rs (2657), wrappers/tensor.rs (71), tensor/mod.rs (22), +7 more file(s). The bar is 30 methods; this is 5392 over it, 180.73× 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: LlamaContextParams crates/koharu-llama/src/context/params.rs:301— 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: LlamaContext crates/koharu-llama/src/context.rs:26— TooManyMethods — 46 methods, declared across 3 files: src/context.rs (21), context/session.rs (14), context/kv_cache.rs (11). The bar is 30 methods; this is 16 over it, 1.53× 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: Project crates/koharu-app/src/commands/project.rs:254— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: LlamaModel crates/koharu-llama/src/model.rs:26— 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: Edit crates/koharu-scene/src/edit.rs:31— TooManyMethods — 44 methods, declared across 2 files: src/edit.rs (41), src/document.rs (3). The bar is 30 methods; this is 14 over it, 1.47× 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: Path crates/koharu-torch/src/nn/var_store.rs:39— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Snapshot crates/koharu-scene/src/snapshot.rs:12— TooManyMethods — 33 methods, declared across 2 files: src/snapshot.rs (28), src/document.rs (5). The bar is 30 methods; this is 3 over it, 1.10× 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: State crates/koharu-scene/src/state.rs:440— 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.
TooManyMethods: LlamaSampler crates/koharu-llama/src/sampling.rs:15— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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 CVE · ×10
ClassTooLong: TextLayout crates/koharu-renderer/src/layout.rs:174— ClassTooLong — 840 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 2 blocks, lines 174-1352. The bar is 400 significant lines; this is 440 over it, 2.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.
ClassTooLong: Project crates/koharu-app/src/commands/project.rs:254— ClassTooLong — 773 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 45 methods, 2 blocks, lines 254-1238. The bar is 400 significant lines; this is 373 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CanvasWorkspace packages/koharu/components/editor/CanvasWorkspace.tsx:1— ClassTooLong — 670 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 270 over it, 1.68× 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: Edit crates/koharu-scene/src/edit.rs:31— ClassTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 44 methods, 2 blocks, lines 31-905. The bar is 400 significant lines; this is 265 over it, 1.66× 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: GpuCompositor crates/koharu-rasterizer/src/compositor.rs:195— ClassTooLong — 459 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 195-789. The bar is 400 significant lines; this is 59 over it, 1.15× 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: LlamaModel crates/koharu-llama/src/model.rs:26— ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 44 methods, 4 blocks, lines 26-1028. The bar is 400 significant lines; this is 57 over it, 1.14× 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: WebCanvas crates/koharu-canvas/src/web.rs:1092— ClassTooLong — 427 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, 4 blocks, lines 1092-1757. The bar is 400 significant lines; this is 27 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.
ClassTooLong: State crates/koharu-scene/src/state.rs:440— ClassTooLong — 417 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, 2 blocks, lines 440-967. The bar is 400 significant lines; this is 17 over it, 1.04× 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: Tensor crates/koharu-torch/src/wrappers/tensor.rs:17— ClassTooLong — 404 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5422 methods, 6 blocks, lines 17-856. The bar is 400 significant lines; this is 4 over it, 1.01× 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.
TodoComment crates/koharu-torch/src/wrappers/jit.rs:29— // Eq or Hash out of the box in rust. TODO: improve this? — 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 crates/koharu-torch/src/vision/dinov2.rs:5— // TODO: use swiglu. — 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 crates/koharu-torch/src/tensor/convert.rs:31— // TODO: Try to remove this intermediary copy. — 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 crates/koharu-torch/src/tensor/convert.rs:51— // TODO: Try to remove this intermediary copy. — 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 crates/koharu-llama/src/lib.rs:555— // TODO: Reinitialize the state to support calling send_logs_to_tracing multiple times. — 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 crates/koharu-llama/src/log.rs:241— // TODO: Support logging this to stdout directly via options? — 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 crates/koharu-llama/src/model.rs:236— // TODO lsptrip None is acutally not quite the origignal behavior of this function, — 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 crates/koharu-llama/src/model.rs:261— // TODO lsptrip None is acutally not quite the origignal behavior of this function, — 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.
koharu_pipeline::stages::inpainting::prepare (cognitive 36) crates/koharu-pipeline/src/stages/inpainting.rs:430— koharu_pipeline::stages::inpainting::prepare has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 3 (8 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.
koharu_pipeline::stages::detection::infer_outline (cognitive 32) crates/koharu-pipeline/src/stages/detection.rs:760— koharu_pipeline::stages::detection::infer_outline has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_pipeline::stages::detection::enclosing_cluster_pixels (cognitive 22) crates/koharu-pipeline/src/stages/detection.rs:966— koharu_pipeline::stages::detection::enclosing_cluster_pixels has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (8 pts), boolean chains 2 (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.
koharu_pipeline::stages::detection::measured_stroke_width (cognitive 21) crates/koharu-pipeline/src/stages/detection.rs:1180— koharu_pipeline::stages::detection::measured_stroke_width has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 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.
koharu_pipeline::stages::detection::stamp_mask (cognitive 20) crates/koharu-pipeline/src/stages/detection.rs:1539— koharu_pipeline::stages::detection::stamp_mask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_pipeline::stages::detection::closed_mask_for (cognitive 19) crates/koharu-pipeline/src/stages/detection.rs:1461— koharu_pipeline::stages::detection::closed_mask_for has cognitive complexity 19 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 4 (8 pts), boolean chains 2 (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.
koharu_pipeline::stages::inpainting::inpaint_tiles (cognitive 18) crates/koharu-pipeline/src/stages/inpainting.rs:619— koharu_pipeline::stages::inpainting::inpaint_tiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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.
koharu_pipeline::stages::inpainting::fill_uniform_regions (cognitive 17) crates/koharu-pipeline/src/stages/inpainting.rs:587— koharu_pipeline::stages::inpainting::fill_uniform_regions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (8 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×8
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×7
Duplicated block (12 lines × 2) crates/koharu-ml/src/baberu_ocr/model.rs:435— crates/koharu-ml/src/baberu_ocr/model.rs:435-446 | crates/koharu-ml/src/hayai_ocr/model.rs:468-479 — 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/koharu-ml/src/comic_layout_yolo26s/model.rs:444— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:444-455 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:447-458 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:565— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:565-576 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:505-516 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 2) crates/koharu-ml/src/rorem_mixed/processor.rs:86— crates/koharu-ml/src/rorem_mixed/processor.rs:86-97 | crates/koharu-ml/src/rorem_mixed/processor.rs:150-161 — both copies are in the same file, so extract the block into 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/koharu-rasterizer/src/native.rs:177— crates/koharu-rasterizer/src/native.rs:177-188 | crates/koharu-rasterizer/src/native.rs:232-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/koharu-ml/src/manga_ocr/model.rs:464— crates/koharu-ml/src/manga_ocr/model.rs:464-475 | crates/koharu-ml/src/manga_ocr/model.rs:761-772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1547— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1547-1558 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2060-2071 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) crates/koharu-ml/src/bin/comic_text_detector.rs:47— crates/koharu-ml/src/bin/comic_text_detector.rs:47-57 | crates/koharu-ml/src/bin/pp_doclayout_v3.rs:45-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:360— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:360-370 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:408-418 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:191— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:191-201 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:158-168 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:808— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:808-818 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:919-929 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/mod.rs:48— crates/koharu-ml/src/speech_bubble_yolo11n/mod.rs:48-58 | crates/koharu-ml/src/speech_bubble_yolov8m/mod.rs:48-58 — 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/koharu-scene/src/state.rs:56— crates/koharu-scene/src/state.rs:56-66 | crates/koharu-scene/src/state.rs:426-436 — both copies are in the same file, so extract the block into 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/koharu-translator/src/remote/deepseek.rs:26— crates/koharu-translator/src/remote/deepseek.rs:26-36 | crates/koharu-translator/src/remote/minimax.rs:22-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.
Off the main sequence: @koharu/ui — @koharu/ui: 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: koharu-bindgen — koharu-bindgen: 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: koharu-config — koharu-config: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: koharu-rasterizer — koharu-rasterizer: 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: koharu-secrets — koharu-secrets: 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: koharu-storage — koharu-storage: 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: koharu-scene — koharu-scene: abstractness 0.05, instability 0.17, distance 0.78 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
TextLayout::run_with_size (cognitive 157) crates/koharu-renderer/src/layout.rs:463— TextLayout::run_with_size has cognitive complexity 157 (threshold 15). Drivers by points: if/else 55 (112 pts), loops 12 (33 pts), boolean chains 6, match/switch 2 (6 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
TextLayout::shaped_block_extents (cognitive 32) crates/koharu-renderer/src/layout.rs:896— TextLayout::shaped_block_extents has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 3 (6 pts), match/switch 1 (4 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. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
TextLayout::layout_cjk_emphasis_runs (cognitive 31) crates/koharu-renderer/src/layout.rs:1240— TextLayout::layout_cjk_emphasis_runs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
TextLayout::append_balanced_segment_lines (cognitive 23) crates/koharu-renderer/src/layout.rs:955— TextLayout::append_balanced_segment_lines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
TextLayout::ink_bounds (cognitive 20) crates/koharu-renderer/src/layout.rs:1139— TextLayout::ink_bounds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 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. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
TextLayout::run_auto (cognitive 18) crates/koharu-renderer/src/layout.rs:372— TextLayout::run_auto has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: crates/koharu-renderer/src/layout.rs holds 10 of the 89 functions over the threshold — including the worst — and 244 of the 959 points over it (25%), 2× the next-largest file (crates/koharu-ml/src/comic_text_detector/processor.rs at 121). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
Duplicated block (24 lines × 2) crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:41— crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:41-64 | crates/koharu-ml/src/bin/speech_bubble_yolov8m.rs:42-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (24 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:68— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:68-91 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:68-91 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:402— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:402-425 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:346-369 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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 (24 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1508— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1508-1531 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1903-1926 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1674— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1674-1697 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2161-2184 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:127— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:127-150 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:120-143 — `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 131 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) crates/koharu-llama/src/sampling.rs:320— crates/koharu-llama/src/sampling.rs:320-335 | crates/koharu-llama/src/sampling.rs:358-373 — both copies are in the same file, so extract the block into 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/koharu-ml/src/comic_layout_yolo26s/model.rs:473— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:473-488 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:476-491 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/config.rs:85— crates/koharu-ml/src/comic_text_bubble_detector/config.rs:85-100 | crates/koharu-ml/src/pp_doclayout_v3/config.rs:72-87 — 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) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1227— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1227-1242 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1389-1404 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) crates/koharu-ml/src/flux2_klein/mod.rs:40— crates/koharu-ml/src/flux2_klein/mod.rs:40-55 | crates/koharu-ml/src/flux2_klein/mod.rs:132-147 — both copies are in the same file, so extract the block into 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/koharu-rasterizer/src/native.rs:293— crates/koharu-rasterizer/src/native.rs:293-308 | crates/koharu-rasterizer/src/native.rs:353-368 — both copies are in the same file, so extract the block into 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/koharu-app/src/commands/canvas.rs:155— crates/koharu-app/src/commands/canvas.rs:155-164 | crates/koharu-app/src/commands/canvas.rs:181-190 — both copies are in the same file, so extract the block into 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/koharu-ml/src/bin/comic_onomatopoeia.rs:186— crates/koharu-ml/src/bin/comic_onomatopoeia.rs:186-195 | crates/koharu-ml/src/bin/koharu_layout_rfdetr_seg_2xl.rs:172-181 — 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/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:614— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:614-623 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:565-574 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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/koharu-ml/src/comic_text_bubble_detector/model.rs:1608— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1608-1617 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2119-2128 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) crates/koharu-runtime/src/runtime/packages/diffusion.rs:101— crates/koharu-runtime/src/runtime/packages/diffusion.rs:101-110 | crates/koharu-runtime/src/runtime/packages/llama.rs:101-110 — before extracting anything, compare `crates/koharu-runtime/src/runtime/packages/diffusion.rs` and `crates/koharu-runtime/src/runtime/packages/llama.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/koharu-ml/src/aot_inpainting/mod.rs:27— crates/koharu-ml/src/aot_inpainting/mod.rs:27-36 | crates/koharu-ml/src/manga_text_mask/mod.rs:27-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 3) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:402— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:402-406 | crates/koharu-ml/src/comic_text_detector/processor.rs:502-507 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:346-350 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/comic_text_detector/processor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) crates/koharu-ml/src/flux2_klein/mod.rs:81— crates/koharu-ml/src/flux2_klein/mod.rs:81-85 | crates/koharu-ml/src/flux2_klein/mod.rs:180-184 | crates/koharu-ml/src/flux2_klein/mod.rs:233-238 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/koharu-torch/src/wrappers/jit.rs:543— crates/koharu-torch/src/wrappers/jit.rs:543-547 | crates/koharu-torch/src/wrappers/jit.rs:566-570 | crates/koharu-torch/src/wrappers/jit.rs:852-856 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/koharu-pipeline/src/stages/detection.rs:120— crates/koharu-pipeline/src/stages/detection.rs:120-124 | crates/koharu-pipeline/src/stages/inpainting.rs:127-131 | crates/koharu-pipeline/src/stages/ocr.rs:50-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (5 lines × 3) crates/koharu-scene/src/edit.rs:427— crates/koharu-scene/src/edit.rs:427-431 | crates/koharu-scene/src/edit.rs:535-539 | crates/koharu-scene/src/edit.rs:750-754 — 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.
Model::get_rope_index (cognitive 24) crates/koharu-ml/src/paddle_ocr_vl/model.rs:237— Model::get_rope_index has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 3 (4 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Model::run (cognitive 20) crates/koharu-pipeline/src/stages/inpainting.rs:177— Model::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, 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.
Model::beam_search (cognitive 19) crates/koharu-ml/src/manga_ocr/model.rs:81— Model::beam_search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 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.
Model::run (cognitive 17) crates/koharu-pipeline/src/stages/ocr.rs:92— Model::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 pts), match/switch 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.
Duplicated block (17 lines × 2) crates/koharu-llama/src/mtmd.rs:485— crates/koharu-llama/src/mtmd.rs:485-501 | crates/koharu-llama/src/mtmd.rs:538-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:325— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:325-341 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:332-348 — `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 131 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 2) crates/koharu-torch/src/nn/rnn.rs:154— crates/koharu-torch/src/nn/rnn.rs:154-170 | crates/koharu-torch/src/nn/rnn.rs:244-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1332— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1332-1348 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1550-1566 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:541— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:541-555 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:491-505 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1714— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1714-1728 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:2195-2209 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:111— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:111-125 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:104-118 — `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 131 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:353— crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:353-367 | crates/koharu-ml/src/speech_bubble_yolov8m/model.rs:280-294 — `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 32 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:501— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:501-514 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:450-463 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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) crates/koharu-renderer/src/renderer.rs:851— crates/koharu-renderer/src/renderer.rs:851-864 | crates/koharu-renderer/src/renderer.rs:878-891 — both copies are in the same file, so extract the block into 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/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:782— crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:782-795 | crates/koharu-ml/src/pp_ocr_v6/det/model.rs:73-86 — 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 (14 lines × 2) crates/koharu-canvas/src/web.rs:1844— crates/koharu-canvas/src/web.rs:1844-1857 | crates/koharu-desktop/src/lib.rs:512-525 — 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 (13 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:189— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:189-201 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:269-281 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:298— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:298-310 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:191-203 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:518— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:518-530 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:467-479 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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) crates/koharu-runtime/src/hardware/hip/linux.rs:70— crates/koharu-runtime/src/hardware/hip/linux.rs:70-82 | crates/koharu-runtime/src/hardware/hip/windows.rs:81-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 3) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:387— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:387-395 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:447-455 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:450-458 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:398— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:398-406 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:458-466 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:461-469 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:420— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:420-428 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:364-372 | crates/koharu-renderer/src/bubble.rs:256-264 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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 (9 lines × 3) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1389— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1389-1397 | crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs:1165-1173 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1607-1615 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/koharu-llama/src/context/session.rs:205— crates/koharu-llama/src/context/session.rs:205-212 | crates/koharu-llama/src/context/session.rs:303-310 | crates/koharu-llama/src/context/session.rs:412-419 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/koharu-ml/src/aot_inpainting/processor.rs:121— crates/koharu-ml/src/aot_inpainting/processor.rs:121-128 | crates/koharu-ml/src/rorem_mixed/processor.rs:85-92 | crates/koharu-ml/src/rorem_mixed/processor.rs:149-156 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) crates/koharu-ml/src/manga_ocr/processor.rs:59— crates/koharu-ml/src/manga_ocr/processor.rs:59-66 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:102-109 | crates/koharu-ml/src/pp_ocr_v6/rec/processor.rs:121-128 — 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 (8 lines × 3) crates/koharu-ml/src/comic_text_bubble_detector/processor.rs:518— crates/koharu-ml/src/comic_text_bubble_detector/processor.rs:518-525 | crates/koharu-pipeline/src/stages/detection.rs:1590-1597 | crates/koharu-pipeline/src/stages/inpainting.rs:713-720 — 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.
koharu_renderer::bubble::decompose_lobes (cyclomatic 19) crates/koharu-renderer/src/bubble.rs:116— koharu_renderer::bubble::decompose_lobes 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.
koharu_renderer::layout::optimal_uniform_line_breaks (cyclomatic 19) crates/koharu-renderer/src/layout.rs:1430— koharu_renderer::layout::optimal_uniform_line_breaks 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.
koharu_renderer::layout::exact_profiled_line_breaks (cyclomatic 19) crates/koharu-renderer/src/layout.rs:1632— koharu_renderer::layout::exact_profiled_line_breaks 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.
TooManyFields: RTDetrV2Config crates/koharu-ml/src/comic_text_bubble_detector/config.rs:12— TooManyFields — 56 stored fields beside 1 method. The bar is 30 stored fields; this is 26 over it, 1.87× 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: ContextParams crates/koharu-diffusion/src/params.rs:74— TooManyFields — 54 stored fields beside 1 method. The bar is 30 stored fields; this is 24 over it, 1.80× 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: PPDocLayoutV3Config crates/koharu-ml/src/pp_doclayout_v3/config.rs:13— TooManyFields — 45 stored fields beside 3 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (18 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:819— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:819-836 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:714-731 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1369— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1369-1386 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1587-1604 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18 lines × 2) crates/koharu-ml/src/paddle_ocr_vl/model.rs:143— crates/koharu-ml/src/paddle_ocr_vl/model.rs:143-160 | crates/koharu-ml/src/paddle_ocr_vl/model.rs:198-215 — both copies are in the same file, so extract the block into 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) crates/koharu-app/src/commands/editing.rs:47— crates/koharu-app/src/commands/editing.rs:47-53 | crates/koharu-app/src/commands/editing.rs:110-116 | crates/koharu-app/src/commands/editing.rs:131-137 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/koharu-canvas/src/web.rs:77— crates/koharu-canvas/src/web.rs:77-83 | crates/koharu-desktop/src/lib.rs:24-30 | crates/koharu-rasterizer/src/prepared.rs:495-501 — 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) crates/koharu-ml/src/baberu_ocr/model.rs:315— crates/koharu-ml/src/baberu_ocr/model.rs:315-321 | crates/koharu-ml/src/manga_ocr/model.rs:434-440 | crates/koharu-ml/src/manga_ocr/model.rs:710-716 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
TextLayout::run_with_size (cyclomatic 58) crates/koharu-renderer/src/layout.rs:463— TextLayout::run_with_size has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TextLayout::append_balanced_segment_lines (cyclomatic 16) crates/koharu-renderer/src/layout.rs:955— TextLayout::append_balanced_segment_lines 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.
koharu_ml::comic_text_detector::processor::rearranged_inference (cyclomatic 33) crates/koharu-ml/src/comic_text_detector/processor.rs:114— koharu_ml::comic_text_detector::processor::rearranged_inference has cyclomatic complexity 33 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
koharu_ml::comic_text_detector::processor::connected_components (cyclomatic 16) crates/koharu-ml/src/comic_text_detector/processor.rs:1128— koharu_ml::comic_text_detector::processor::connected_components 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.
koharu_pipeline::stages::detection::infer_outline (cyclomatic 16) crates/koharu-pipeline/src/stages/detection.rs:760— koharu_pipeline::stages::detection::infer_outline 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.
koharu_pipeline::stages::inpainting::prepare (cyclomatic 16) crates/koharu-pipeline/src/stages/inpainting.rs:430— koharu_pipeline::stages::inpainting::prepare 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.
koharu_app::commands::project::rasterize_stroke (cognitive 30) crates/koharu-app/src/commands/project.rs:1266— koharu_app::commands::project::rasterize_stroke has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (12 pts), match/switch 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_app::commands::canvas::encode_mask (cognitive 21) crates/koharu-app/src/commands/canvas.rs:378— koharu_app::commands::canvas::encode_mask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_psd::document::build (cognitive 26) crates/koharu-psd/src/document.rs:88— koharu_psd::document::build has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 7 (9 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_psd::engine_data::write_value (cognitive 20) crates/koharu-psd/src/engine_data.rs:616— koharu_psd::engine_data::write_value has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 6 (9 pts), 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.
Traversal::visit_children (cognitive 26) crates/koharu-renderer/src/renderer.rs:584— Traversal::visit_children has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), match/switch 1 (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.
Traversal::text_draft (cognitive 16) crates/koharu-renderer/src/renderer.rs:714— Traversal::text_draft has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CanvasState::composition (cognitive 19) crates/koharu-canvas/src/web.rs:791— CanvasState::composition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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.
CanvasState::activate_manifest (cognitive 18) crates/koharu-canvas/src/web.rs:660— CanvasState::activate_manifest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/koharu-llama/src/context/kv_cache.rs:57— crates/koharu-llama/src/context/kv_cache.rs:57-67 | crates/koharu-llama/src/context/kv_cache.rs:88-100 | crates/koharu-llama/src/context/kv_cache.rs:143-153 | crates/koharu-llama/src/context/kv_cache.rs:179-189 | crates/koharu-llama/src/context/kv_cache.rs:213-225 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/koharu-translator/src/remote/deepseek.rs:53— crates/koharu-translator/src/remote/deepseek.rs:53-106 | crates/koharu-translator/src/remote/lm_studio.rs:39-99 | crates/koharu-translator/src/remote/openai.rs:79-139 | crates/koharu-translator/src/remote/openai_compatible.rs:39-103 | crates/koharu-translator/src/remote/openrouter.rs:30-98 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/koharu-ml/src/aot_inpainting/processor.rs:196— crates/koharu-ml/src/aot_inpainting/processor.rs:196-208 | crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:372-384 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:432-444 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:434-447 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/koharu-ml/src/flux2_klein/mod.rs:156— crates/koharu-ml/src/flux2_klein/mod.rs:156-290 | crates/koharu-ml/src/flux2_klein/processor.rs:70-88 | crates/koharu-ml/src/flux2_klein/processor.rs:165-197 | crates/koharu-translator/src/backend.rs:65-91 — 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 (27 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1150— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1150-1176 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1320-1346 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (27 lines × 2) crates/koharu-runtime/src/runtime/packages/diffusion.rs:126— crates/koharu-runtime/src/runtime/packages/diffusion.rs:126-152 | crates/koharu-runtime/src/runtime/packages/llama.rs:126-152 — before extracting anything, compare `crates/koharu-runtime/src/runtime/packages/diffusion.rs` and `crates/koharu-runtime/src/runtime/packages/llama.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) crates/koharu-llama/src/model.rs:448— crates/koharu-llama/src/model.rs:448-473 | crates/koharu-llama/src/model.rs:550-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:924— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:924-949 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1050-1075 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1115— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:1115-1137 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:1287-1309 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 2) crates/koharu-torch/src/wrappers/kind.rs:35— crates/koharu-torch/src/wrappers/kind.rs:35-57 | crates/koharu-torch/src/wrappers/kind.rs:86-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:72— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:72-92 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:82-102 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21 lines × 2) crates/koharu-ml/src/comic_text_detector/model.rs:176— crates/koharu-ml/src/comic_text_detector/model.rs:176-196 | crates/koharu-ml/src/comic_text_detector/model.rs:226-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/koharu-llama/src/context/session.rs:214— crates/koharu-llama/src/context/session.rs:214-233 | crates/koharu-llama/src/context/session.rs:312-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:334— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:334-353 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:278-297 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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–13 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:326— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:326-338 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:315-326 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12–13 lines × 2) crates/koharu-ml/src/pp_doclayout_v3/processor.rs:431— crates/koharu-ml/src/pp_doclayout_v3/processor.rs:431-443 | crates/koharu-pipeline/src/stages/detection.rs:1330-1341 — 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 (3–10 lines × 3) crates/koharu-ml/src/bin/koharu_layout_rfdetr_seg_2xl.rs:145— crates/koharu-ml/src/bin/koharu_layout_rfdetr_seg_2xl.rs:145-147 | crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:93-102 | crates/koharu-ml/src/bin/speech_bubble_yolov8m.rs:92-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 all 3 call sites, so a change lands once.
Duplicated block (3–10 lines × 3) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:394— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:394-403 | crates/koharu-ml/src/comic_layout_yolo26s/model.rs:508-510 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:397-406 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–8 lines × 2) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:155— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:155-162 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:147-153 — `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 131 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–8 lines × 2) crates/koharu-torch/src/vision/resnet.rs:32— crates/koharu-torch/src/vision/resnet.rs:32-38 | crates/koharu-torch/src/vision/resnet.rs:116-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 (6–7 lines × 2) crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs:599— crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs:599-605 | crates/koharu-ml/src/koharu_layout_rfdetr_seg_2xl/model.rs:609-614 — both copies are in the same file, so extract the block into 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–7 lines × 2) crates/koharu-torch/src/tensor/display.rs:220— crates/koharu-torch/src/tensor/display.rs:220-225 | crates/koharu-torch/src/tensor/display.rs:228-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2 locations) packages/ui/src/components/empty.tsx:34— packages/ui/src/components/empty.tsx:34 · packages/ui/src/components/item.tsx:91 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (31 lines × 2 locations) packages/ui/src/components/field.tsx:10— packages/ui/src/components/field.tsx:10 · packages/ui/src/components/message.tsx:5 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (30 lines × 2 locations) packages/ui/src/components/context-menu.tsx:155— packages/ui/src/components/context-menu.tsx:155 · packages/ui/src/components/menubar.tsx:109 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (30 lines × 2 locations) packages/ui/src/components/popover.tsx:8— packages/ui/src/components/popover.tsx:8 · packages/ui/src/components/tooltip.tsx:20 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (15 matched lines × 2 locations) · ×2
Duplicated block with local edits (15 matched lines × 2 locations) packages/koharu/components/controls/ModelPicker.tsx:55— packages/koharu/components/controls/ModelPicker.tsx:55 · packages/koharu/components/controls/OutputPicker.tsx:103 — the two spans are one implementation copied and then locally edited — 61 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (15 matched lines × 2 locations) packages/koharu/components/controls/ModelPicker.tsx:53— packages/koharu/components/controls/ModelPicker.tsx:53 · packages/koharu/components/editor/InferenceControl.tsx:386 — the two spans are one implementation copied and then locally edited — 54 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (15 lines × 3 locations) packages/ui/src/components/attachment.tsx:59— packages/ui/src/components/attachment.tsx:59 · packages/ui/src/components/empty.tsx:37 · packages/ui/src/components/item.tsx:94 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 3 locations) packages/ui/src/components/breadcrumb.tsx:36— packages/ui/src/components/breadcrumb.tsx:36 · packages/ui/src/components/bubble.tsx:59 · packages/ui/src/components/button-group.tsx:35 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) packages/koharu/components/editor/ActivityCenter.tsx:117— packages/koharu/components/editor/ActivityCenter.tsx:117 · packages/koharu/components/editor/ActivityCenter.tsx:170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) packages/ui/src/components/button.tsx:43— packages/ui/src/components/button.tsx:43 · packages/ui/src/components/toggle.tsx:30 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (9 lines × 2 locations) packages/koharu/components/editor/CanvasWorkspace.tsx:901— packages/koharu/components/editor/CanvasWorkspace.tsx:901 · packages/koharu/components/editor/Inspector.tsx:1032 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (9 lines × 2 locations) packages/koharu/components/preferences/GenerationPreferences.tsx:46— packages/koharu/components/preferences/GenerationPreferences.tsx:46 · packages/koharu/components/preferences/PipelinePreferences.tsx:122 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
AC2 · Forms & labels· <Select> field component without a label · ×1
<Select> field component without a label packages/koharu/components/preferences/SettingsPage.tsx:277— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark packages/koharu/app/layout.tsx:24— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Focus outline removed inline packages/koharu/components/editor/CanvasWorkspace.tsx:591— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 97 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.
CanvasWorkspace.CanvasWorkspace (cyclomatic 148) packages/koharu/components/editor/CanvasWorkspace.tsx:91— CanvasWorkspace.CanvasWorkspace has cyclomatic complexity 148 (threshold 15). Of this number, 16 points are the body's own statements and 132 belong to 28 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PageRail.PageRail (cyclomatic 44) packages/koharu/components/editor/PageRail.tsx:69— PageRail.PageRail has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 15 function items inside it that branch (select, prefetchOnIntent, select::synchronize, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Inspector.LayersInspector (cyclomatic 37) packages/koharu/components/editor/Inspector.tsx:493— Inspector.LayersInspector has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 4 of the 37 points are its own statements and the rest belongs to 11 function items inside it that branch (selectLayer, a function literal at line 598, move, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AgentPanel.AgentPanel (cyclomatic 36) packages/koharu/components/editor/AgentPanel.tsx:38— AgentPanel.AgentPanel has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 9 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 293, send, a function literal at line 120, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
koharu_scene::schema::validate_entity (cyclomatic 34) crates/koharu-scene/src/schema.rs:75— koharu_scene::schema::validate_entity has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SettingsPage.SettingsPage (cyclomatic 34) packages/koharu/components/preferences/SettingsPage.tsx:58— SettingsPage.SettingsPage has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 83, 144, 163, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Header::parse (cyclomatic 32) crates/koharu-torch/src/tensor/npy.rs:80— Header::parse 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.
Operation::apply (cyclomatic 28) crates/koharu-scene/src/patch.rs:76— Operation::apply 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.
Updater.Updater (cyclomatic 27) packages/koharu/components/app/Updater.tsx:31— Updater.Updater has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModelPicker.ModelPicker (cyclomatic 27) packages/koharu/components/controls/ModelPicker.tsx:18— ModelPicker.ModelPicker has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 112, 47, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
InferenceControl.RuntimeSelector (cyclomatic 26) packages/koharu/components/editor/InferenceControl.tsx:86— InferenceControl.RuntimeSelector has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Inspector.TypeInspector (cyclomatic 25) packages/koharu/components/editor/Inspector.tsx:131— Inspector.TypeInspector has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 7 function items inside it that branch (apply, a function literal at line 385, a function literal at line 414, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
koharu_agent::codex::stream::read (cyclomatic 23) crates/koharu-agent/src/codex/stream.rs:23— koharu_agent::codex::stream::read 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.
SelectionControls.SelectionControls (cyclomatic 23) packages/koharu/components/editor/SelectionControls.tsx:46— SelectionControls.SelectionControls has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 144, update, startRotate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useCanvas.useCanvas (cyclomatic 23) packages/koharu/components/editor/useCanvas.ts:25— useCanvas.useCanvas has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 95, 58, 130, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Tensor::f_indexer (cyclomatic 22) crates/koharu-torch/src/tensor/index.rs:293— Tensor::f_indexer has cyclomatic complexity 22 (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.
chart.ChartTooltipContent (cyclomatic 22) REDACTED:119— chart.ChartTooltipContent has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 202, 149). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FontPicker.FontPicker (cyclomatic 21) packages/koharu/components/controls/FontPicker.tsx:50— FontPicker.FontPicker has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 87, 75, 116). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CanvasOverlay.CanvasOverlay (cyclomatic 21) packages/koharu/components/editor/CanvasOverlay.tsx:33— CanvasOverlay.CanvasOverlay has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
geometry.layerFrame (cyclomatic 21) packages/koharu/lib/geometry.ts:65— geometry.layerFrame 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.
koharu_psd::document::build (cyclomatic 20) crates/koharu-psd/src/document.rs:88— koharu_psd::document::build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GpuCompositor::render (cyclomatic 19) crates/koharu-rasterizer/src/compositor.rs:453— GpuCompositor::render 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.
TextRenderer::render_descriptor (cyclomatic 18) crates/koharu-renderer/src/text_renderer.rs:148— TextRenderer::render_descriptor 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.
Edit::remove_entity (cyclomatic 18) crates/koharu-scene/src/edit.rs:202— Edit::remove_entity has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
koharu_runtime::hardware::hip::linux::probe (cyclomatic 17) crates/koharu-runtime/src/hardware/hip/linux.rs:13— koharu_runtime::hardware::hip::linux::probe 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.
TensorFormatter::fmt_tensor (cyclomatic 17) crates/koharu-torch/src/tensor/display.rs:171— TensorFormatter::fmt_tensor 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.
Model::run (cyclomatic 16) crates/koharu-pipeline/src/stages/inpainting.rs:177— Model::run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HackComment crates/koharu-torch/src/tensor/npy.rs:78— // Hacky parser for the npy header, a typical example would be: — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
PageRail.PageRail (cognitive 46) packages/koharu/components/editor/PageRail.tsx:69— PageRail.PageRail has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 14, ternaries 3 (6 pts) (nesting depth added 7). Most of this is not in the body itself: 5 of the 46 points are its own statements and the rest belongs to 15 function items inside it that branch (select, prefetchOnIntent, select::synchronize, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TensorFormatter::fmt_tensor (cognitive 37) crates/koharu-torch/src/tensor/display.rs:171— TensorFormatter::fmt_tensor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 6 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 21). 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.
Inspector.LayersInspector (cognitive 37) packages/koharu/components/editor/Inspector.tsx:493— Inspector.LayersInspector has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 14, ternaries 11 (14 pts), if/else 8 (9 pts) (nesting depth added 4). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 11 function items inside it that branch (selectLayer, move, a function literal at line 598, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
koharu_scene::schema::validate_entity (cognitive 36) crates/koharu-scene/src/schema.rs:75— koharu_scene::schema::validate_entity has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 18, if/else 16 (18 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Operation::apply (cognitive 31) crates/koharu-scene/src/patch.rs:76— Operation::apply has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
koharu_agent::codex::stream::read (cognitive 30) crates/koharu-agent/src/codex/stream.rs:23— koharu_agent::codex::stream::read has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentPanel.AgentPanel (cognitive 29) packages/koharu/components/editor/AgentPanel.tsx:38— AgentPanel.AgentPanel has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 7, if/else 5, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (send, a function literal at line 120, a function literal at line 170, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GpuCompositor::render (cognitive 28) crates/koharu-rasterizer/src/compositor.rs:453— GpuCompositor::render has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 3 (5 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.
Header::parse (cognitive 28) crates/koharu-torch/src/tensor/npy.rs:80— Header::parse has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 5 (9 pts), boolean chains 5, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageSlicer::merge_overlapping_boxes (cognitive 26) crates/koharu-ml/src/comic_text_bubble_detector/processor.rs:310— ImageSlicer::merge_overlapping_boxes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_runtime::hardware::hip::linux::probe (cognitive 25) crates/koharu-runtime/src/hardware/hip/linux.rs:13— koharu_runtime::hardware::hip::linux::probe has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsPage.SettingsPage (cognitive 25) packages/koharu/components/preferences/SettingsPage.tsx:58— SettingsPage.SettingsPage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 10, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 83, 144, 129, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelPicker.ModelPicker (cognitive 24) packages/koharu/components/controls/ModelPicker.tsx:18— ModelPicker.ModelPicker has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, ternaries 6, if/else 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 112, 137, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Updater.Updater (cognitive 23) packages/koharu/components/app/Updater.tsx:31— Updater.Updater has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 8, if/else 6 (nesting depth added 2). Of this number, 15 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Inspector.TypeInspector (cognitive 23) packages/koharu/components/editor/Inspector.tsx:131— Inspector.TypeInspector has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 5, boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 385, apply, a function literal at line 414, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useCanvas.useCanvas (cognitive 23) packages/koharu/components/editor/useCanvas.ts:25— useCanvas.useCanvas has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 3). None of this is in the body itself: all 23 points belong to 10 function literals inside it that branch (lines 95, 130, 58, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
geometry.layerFrame (cognitive 23) packages/koharu/lib/geometry.ts:65— geometry.layerFrame has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, ternaries 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Processor::process (cognitive 22) crates/koharu-pipeline/src/stages/translation.rs:37— Processor::process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextRenderer::render_descriptor (cognitive 22) crates/koharu-renderer/src/text_renderer.rs:148— TextRenderer::render_descriptor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SelectionControls.SelectionControls (cognitive 22) packages/koharu/components/editor/SelectionControls.tsx:46— SelectionControls.SelectionControls has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 8, ternaries 4. None of this is in the body itself: all 22 points belong to 7 function items inside it that branch (a function literal at line 144, update, startRotate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
chart.ChartTooltipContent (cognitive 22) REDACTED:119— chart.ChartTooltipContent has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (9 pts), if/else 4 (nesting depth added 3). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 202, 149). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Edit::remove_entity (cognitive 21) crates/koharu-scene/src/edit.rs:202— Edit::remove_entity has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 7, boolean chains 4, 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.
Project::apply_raster_stroke (cognitive 20) crates/koharu-app/src/commands/project.rs:741— Project::apply_raster_stroke has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Tensor::f_indexer (cognitive 20) crates/koharu-torch/src/tensor/index.rs:293— Tensor::f_indexer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (8 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.
InferenceControl.RuntimeSelector (cognitive 20) packages/koharu/components/editor/InferenceControl.tsx:86— InferenceControl.RuntimeSelector has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (chooseModel, saveOutput, toggleStage, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Flux2ImageProcessor::get_crop_region (cognitive 19) crates/koharu-ml/src/flux2_klein/processor.rs:91— Flux2ImageProcessor::get_crop_region has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 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.
koharu_rasterizer::frame::compile_frame (cognitive 19) crates/koharu-rasterizer/src/frame.rs:345— koharu_rasterizer::frame::compile_frame has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 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.
FontSystem::resolve_with_fallback_families (cognitive 19) crates/koharu-renderer/src/fonts.rs:399— FontSystem::resolve_with_fallback_families has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), boolean chains 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.
BlobStore::collect (cognitive 19) crates/koharu-storage/src/blobs.rs:91— BlobStore::collect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
koharu_torch::nn::init::f_init (cognitive 19) crates/koharu-torch/src/nn/init.rs:108— koharu_torch::nn::init::f_init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (3 pts), boolean chains 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.
CanvasOverlay.CanvasOverlay (cognitive 19) packages/koharu/components/editor/CanvasOverlay.tsx:33— CanvasOverlay.CanvasOverlay has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, ternaries 7, if/else 1. Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 89, 58, 76). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CanvasWorkspace.CanvasWorkspace::finishGesture (cognitive 19) packages/koharu/components/editor/CanvasWorkspace.tsx:503— CanvasWorkspace.CanvasWorkspace::finishGesture has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5, boolean chains 3, error handling 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.
canvas.prefetchCanvasPages (cognitive 18) packages/bridge/src/canvas.ts:246— canvas.prefetchCanvasPages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function 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.
GridGenerator::new (cognitive 17) crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:237— GridGenerator::new has cognitive complexity 17 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 2 (4 pts) (nesting depth added 7). 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.
Fonts::resolve (cognitive 17) crates/koharu-renderer/src/fonts.rs:682— Fonts::resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
VarStore::merge (cognitive 17) crates/koharu-torch/src/nn/var_store.rs:68— VarStore::merge has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 3 (5 pts), match/switch 1 (4 pts) (nesting depth added 10). 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.
providers.Providers (cognitive 17) packages/koharu/app/providers.tsx:33— providers.Providers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). None of this is in the body itself: all 17 points belong to 6 function literals inside it that branch (lines 62, 52, 36, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FontPicker.fontNameScript (cognitive 17) packages/koharu/components/controls/FontPicker.tsx:525— FontPicker.fontNameScript has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
Rasterizer::finish_readback (cognitive 16) crates/koharu-rasterizer/src/native.rs:372— Rasterizer::finish_readback has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), match/switch 1 (4 pts), if/else 2 (3 pts) (nesting depth added 10). 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.
LineBreaker::hyphenated_segments (cognitive 16) crates/koharu-renderer/src/segment.rs:184— LineBreaker::hyphenated_segments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, 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, 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.
Change coupling clique: diffusion.rs, llama.rs, torch.rs crates/koharu-runtime/src/runtime/packages/diffusion.rs— 3 files — `crates/koharu-runtime/src/runtime/packages/diffusion.rs`, `crates/koharu-runtime/src/runtime/packages/llama.rs`, `crates/koharu-runtime/src/runtime/packages/torch.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling: mod.rs ↔ mod.rs crates/koharu-ml/src/comic_text_detector/mod.rs:1— `crates/koharu-ml/src/comic_text_detector/mod.rs` and `crates/koharu-ml/src/lama/mod.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `680311ce` Use explicit device dtype conversions when loading models; `6f1494af` perf: improve inpainting (at that commit the files were still `koharu-ml/src/comic_text_detector/mod.rs` and `koharu-ml/src/lama/mod.rs`); `3e4b068e` refactor(ml): shared TextRegion/TextDirection types for pipeline engines (at that commit the files were still `koharu-ml/src/comic_text_detector/mod.rs` and `koharu-ml/src/lama/mod.rs`) — run `git show` on any of them.
Near-duplicate member pair (52 shared lines) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:605— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:605-668 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:559-619 — These two members are variants of one another: 52 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 (46 shared lines) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:110— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:110-214 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:103-205 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (42 shared lines) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:500— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:500-555 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:449-505 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (23 shared lines) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:99— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:99-188 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:110-214 — These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:811— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:811-836 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:706-731 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) crates/koharu-ml/src/comic_layout_yolo26s/model.rs:562— crates/koharu-ml/src/comic_layout_yolo26s/model.rs:562-584 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:502-524 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:330— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:330-353 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:274-297 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:420— crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:420-430 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:422-432 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:86— crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:86-102 | crates/koharu-ml/src/bin/speech_bubble_yolov8m.rs:85-101 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) crates/koharu-ml/src/bin/comic_layout_yolo26s.rs:149— crates/koharu-ml/src/bin/comic_layout_yolo26s.rs:149-170 | crates/koharu-ml/src/bin/speech_bubble_yolo11n.rs:66-81 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (40–42 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:564— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:564-603 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:516-557 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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 (33 lines × 2) crates/koharu-translator/src/remote/lm_studio.rs:50— crates/koharu-translator/src/remote/lm_studio.rs:50-82 | crates/koharu-translator/src/remote/openai_compatible.rs:50-82 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai_compatible.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 140 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 (31 lines × 2) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:435— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:435-465 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:380-410 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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 (28–29 lines × 2) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:205— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:205-232 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:231-259 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (27 lines × 3) crates/koharu-translator/src/remote/lm_studio.rs:43— crates/koharu-translator/src/remote/lm_studio.rs:43-69 | crates/koharu-translator/src/remote/openai_compatible.rs:43-69 | crates/koharu-translator/src/remote/openrouter.rs:35-61 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai_compatible.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 140 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 (25 lines × 4) crates/koharu-translator/src/remote/lm_studio.rs:42— crates/koharu-translator/src/remote/lm_studio.rs:42-66 | crates/koharu-translator/src/remote/openai.rs:82-106 | crates/koharu-translator/src/remote/openai_compatible.rs:42-66 | crates/koharu-translator/src/remote/openrouter.rs:34-58 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 (24 lines × 5) crates/koharu-translator/src/remote/deepseek.rs:55— crates/koharu-translator/src/remote/deepseek.rs:55-78 | crates/koharu-translator/src/remote/lm_studio.rs:41-64 | crates/koharu-translator/src/remote/openai.rs:81-104 | crates/koharu-translator/src/remote/openai_compatible.rs:41-64 | crates/koharu-translator/src/remote/openrouter.rs:33-56 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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 × 3) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:50— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:50-70 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:60-80 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:51-73 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 3) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:375— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:375-397 | crates/koharu-ml/src/comic_text_detector/processor.rs:472-494 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:319-341 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/comic_text_detector/processor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:630— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:630-651 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:581-602 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:865— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:865-883 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:990-1008 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 3) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:356— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:356-372 | crates/koharu-ml/src/comic_text_detector/processor.rs:451-467 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:300-316 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/comic_text_detector/processor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–15 lines × 2) crates/koharu-ml/src/flux2_klein/processor.rs:124— crates/koharu-ml/src/flux2_klein/processor.rs:124-137 | crates/koharu-ml/src/flux2_klein/processor.rs:141-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 3) crates/koharu-translator/src/remote/lm_studio.rs:68— crates/koharu-translator/src/remote/lm_studio.rs:68-81 | crates/koharu-translator/src/remote/openai.rs:108-121 | crates/koharu-translator/src/remote/openai_compatible.rs:68-81 — before extracting anything, compare `crates/koharu-translator/src/remote/lm_studio.rs` and `crates/koharu-translator/src/remote/openai.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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–14 lines × 2) crates/koharu-llama/src/model.rs:950— crates/koharu-llama/src/model.rs:950-963 | crates/koharu-llama/src/model.rs:968-980 — both copies are in the same file, so extract the block into 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–14 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/model.rs:298— crates/koharu-ml/src/comic_text_bubble_detector/model.rs:298-307 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:276-289 — `crates/koharu-ml/src/comic_text_bubble_detector/model.rs` and `crates/koharu-ml/src/pp_doclayout_v3/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 345 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 4) crates/koharu-ml/src/aot_inpainting/processor.rs:197— crates/koharu-ml/src/aot_inpainting/processor.rs:197-208 | crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:373-384 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:433-444 | crates/koharu-ml/src/speech_bubble_yolov8m/processor.rs:436-447 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–11 lines × 2) crates/koharu-app/src/commands/lifecycle.rs:188— crates/koharu-app/src/commands/lifecycle.rs:188-198 | crates/koharu-app/src/commands/lifecycle.rs:314-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 4) crates/koharu-ml/src/flux2_klein/mod.rs:185— crates/koharu-ml/src/flux2_klein/mod.rs:185-194 | crates/koharu-ml/src/flux2_klein/processor.rs:76-85 | crates/koharu-ml/src/flux2_klein/processor.rs:178-187 | crates/koharu-translator/src/backend.rs:78-87 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) crates/koharu-runtime/src/runtime/packages/diffusion.rs:112— crates/koharu-runtime/src/runtime/packages/diffusion.rs:112-121 | crates/koharu-runtime/src/runtime/packages/llama.rs:112-121 | crates/koharu-runtime/src/runtime/packages/torch.rs:103-112 — before extracting anything, compare `crates/koharu-runtime/src/runtime/packages/diffusion.rs` and `crates/koharu-runtime/src/runtime/packages/llama.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 2) crates/koharu-diffusion/src/image.rs:23— crates/koharu-diffusion/src/image.rs:23-32 | crates/koharu-diffusion/src/image.rs:35-42 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/koharu-ml/src/comic_text_bubble_detector/processor.rs:140— crates/koharu-ml/src/comic_text_bubble_detector/processor.rs:140-148 | crates/koharu-ml/src/pp_doclayout_v3/processor.rs:164-173 — 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–9 lines × 3) crates/koharu-app/src/commands/canvas.rs:155— crates/koharu-app/src/commands/canvas.rs:155-161 | crates/koharu-app/src/commands/canvas.rs:181-187 | crates/koharu-app/src/commands/canvas.rs:275-283 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) crates/koharu-diffusion/src/image.rs:57— crates/koharu-diffusion/src/image.rs:57-64 | crates/koharu-diffusion/src/image.rs:73-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 5) crates/koharu-llama/src/context/kv_cache.rs:58— crates/koharu-llama/src/context/kv_cache.rs:58-64 | crates/koharu-llama/src/context/kv_cache.rs:92-98 | crates/koharu-llama/src/context/kv_cache.rs:144-150 | crates/koharu-llama/src/context/kv_cache.rs:180-186 | crates/koharu-llama/src/context/kv_cache.rs:214-220 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–7 lines × 3) crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:411— crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:411-417 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:355-361 | crates/koharu-renderer/src/bubble.rs:248-253 — before extracting anything, compare `crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs` and `crates/koharu-ml/src/pp_ocr_v6/det/processor.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 281 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 (3–7 lines × 4) crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:147— crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:147-149 | crates/koharu-ml/src/comic_layout_yolo26s/processor.rs:151-155 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:171-173 | crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs:175-181 — `crates/koharu-ml/src/comic_layout_yolo26s/processor.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) crates/koharu-torch/src/vision/inception.rs:53— crates/koharu-torch/src/vision/inception.rs:53-58 | crates/koharu-torch/src/vision/inception.rs:97-102 | crates/koharu-torch/src/vision/inception.rs:148-154 — 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 (4–6 lines × 3) crates/koharu-renderer/src/layout.rs:914— crates/koharu-renderer/src/layout.rs:914-919 | crates/koharu-renderer/src/layout.rs:1150-1153 | crates/koharu-renderer/src/layout.rs:1221-1226 — 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 (3–5 lines × 3) crates/koharu-ml/src/pp_doclayout_v3/processor.rs:69— crates/koharu-ml/src/pp_doclayout_v3/processor.rs:69-71 | crates/koharu-ml/src/pp_ocr_v6/det/processor.rs:72-76 | crates/koharu-ml/src/pp_ocr_v6/rec/processor.rs:82-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 16) crates/koharu-ml/src/aot_inpainting/model.rs:47— crates/koharu-ml/src/aot_inpainting/model.rs:47-51 | crates/koharu-ml/src/comic_layout_yolo26s/model.rs:40-44 | crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:38-42 | crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:81-85 | crates/koharu-ml/src/comic_text_bubble_detector/model.rs:38-42 | crates/koharu-ml/src/font_detector/model.rs:39-43 | crates/koharu-ml/src/hayai_ocr/model.rs:71-75 | crates/koharu-ml/src/lama/model.rs:31-35 | crates/koharu-ml/src/manga_ocr/model.rs:65-69 | crates/koharu-ml/src/manga_text_mask/model.rs:44-48 | crates/koharu-ml/src/paddle_ocr_vl/model.rs:59-63 | crates/koharu-ml/src/pp_doclayout_v3/model.rs:39-43 | crates/koharu-ml/src/pp_ocr_v6/det/model.rs:44-48 | crates/koharu-ml/src/pp_ocr_v6/rec/model.rs:37-41 | crates/koharu-ml/src/speech_bubble_yolo11n/model.rs:40-44 | crates/koharu-ml/src/speech_bubble_yolov8m/model.rs:37-41 — `crates/koharu-ml/src/comic_layout_yolo26s/model.rs` and `crates/koharu-ml/src/speech_bubble_yolo11n/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 202 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 4) crates/koharu-ml/src/comic_layout_yolo26s/config.rs:20— crates/koharu-ml/src/comic_layout_yolo26s/config.rs:20-24 | crates/koharu-ml/src/pp_doclayout_v3/processor.rs:59-63 | crates/koharu-ml/src/speech_bubble_yolo11n/config.rs:23-27 | crates/koharu-ml/src/speech_bubble_yolov8m/config.rs:23-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (14 lines × 4) crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:383— crates/koharu-ml/src/comic_onomatopoeia/detector/model.rs:383-396 | crates/koharu-ml/src/comic_onomatopoeia/recognizer/model.rs:759-772 | crates/koharu-ml/src/comic_text_detector/model.rs:852-865 | crates/koharu-ml/src/manga_text_mask/model.rs:576-589 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (9 lines × 4) crates/koharu-pipeline/src/stages/inpainting.rs:191— crates/koharu-pipeline/src/stages/inpainting.rs:191-199 | crates/koharu-pipeline/src/stages/inpainting.rs:216-224 | crates/koharu-pipeline/src/stages/inpainting.rs:238-246 | crates/koharu-pipeline/src/stages/inpainting.rs:266-274 — 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.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/koharu/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
Duplication concentrated across 5 sibling directories (8 clone groups) packages/koharu/components/controls/OutputPicker.tsx:130— 8 duplicated blocks under packages/koharu/components/ have copies in at least two of the sibling directories app, controls, editor, preferences, start — 3 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (203 matched lines × 2 locations) · ×1
Duplicated block with local edits (203 matched lines × 2 locations) packages/ui/src/components/context-menu.tsx:37— packages/ui/src/components/context-menu.tsx:37 · packages/ui/src/components/dropdown-menu.tsx:28 — the two spans are one implementation copied and then locally edited — 707 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) packages/ui/src/components/dialog.tsx:10— packages/ui/src/components/dialog.tsx:10 · packages/ui/src/components/sheet.tsx:10 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (54 matched lines × 2 locations) · ×1
Duplicated block with local edits (54 matched lines × 2 locations) packages/ui/src/components/combobox.tsx:93— packages/ui/src/components/combobox.tsx:93 · packages/ui/src/components/select.tsx:64 — the two spans are one implementation copied and then locally edited — 240 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (33 lines × 3 locations) packages/ui/src/components/drawer.tsx:163— packages/ui/src/components/drawer.tsx:163 · packages/ui/src/components/popover.tsx:46 · packages/ui/src/components/sheet.tsx:79 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (29 lines × 2 locations) packages/ui/src/components/carousel.tsx:174— packages/ui/src/components/carousel.tsx:174 · packages/ui/src/components/carousel.tsx:204 — both copies are in the same file, so extract the block into 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 locations) packages/koharu/components/editor/PageRail.tsx:328— packages/koharu/components/editor/PageRail.tsx:328 · packages/koharu/components/start/StartView.tsx:107 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (17 lines × 2 locations) packages/ui/src/components/context-menu.tsx:27— packages/ui/src/components/context-menu.tsx:27 · packages/ui/src/components/hover-card.tsx:13 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) packages/koharu/components/preferences/GenerationPreferences.tsx:38— packages/koharu/components/preferences/GenerationPreferences.tsx:38 · packages/koharu/components/preferences/GenerationPreferences.tsx:54 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2 locations) packages/ui/src/components/button-group.tsx:25— packages/ui/src/components/button-group.tsx:25 · packages/ui/src/components/field.tsx:72 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (14 lines × 11 locations) packages/ui/src/components/accordion.tsx:11— packages/ui/src/components/accordion.tsx:11 · packages/ui/src/components/avatar.tsx:23 · packages/ui/src/components/combobox.tsx:165 · packages/ui/src/components/combobox.tsx:185 · +7 more site(s) not listed — the 11 copies are spread across 10 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 17 locations) packages/ui/src/components/alert.tsx:37— packages/ui/src/components/alert.tsx:37 · packages/ui/src/components/attachment.tsx:83 · packages/ui/src/components/avatar.tsx:73 · packages/ui/src/components/breadcrumb.tsx:19 · +13 more site(s) not listed — the 17 copies are spread across 13 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 18 locations) packages/ui/src/components/alert.tsx:32— packages/ui/src/components/alert.tsx:32 · packages/ui/src/components/attachment.tsx:75 · packages/ui/src/components/avatar.tsx:68 · packages/ui/src/components/breadcrumb.tsx:14 · +14 more site(s) not listed — the 18 copies are spread across 13 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (13 lines × 2 locations) packages/koharu/components/editor/ActivityCenter.tsx:90— packages/koharu/components/editor/ActivityCenter.tsx:90 · packages/koharu/components/editor/ActivityCenter.tsx:183 — both copies are in the same file, so extract the block into 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 × 3 locations) packages/koharu/components/editor/AgentPanel.tsx:157— packages/koharu/components/editor/AgentPanel.tsx:157 · packages/koharu/components/editor/Inspector.tsx:297 · packages/koharu/components/preferences/SettingsPage.tsx:288 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (10 lines × 2 locations) packages/ui/src/components/item.tsx:61— packages/ui/src/components/item.tsx:61 · packages/ui/src/components/marker.tsx:23 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 3 locations) packages/ui/src/components/alert-dialog.tsx:4— packages/ui/src/components/alert-dialog.tsx:4 · packages/ui/src/components/dialog.tsx:6 · packages/ui/src/components/sheet.tsx:6 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (6 lines × 2 locations) packages/bridge/src/canvas.ts:258— packages/bridge/src/canvas.ts:258 · packages/koharu/components/editor/useCanvas.ts:173 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function (anonymous) (cyclomatic 33, cognitive 38) packages/koharu/components/editor/CanvasWorkspace.tsx:601— (anonymous) has cyclomatic complexity 33 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function TypeInspector (cyclomatic 27, cognitive 26) packages/koharu/components/editor/Inspector.tsx:131— TypeInspector has cyclomatic complexity 27 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function layerFrame (cyclomatic 21, cognitive 23) packages/koharu/lib/geometry.ts:65— layerFrame has cyclomatic complexity 21 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SettingsPage (cyclomatic 21, cognitive 19) packages/koharu/components/preferences/SettingsPage.tsx:58— SettingsPage has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RuntimeSelector (cyclomatic 20, cognitive 17) packages/koharu/components/editor/InferenceControl.tsx:86— RuntimeSelector has cyclomatic complexity 20 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function down (cyclomatic 19, cognitive 20) · ×1
Complex function down (cyclomatic 19, cognitive 20) packages/koharu/components/editor/CanvasWorkspace.tsx:343— down has cyclomatic complexity 19 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 18, cognitive 13) REDACTED:202— (anonymous) has cyclomatic complexity 18 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function finishGesture (cyclomatic 17, cognitive 22) packages/koharu/components/editor/CanvasWorkspace.tsx:503— finishGesture has cyclomatic complexity 17 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Updater (cyclomatic 17, cognitive 16) packages/koharu/components/app/Updater.tsx:31— Updater has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 17, cognitive 16) packages/koharu/components/controls/ModelPicker.tsx:112— (anonymous) has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function moveGesture (cyclomatic 16, cognitive 15) packages/koharu/components/editor/CanvasWorkspace.tsx:431— moveGesture has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function TitleBar (cyclomatic 16, cognitive 14) packages/koharu/components/app/TitleBar.tsx:40— TitleBar has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function CanvasWorkspace (cyclomatic 16, cognitive 13) packages/koharu/components/editor/CanvasWorkspace.tsx:91— CanvasWorkspace has cyclomatic complexity 16 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AgentPanel (cyclomatic 14, cognitive 16) packages/koharu/components/editor/AgentPanel.tsx:38— AgentPanel has cyclomatic complexity 14 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function replaceStage (cyclomatic 14, cognitive 14) packages/koharu/components/preferences/models.ts:59— replaceStage has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ModelPicker (cyclomatic 13, cognitive 10) packages/koharu/components/controls/ModelPicker.tsx:18— ModelPicker has cyclomatic complexity 13 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 12, cognitive 18) packages/koharu/components/editor/CanvasWorkspace.tsx:763— (anonymous) has cyclomatic complexity 12 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getPayloadConfigFromPayload (cyclomatic 12, cognitive 11) REDACTED:330— getPayloadConfigFromPayload has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function scriptRank (cyclomatic 12, cognitive 10) packages/koharu/components/controls/FontPicker.tsx:510— scriptRank has cyclomatic complexity 12 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· packages/koharu/components/editor/Inspector.tsx · ×1
packages/koharu/components/editor/Inspector.tsx: 1022 lines of code packages/koharu/components/editor/Inspector.tsx:1— packages/koharu/components/editor/Inspector.tsx has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/koharu/components/editor/CanvasWorkspace.tsx · ×1
packages/koharu/components/editor/CanvasWorkspace.tsx: 978 lines of code packages/koharu/components/editor/CanvasWorkspace.tsx:1— packages/koharu/components/editor/CanvasWorkspace.tsx has 978 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/components/sidebar.tsx · ×1
packages/ui/src/components/sidebar.tsx: 674 lines of code packages/ui/src/components/sidebar.tsx:1— packages/ui/src/components/sidebar.tsx has 674 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/koharu/components/editor/PageRail.tsx · ×1
packages/koharu/components/editor/PageRail.tsx: 555 lines of code packages/koharu/components/editor/PageRail.tsx:1— packages/koharu/components/editor/PageRail.tsx has 555 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/koharu/components/controls/FontPicker.tsx · ×1
packages/koharu/components/controls/FontPicker.tsx: 520 lines of code packages/koharu/components/controls/FontPicker.tsx:1— packages/koharu/components/controls/FontPicker.tsx has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/koharu/components/editor/InferenceControl.tsx · ×1
packages/koharu/components/editor/InferenceControl.tsx: 433 lines of code packages/koharu/components/editor/InferenceControl.tsx:1— packages/koharu/components/editor/InferenceControl.tsx has 433 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~7 LoC) packages/koharu/instrumentation-client.ts— no import path from any entry point (71 application, 6 tooling, 14 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@actions/artifact' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'fflate' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'git-cliff' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×1
Untrusted text written into markup unescaped REDACTED:96— `Object.entries(THEMES).map(([theme,prefix])=>`
${prefix} [data-chart=${id}] {
${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Duplicated predicate crates/koharu-app/src/commands/canvas.rs:323— `!diameter.is_finite() || diameter <= 0.0 || points.is_empty()` appears character-identically in 2 files — crates/koharu-app/src/commands/canvas.rs, crates/koharu-app/src/commands/project.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/koharu-app/src/commands/project.rs:388— `!point.x.is_finite() || !point.y.is_finite()` appears character-identically in 3 files — crates/koharu-app/src/commands/project.rs, crates/koharu-canvas/src/web.rs, crates/koharu-renderer/src/bubble.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/koharu-ml/src/pp_ocr_v6/det/processor.rs:67— `!self.do_convert_rgb && image.color().channel_count() < 3` appears character-identically in 2 files — crates/koharu-ml/src/pp_ocr_v6/det/processor.rs, crates/koharu-ml/src/pp_ocr_v6/rec/processor.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/koharu-canvas/src/web.rs:78— `[self.x, self.y, self.width, self.height, self.angle_degrees] .into_iter() .all(f32::is_finite) && self.width > 0.0 && self.height > 0.0` appears character-identically in 3 files — crates/koharu-canvas/src/web.rs, crates/koharu-desktop/src/lib.rs, crates/koharu-rasterizer/src/prepared.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/koharu-pipeline/src/stages/detection.rs:1430— `f64::from(x + 1) <= bounds.x || f64::from(y + 1) <= bounds.y || f64::from(x) >= bounds.x + bounds.width || f64::from(y) >= bounds.y + bounds…` appears character-identically in 2 files — crates/koharu-pipeline/src/stages/detection.rs, crates/koharu-pipeline/src/stages/inpainting.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/koharu-app/src/commands/output.rs:180— `image.width() == 0 || image.height() == 0` appears character-identically in 4 files — crates/koharu-app/src/commands/output.rs, crates/koharu-ml/src/baberu_ocr/processor.rs, crates/koharu-ml/src/hayai_ocr/processor.rs, crates/koharu-ml/src/manga_ocr/processor.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/koharu-ml/src/comic_layout_yolo26s/processor.rs:52— `image.width() == letterbox.resized_width && image.height() == letterbox.resized_height` appears character-identically in 3 files — crates/koharu-ml/src/comic_layout_yolo26s/processor.rs, crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs, crates/koharu-ml/src/speech_bubble_yolov8m/processor.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/koharu-ml/src/speech_bubble_yolo11n/processor.rs:360— `kept.label_id != candidate.label_id || box_iou(kept.bbox, candidate.bbox) <= nms_threshold` appears character-identically in 2 files — crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs, crates/koharu-ml/src/speech_bubble_yolov8m/processor.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/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:408— `lower.len() >= 2 && cross(lower[lower.len() - 2], lower[lower.len() - 1], point) <= 0.0` appears character-identically in 2 files — crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs, crates/koharu-ml/src/pp_ocr_v6/det/processor.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/koharu-ml/src/comic_layout_yolo26s/processor.rs:205— `original_width == 0 || original_height == 0` appears character-identically in 4 files — crates/koharu-ml/src/comic_layout_yolo26s/processor.rs, crates/koharu-ml/src/comic_text_detector/processor.rs, crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs, crates/koharu-ml/src/speech_bubble_yolov8m/processor.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/koharu-canvas/src/web.rs:840— `presentation.visible && presentation.opacity.is_finite() && presentation.opacity > 0.0` appears character-identically in 2 files — crates/koharu-canvas/src/web.rs, crates/koharu-rasterizer/src/frame.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/koharu-renderer/src/script.rs:43— `script == IcuScript::Common || script == IcuScript::Inherited` appears character-identically in 2 files — crates/koharu-renderer/src/script.rs, crates/koharu-renderer/src/shape.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/koharu-ml/src/pp_doclayout_v3/processor.rs:104— `self.image_mean.len() != 3 || self.image_std.len() != 3` appears character-identically in 3 files — crates/koharu-ml/src/pp_doclayout_v3/processor.rs, crates/koharu-ml/src/pp_ocr_v6/det/processor.rs, crates/koharu-ml/src/pp_ocr_v6/rec/processor.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/koharu-ml/src/comic_layout_yolo26s/processor.rs:265— `self.width == 0 || self.height == 0 || self.pixels.is_empty()` appears character-identically in 3 files — crates/koharu-ml/src/comic_layout_yolo26s/processor.rs, crates/koharu-ml/src/speech_bubble_yolo11n/processor.rs, crates/koharu-ml/src/speech_bubble_yolov8m/processor.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/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:417— `upper.len() >= 2 && cross(upper[upper.len() - 2], upper[upper.len() - 1], point) <= 0.0` appears character-identically in 2 files — crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs, crates/koharu-ml/src/pp_ocr_v6/det/processor.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/koharu-renderer/src/frame.rs:159— `width > MAX_SURFACE_DIMENSION || height > MAX_SURFACE_DIMENSION || u64::from(width) * u64::from(height) > MAX_SURFACE_PIXELS` appears character-identically in 2 files — crates/koharu-renderer/src/frame.rs, crates/koharu-renderer/src/renderer.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/koharu-canvas/src/web.rs:1957— `width > f64::from(u32::MAX) || height > f64::from(u32::MAX)` appears character-identically in 2 files — crates/koharu-canvas/src/web.rs, crates/koharu-renderer/src/renderer.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/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:164— `x == 0 || y == 0 || x > width || y > height` appears character-identically in 2 files — crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs, crates/koharu-ml/src/pp_ocr_v6/det/processor.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/koharu-ml/src/comic_onomatopoeia/detector/processor.rs:595— `x0 >= 0 && y0 >= 0 && x0 < width as i32 && y0 < height as i32` appears character-identically in 2 files — crates/koharu-ml/src/comic_onomatopoeia/detector/processor.rs, crates/koharu-ml/src/pp_ocr_v6/det/processor.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/koharu-diffusion/src/callbacks.rs:212— `debug!` at line 212 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/koharu-diffusion/src/callbacks.rs:214— `info!` at line 214 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/koharu-diffusion/src/callbacks.rs:215— `warn!` at line 215 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/koharu-diffusion/src/callbacks.rs:216— `error!` at line 216 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Silent fallback default on Err crates/koharu-llama/src/gguf/mod.rs:43— `find_key` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/koharu-pipeline/src/resources/linux.rs:78— `sample_drm` 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.
Fat interface: Canvas (20 required operations) packages/bridge/src/canvas.ts:17— `Canvas` declares 20 required operations: `resize`, `setView`, `stageManifest`, `installResource`, `hasActiveManifest`, `activateFrame`, `activatePage`, `cacheFrame`, `clear`, `previewOpacity`, `beginTransform`, `updateTransform`, `finishTransform`, `cancelTransform`, `beginStroke`, `extendStroke`, `finishStroke`, `cancelStroke`, `sampleColor`, `dispose`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Mock-dominated test: lets a cached canvas frame paint before synchronizing native page state packages/koharu/tests/components/editor-components.test.tsx:563— This test sets up 3 test doubles (for example `vi.spyOn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 27 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. The most over is `crates/koharu-ml` (30239 LoC, 177 module-visible types across 26 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 15/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/koharu-bindgen`, `packages/koharu`.
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.
Unused export 'dispatch' packages/koharu/lib/backend.ts:31— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused module-local declaration 'clamp' · ×1
Unused module-local declaration 'clamp' packages/koharu/components/editor/ToolBar.tsx:181— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 3/4 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) reduce the strict null checking score — ~0.9 `!` null assertions per 1k TypeScript source lines — 16 assertion(s) across the 17436 source line(s) of the 106 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: packages/koharu/components/editor/CanvasWorkspace.tsx (6), REDACTED (5), packages/koharu/components/editor/Inspector.tsx (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Outdated: icu_normalizer — `icu_normalizer` is locked at 2.3.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.3.0"` requirement declared in crates/koharu-renderer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p icu_normalizer` and commit the updated REDACTED.
Outdated: icu_properties — `icu_properties` is locked at 2.3.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.3.0"` requirement declared in crates/koharu-ml/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p icu_properties` and commit the updated REDACTED.
Outdated: icu_segmenter — `icu_segmenter` is locked at 2.3.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.3.0"` requirement declared in crates/koharu-renderer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p icu_segmenter` and commit the updated REDACTED.
Outdated: smallvec — `smallvec` is locked at 1.16.3 but 1.16.4 is the current stable release on crates.io, and it already satisfies the `"1.16.2"` requirement declared in crates/koharu-scene/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.53.3 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1.53.1"` requirement declared in crates/koharu-agent/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: toml — `toml` is locked at 1.1.6+spec-1.1.0 but 1.1.8+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"1.1.6"` requirement declared in crates/koharu-config/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml` and commit the updated REDACTED.
Outdated: zip — `zip` is locked at 9.1.2 but 9.1.3 is the current stable release on crates.io, and it already satisfies the `"9.0.2"` requirement declared in crates/koharu-app/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zip` and commit the updated REDACTED.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 6 file(s) — `packages/koharu/components/editor/CanvasWorkspace.tsx`, `packages/koharu/components/editor/ToolBar.tsx`, `packages/koharu/components/preferences/PipelinePreferences.tsx`, `packages/koharu/components/preferences/models.ts`, `packages/koharu/lib/i18n.ts`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1803d-8768-71a8-bf30-8b8dbc297998 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 60 · Warnings: 637 · Recommendations: 40 · Info: 7 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 02:01 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.