Public report — koharu, published 30 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_f5b52520407d41cab025067cb239b938
Filed 30 September 2026, 01:36 UTC
Public
Large · 118,348 LoC · 27 projects · rebuild ~0.9 person-years · weakest lens: Accessibility (54%)
Findings by grade
50 critical592 serious20 minor39 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
30 September 2026, 01:15 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
629findings with an exact file:lineof 662 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
58/133dimensions across the health lenses118348 LoC · 27 projects — wide & deep
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
The platform holds an adequate standing with a composite score of 61%, reflecting a robust engineering foundation that is currently compromised by significant accessibility gaps. This is a large asset, comprising over 118,000 lines of production code, with a rebuild cost estimated at approximately €130,000. The high architectural health and strong code quality indicate that the system is stable and maintainable, but the current accessibility score of 54% exposes the business to compliance risks and user exclusion.
The primary risk is concentrated in the user interface layer, where the system fails to meet essential accessibility standards. This weakness is particularly dangerous given the scale of the codebase; a failure here does not just affect a small module but potentially the entire user experience. Remediation in this area offers the highest leverage, as fixing these issues protects the substantial investment already made in the platform’s core logic and architecture. Ignoring this gap risks regulatory scrutiny and limits the potential customer base.
Conversely, the underlying system is genuinely strong. The architecture scores 96%, ensuring that changes do not ripple unpredictably, and code health is high at 85%, meaning developers can work efficiently without fighting technical debt. The system is also well-observed and secure, with readiness at 80% and security at 56%, indicating that operational risks are managed. These strengths provide a solid foundation for rapid improvement, as the core engine is reliable and performant.
Focus first on making custom controls keyboard-operable and enforcing accessibility rules in the development toolchain. This specific action addresses the most critical gap with minimal effort, providing immediate protection for the business. By integrating these checks into the existing workflow, the team can prevent future regressions without disrupting the stable core. This targeted approach ensures that the significant value tied up in the platform is preserved while mitigating the most pressing external risks.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
D22 · Redundant cancellation state checking. `cancel()` is an action, but `cancelled()` and `is_cancelled()` appear to serve the same purpose of checking the cancellation state. Having two methods with nearly identical names for the same intent is confusing.
R2 · Complex function (anonymous) (cyclomatic 17, cognitive 16) packages/koharu/components/controls/ModelPicker.tsx
R2 · Complex function ModelPicker (cyclomatic 13, cognitive 10) packages/koharu/components/controls/ModelPicker.tsx
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
0.8× (at 61% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~0.9 person-years of build effort (about ~€130,000 to rebuild). Its weakest lens is Accessibility at 54% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
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.
Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~0.9 person-years to rebuild), and its weakest lens is Accessibility at 54%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
391 modules, 1018 dependencies. 10 dependency cycles across 65 modules, marked above the diagonal.
Showing the 40 most-connected modules; 351 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
koharu_torch.wrappers.tensor uses koharu_ml.comic_layout_yolo26s.model. Changing koharu_ml.comic_layout_yolo26s.model can break koharu_torch.wrappers.tensor, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
9→3 koharu_renderer.frame depends on koharu_storage.ids✕
Type pairs
2 distinct (type in koharu_renderer.frame → type in koharu_storage.ids) references.
koharu_torch.nn.batch_norm uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_torch.nn.batch_norm, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
12→11 koharu_torch.nn.batch_norm depends on koharu_torch.nn.init✕
Type pairs
1 distinct (type in koharu_torch.nn.batch_norm → type in koharu_torch.nn.init) reference.
koharu_torch.nn.layer_norm uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_torch.nn.layer_norm, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
13→11 koharu_torch.nn.layer_norm depends on koharu_torch.nn.init✕
Type pairs
1 distinct (type in koharu_torch.nn.layer_norm → type in koharu_torch.nn.init) reference.
koharu_torch.nn.var_store uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_torch.nn.var_store, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
15→11 koharu_torch.nn.var_store depends on koharu_torch.nn.init✕
Type pairs
2 distinct (type in koharu_torch.nn.var_store → type in koharu_torch.nn.init) references.
koharu_torch.nn.var_store uses koharu_ml.comic_layout_yolo26s.model. Changing koharu_ml.comic_layout_yolo26s.model can break koharu_torch.nn.var_store, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
16→1 koharu_config depends on koharu_agent.config✕
Type pairs
1 distinct (type in koharu_config → type in koharu_agent.config) reference.
koharu_ml.aot_inpainting.model uses koharu_diffusion.system. Changing koharu_diffusion.system can break koharu_ml.aot_inpainting.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
18→8 koharu_ml.aot_inpainting.model depends on koharu_torch.wrappers.tensor✕
Type pairs
10 distinct (type in koharu_ml.aot_inpainting.model → type in koharu_torch.wrappers.tensor) references.
koharu_ml.aot_inpainting.model uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.aot_inpainting.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
18→15 koharu_ml.aot_inpainting.model depends on koharu_torch.nn.var_store✕
Type pairs
9 distinct (type in koharu_ml.aot_inpainting.model → type in koharu_torch.nn.var_store) references.
koharu_ml.aot_inpainting.model uses koharu_torch.nn.var_store. Changing koharu_torch.nn.var_store can break koharu_ml.aot_inpainting.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→2 koharu_ml.comic_layout_yolo26s.model depends on koharu_diffusion.system✕
Type pairs
1 distinct (type in koharu_ml.comic_layout_yolo26s.model → type in koharu_diffusion.system) reference.
koharu_ml.comic_layout_yolo26s.model uses koharu_diffusion.system. Changing koharu_diffusion.system can break koharu_ml.comic_layout_yolo26s.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→8 koharu_ml.comic_layout_yolo26s.model depends on koharu_torch.wrappers.tensor✕
Type pairs
20 distinct (type in koharu_ml.comic_layout_yolo26s.model → type in koharu_torch.wrappers.tensor) references.
koharu_ml.comic_layout_yolo26s.model uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.comic_layout_yolo26s.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→12 koharu_ml.comic_layout_yolo26s.model depends on koharu_torch.nn.batch_norm✕
Type pairs
1 distinct (type in koharu_ml.comic_layout_yolo26s.model → type in koharu_torch.nn.batch_norm) reference.
koharu_ml.comic_layout_yolo26s.model uses koharu_torch.nn.batch_norm. Changing koharu_torch.nn.batch_norm can break koharu_ml.comic_layout_yolo26s.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→15 koharu_ml.comic_layout_yolo26s.model depends on koharu_torch.nn.var_store✕
Type pairs
18 distinct (type in koharu_ml.comic_layout_yolo26s.model → type in koharu_torch.nn.var_store) references.
koharu_ml.comic_layout_yolo26s.model uses koharu_torch.nn.var_store. Changing koharu_torch.nn.var_store can break koharu_ml.comic_layout_yolo26s.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→2 koharu_ml.manga_text_mask.model depends on koharu_diffusion.system✕
Type pairs
1 distinct (type in koharu_ml.manga_text_mask.model → type in koharu_diffusion.system) reference.
koharu_ml.manga_text_mask.model uses koharu_diffusion.system. Changing koharu_diffusion.system can break koharu_ml.manga_text_mask.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→8 koharu_ml.manga_text_mask.model depends on koharu_torch.wrappers.tensor✕
Type pairs
12 distinct (type in koharu_ml.manga_text_mask.model → type in koharu_torch.wrappers.tensor) references.
koharu_ml.manga_text_mask.model uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.manga_text_mask.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→12 koharu_ml.manga_text_mask.model depends on koharu_torch.nn.batch_norm✕
Type pairs
4 distinct (type in koharu_ml.manga_text_mask.model → type in koharu_torch.nn.batch_norm) references.
koharu_ml.manga_text_mask.model uses koharu_torch.nn.batch_norm. Changing koharu_torch.nn.batch_norm can break koharu_ml.manga_text_mask.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→15 koharu_ml.manga_text_mask.model depends on koharu_torch.nn.var_store✕
Type pairs
11 distinct (type in koharu_ml.manga_text_mask.model → type in koharu_torch.nn.var_store) references.
koharu_ml.manga_text_mask.model uses koharu_torch.nn.var_store. Changing koharu_torch.nn.var_store can break koharu_ml.manga_text_mask.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→2 koharu_ml.comic_text_bubble_detector.model depends on koharu_diffusion.system✕
Type pairs
3 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_diffusion.system) references.
koharu_ml.comic_text_bubble_detector.model uses koharu_diffusion.system. Changing koharu_diffusion.system can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→8 koharu_ml.comic_text_bubble_detector.model depends on koharu_torch.wrappers.tensor✕
Type pairs
29 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_torch.wrappers.tensor) references. 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. Changing koharu_torch.wrappers.tensor can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→12 koharu_ml.comic_text_bubble_detector.model depends on koharu_torch.nn.batch_norm✕
Type pairs
1 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_torch.nn.batch_norm) reference.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.batch_norm. Changing koharu_torch.nn.batch_norm can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→13 koharu_ml.comic_text_bubble_detector.model depends on koharu_torch.nn.layer_norm✕
Type pairs
3 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_torch.nn.layer_norm) references.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.layer_norm. Changing koharu_torch.nn.layer_norm can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→14 koharu_ml.comic_text_bubble_detector.model depends on koharu_torch.nn.linear✕
Type pairs
6 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_torch.nn.linear) references.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.linear. Changing koharu_torch.nn.linear can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→15 koharu_ml.comic_text_bubble_detector.model depends on koharu_torch.nn.var_store✕
Type pairs
25 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_torch.nn.var_store) references.
koharu_ml.comic_text_bubble_detector.model uses koharu_torch.nn.var_store. Changing koharu_torch.nn.var_store can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→17 koharu_ml.comic_text_bubble_detector.model depends on koharu_diffusion.params✕
Type pairs
1 distinct (type in koharu_ml.comic_text_bubble_detector.model → type in koharu_diffusion.params) reference.
koharu_ml.comic_text_bubble_detector.model uses koharu_diffusion.params. Changing koharu_diffusion.params can break koharu_ml.comic_text_bubble_detector.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→2 koharu_ml.comic_text_detector.processor depends on koharu_diffusion.system✕
Type pairs
1 distinct (type in koharu_ml.comic_text_detector.processor → type in koharu_diffusion.system) reference.
koharu_ml.comic_text_detector.processor uses koharu_diffusion.system. Changing koharu_diffusion.system can break koharu_ml.comic_text_detector.processor, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→8 koharu_ml.comic_text_detector.processor depends on koharu_torch.wrappers.tensor✕
Type pairs
1 distinct (type in koharu_ml.comic_text_detector.processor → type in koharu_torch.wrappers.tensor) reference.
koharu_ml.comic_text_detector.processor uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.comic_text_detector.processor, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→19 koharu_ml.comic_text_detector.processor depends on koharu_ml.comic_layout_yolo26s.model✕
Type pairs
1 distinct (type in koharu_ml.comic_text_detector.processor → type in koharu_ml.comic_layout_yolo26s.model) reference.
koharu_ml.comic_text_detector.processor uses koharu_ml.comic_layout_yolo26s.model. Changing koharu_ml.comic_layout_yolo26s.model can break koharu_ml.comic_text_detector.processor, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→2 koharu_ml.hayai_ocr.model depends on koharu_diffusion.system✕
Type pairs
2 distinct (type in koharu_ml.hayai_ocr.model → type in koharu_diffusion.system) references.
koharu_ml.hayai_ocr.model uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.hayai_ocr.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→13 koharu_ml.hayai_ocr.model depends on koharu_torch.nn.layer_norm✕
Type pairs
2 distinct (type in koharu_ml.hayai_ocr.model → type in koharu_torch.nn.layer_norm) references.
koharu_ml.manga_ocr.model uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.manga_ocr.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→13 koharu_ml.manga_ocr.model depends on koharu_torch.nn.layer_norm✕
Type pairs
7 distinct (type in koharu_ml.manga_ocr.model → type in koharu_torch.nn.layer_norm) references.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.wrappers.tensor. Changing koharu_torch.wrappers.tensor can break koharu_ml.pp_ocr_v6.rec.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
26→12 koharu_ml.pp_ocr_v6.rec.model depends on koharu_torch.nn.batch_norm✕
Type pairs
1 distinct (type in koharu_ml.pp_ocr_v6.rec.model → type in koharu_torch.nn.batch_norm) reference.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.batch_norm. Changing koharu_torch.nn.batch_norm can break koharu_ml.pp_ocr_v6.rec.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
26→13 koharu_ml.pp_ocr_v6.rec.model depends on koharu_torch.nn.layer_norm✕
Type pairs
2 distinct (type in koharu_ml.pp_ocr_v6.rec.model → type in koharu_torch.nn.layer_norm) references.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.layer_norm. Changing koharu_torch.nn.layer_norm can break koharu_ml.pp_ocr_v6.rec.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
26→14 koharu_ml.pp_ocr_v6.rec.model depends on koharu_torch.nn.linear✕
Type pairs
3 distinct (type in koharu_ml.pp_ocr_v6.rec.model → type in koharu_torch.nn.linear) references.
koharu_ml.pp_ocr_v6.rec.model uses koharu_torch.nn.var_store. Changing koharu_torch.nn.var_store can break koharu_ml.pp_ocr_v6.rec.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
26→19 koharu_ml.pp_ocr_v6.rec.model depends on koharu_ml.comic_layout_yolo26s.model✕
Type pairs
1 distinct (type in koharu_ml.pp_ocr_v6.rec.model → type in koharu_ml.comic_layout_yolo26s.model) reference.
koharu_ml.pp_ocr_v6.rec.model uses koharu_ml.comic_layout_yolo26s.model. Changing koharu_ml.comic_layout_yolo26s.model can break koharu_ml.pp_ocr_v6.rec.model, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
27→23 koharu_llama.model depends on koharu_ml.hayai_ocr.model✕
Type pairs
2 distinct (type in koharu_llama.model → type in koharu_ml.hayai_ocr.model) references.
koharu_pipeline.stages uses koharu_ml.manga_text_mask.model. Changing koharu_ml.manga_text_mask.model can break koharu_pipeline.stages, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→28 koharu_pipeline.stages depends on koharu_pipeline.config✕
Type pairs
1 distinct (type in koharu_pipeline.stages → type in koharu_pipeline.config) reference.
koharu_pipeline.stage_runner uses koharu_ml.manga_text_mask.model. Changing koharu_ml.manga_text_mask.model can break koharu_pipeline.stage_runner, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→28 koharu_pipeline.stage_runner depends on koharu_pipeline.config✕
Type pairs
1 distinct (type in koharu_pipeline.stage_runner → type in koharu_pipeline.config) reference.
koharu_pipeline.execution uses koharu_ml.manga_text_mask.model. Changing koharu_ml.manga_text_mask.model can break koharu_pipeline.execution, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→30 koharu_pipeline.execution depends on koharu_scene.snapshot✕
Type pairs
2 distinct (type in koharu_pipeline.execution → type in koharu_scene.snapshot) references.
koharu_pipeline.execution uses koharu_pipeline.stage_runner. Changing koharu_pipeline.stage_runner can break koharu_pipeline.execution, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→6 koharu_app.commands.project depends on koharu_rasterizer.prepared✕
Type pairs
2 distinct (type in koharu_app.commands.project → type in koharu_rasterizer.prepared) references.
koharu_app.commands.project uses koharu_rasterizer.prepared. Changing koharu_rasterizer.prepared can break koharu_app.commands.project, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→7 koharu_app.commands.project depends on koharu_scene.id✕
Type pairs
6 distinct (type in koharu_app.commands.project → type in koharu_scene.id) references.
koharu_app.commands.project uses koharu_app.commands.canvas. Changing koharu_app.commands.canvas can break koharu_app.commands.project, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
39→6 koharu_app.commands.canvas depends on koharu_rasterizer.prepared✕
Type pairs
3 distinct (type in koharu_app.commands.canvas → type in koharu_rasterizer.prepared) references.
koharu_app.commands.canvas uses koharu_app.commands.project. Changing koharu_app.commands.project can break koharu_app.commands.canvas, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→2 koharu_pipeline.stages.detection depends on koharu_diffusion.system✕
Type pairs
2 distinct (type in koharu_pipeline.stages.detection → type in koharu_diffusion.system) references.
koharu_pipeline.stages.detection uses koharu_diffusion.system. Changing koharu_diffusion.system can break koharu_pipeline.stages.detection, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→7 koharu_pipeline.stages.detection depends on koharu_scene.id✕
Type pairs
3 distinct (type in koharu_pipeline.stages.detection → type in koharu_scene.id) references.
koharu_pipeline.stages.detection uses koharu_pipeline.config. Changing koharu_pipeline.config can break koharu_pipeline.stages.detection, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→29 koharu_pipeline.stages.detection depends on koharu_scene.edit✕
Type pairs
1 distinct (type in koharu_pipeline.stages.detection → type in koharu_scene.edit) reference.
koharu_pipeline.stages.detection uses koharu_scene.snapshot. Changing koharu_scene.snapshot can break koharu_pipeline.stages.detection, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→31 koharu_pipeline.stages.detection depends on koharu_pipeline.stages✕
Type pairs
4 distinct (type in koharu_pipeline.stages.detection → type in koharu_pipeline.stages) references.
koharu_pipeline.stages.detection uses koharu_pipeline.stages. Changing koharu_pipeline.stages can break koharu_pipeline.stages.detection, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→38 koharu_pipeline.stages.detection depends on koharu_app.commands.project✕
Type pairs
1 distinct (type in koharu_pipeline.stages.detection → type in koharu_app.commands.project) reference.
koharu_pipeline.stages.detection uses koharu_app.commands.project. Changing koharu_app.commands.project can break koharu_pipeline.stages.detection, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
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:2021 — Injection
44
High / Critical
A06:2021 — Vulnerable & Outdated Components
14
High / Critical
Roadmap
First, ensure all custom controls are fully keyboard-operable and anchors have valid hrefs to improve immediate usability. Next, enforce accessibility standards by integrating jsx-a11y into your linting, adding automated checks in tests, and gating them in CI to prevent regressions. Simultaneously, fix structural issues by defining the page language, title, and main landmark, while ensuring every form control and button has a proper programmatic label. Finally, document significant architectural decisions in a consistent format to maintain clarity and context for future development.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.
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.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Reconcile the README with reality: README omits the Tauri frontend project; omits the UI/bridge package (packages/ui); omits the agent-based workflow project.
Code Duplication: Near-duplicate member pair (23 shared lines)
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 — 50
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 — 592
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 — 20
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 39
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. 53 of 58 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. 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 — 58 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, 629 of 662 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.
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-translator/src/provider.rs, crates/koharu-diffusion/src/enums.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 (49 contributor(s) across 2287 commit(s) sampled, automation and bot accounts excluded). One of them holds 85% of the history; the other 48 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.
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.
D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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").
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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.
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.
The LLM boundary
LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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 141. 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
Resolve the 3 koharu_renderer finding(s) in Cyclomatic Complexity — start with layout.rs (2), bubble.rs. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 TextLayout finding(s) in Cyclomatic Complexity — start with layout.rs (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 koharu_ml finding(s) in Cyclomatic Complexity — start with processor.rs (2). — One of this dimension's main actionable groups (2 warning-level).
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.
+ 43 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 koharu_ml finding(s) in Cognitive Complexity — start with processor.rs (11), koharu_layout_rfdetr_seg_2xl.rs, comic_layout_yolo26s.rs. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 10 koharu_renderer finding(s) in Cognitive Complexity — start with layout.rs (4), bubble.rs (3), renderer.rs. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 8 koharu_pipeline finding(s) in Cognitive Complexity — start with detection.rs (5), inpainting.rs (3). — One of this dimension's main actionable groups (8 warning-level).
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), layout.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.
216 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.
+ 70 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 · Coupling6.9 / 10Adequate✓ 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.
27 production modules (Cargo+npm), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence, with abstractness counted on 25 of the 27 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
Off the main sequence: @koharu/ui · ×8
Unstable project koharu-app
Unstable project koharu-pipeline
What to do
Resolve the 8 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (8 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.
494 test methods: 488 unit, 6 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 396 `#[test]` function(s) across 114 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.
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 direct production npm dependency(ies) of 32 graded, 0 pinning defect(s), across 5 package.json (4 of them the product) and 1 committed lockfile(s). Development dependencies are deliberately not graded: this dimension grades what SHIPS. Whether any of these packages is DEPRECATED or UNMAINTAINED is not graded — registry.npmjs.org's latest-version answer carries neither, and release age does not stand in for a maintenance status. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.
Outdated (npm): @tanstack/react-query · ×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: 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 (11×141=1551); 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 23 Hotspot finding(s) in Churn × Complexity Hotspots — start with CanvasWorkspace.tsx, layout.rs, Inspector.tsx. — One of this dimension's main actionable groups (23 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 118348 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 model.rs (2), convert.rs (2), log.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: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
Koharu's documentation is clear, complete, and well-structured: a single root README (the repository overview) plus detailed architecture/design docs for every crate, with each crate's README describing what it does and its usage. The architecture/Docs markdown files are empty but the outline confirms all sections exist; no clipped document. The visible content covers an overview, features, hardware acceleration, CUDA/ROCm/HIP/Metal/Vulkan/WebGPU/CPU models, computer vision, inpainting, LLMs, general-purpose local models, uncensored local models, cloud providers, translation providers, installation, WinGet/Homebrew, troubleshooting, macOS/Linux, Windows (PowerShell), development, prerequisites, and the full pipeline from execution to configuration; the visible READMEs cover agents, koharu-app, koharu-canvas, koharu-desktop, metrics, pipeline, rasterizer, renderer, scene, storage, torch with getting started, examples, and a changelog. The only unshown defect is that the root README lacks an overview/installation/usage/contributing section (it does describe what it contains), but those are all present in the visible content. The repository's READMEs are mostly architecture/design documents for the koharu and bridge crates (16 total), with each crate's own README describing its directory rather than the root project. The overview is present in both koharu READMEs: one states what koharu does ('Koharu's native composition package') and outlines a Tauri-command application boundary, while the other describes the bridge package's role as the browser/native boundary plus generated glue. However there are no installation/usage examples for any crate README (the only non-directory README is the 61-word benchmark fixtures README), so usage guidance is missing for all crates.
What to do
Improve Documentation Quality — currently 8.6/10. — Koharu's documentation is clear, complete, and well-structured: a single root README (the repository overview) plus detailed architecture/design docs for every crate, with each crate's README describing what it does and its usage. The architecture/Docs markdown files are empty but the outline confirms all sections exist; no clipped document. The visible content covers an overview, features, hardware acceleration, CUDA/ROCm/HIP/Metal/Vulkan/WebGPU/CPU models, computer vision, inpainting, LLMs, general-purpose local models, uncensored local models, cloud providers, translation providers, installation, WinGet/Homebrew, troubleshooting, macOS/Linux, Windows (PowerShell), development, prerequisites, and the full pipeline from execution to configuration; the visible READMEs cover agents, koharu-app, koharu-canvas, koharu-desktop, metrics, pipeline, rasterizer, renderer, scene, storage, torch with getting started, examples, and a changelog. The only unshown defect is that the root README lacks an overview/installation/usage/contributing section (it does describe what it contains), but those are all present in the visible content. The repository's READMEs are mostly architecture/design documents for the koharu and bridge crates (16 total), with each crate's own README describing its directory rather than the root project. The overview is present in both koharu READMEs: one states what koharu does ('Koharu's native composition package') and outlines a Tauri-command application boundary, while the other describes the bridge package's role as the browser/native boundary plus generated glue. However there are no installation/usage examples for any crate README (the only non-directory README is the 61-word benchmark fixtures README), so usage guidance is missing for all crates.
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 names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStronggated by 1 serious finding◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
1 API inconsistencies across a 400-member sample of 543 exposed types.
Redundant cancellation state checking. `cancel()` is an action, but `cancelled()` and `is_cancelled()` appear to serve the same purpose of checking the cancellation state. Having two methods with nearly identical names for the same intent is confusing.
What to do
Resolve the 1 Redundant cancellation state checking. `cancel()` is an action, but… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
44 finding(s): 0 critical, 42 high, 2 medium, 0 low. 25 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 39, line 40, …), `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
+ 2 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 25 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 (25 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.
Resolve the 5 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 4 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 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 332 of the 476 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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.
No dependency in any ecosystem this repository declares is published as malicious.
✓ On the Gold path — maintain.
Detailed fixes: d43_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 / name, and nothing it renders carries one either. 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:15
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:532
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.
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 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
Add a 'Testing' section to the root README — how to run the test suite.
Add a README to the 15 of 28 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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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.
README omits the Tauri frontend project — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
omits the UI/bridge package (packages/ui) — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
omits the agent-based workflow project — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
What to do
Reconcile the README with reality: README omits the Tauri frontend project; omits the UI/bridge package (packages/ui); omits the agent-based workflow project.
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 16/18 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) or inside a Java method returning a Reactor Mono/Flux — 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:814 · 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:814
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 34 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:542
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:320
(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
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
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
ModelOptions has cyclomatic complexity 16 and cognitive complexity 7; 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/PipelinePreferences.tsx:104
finishGesture has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/koharu/components/editor/CanvasWorkspace.tsx:465
moveGesture has cyclomatic complexity 15 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/editor/CanvasWorkspace.tsx:408
CanvasWorkspace has cyclomatic complexity 15 and cognitive complexity 12; 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:83
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:691
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.
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, REDACTED, scripts/release.ts, …
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 package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead 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.
Nothing imports this binding — it is safe to review for removal. — packages/koharu/lib/backend.ts:31
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
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 — 1 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.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 70 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 JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; 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
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — 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 — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D14 License Compliance — Not scored — this repository's 1076 shipped crate(s) were read from its REDACTED, but crates.io could not be asked for the licence of 39 of them (HTTP 429 Unknown Error), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
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.
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. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
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.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. 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 — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — 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
X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — 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
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — 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
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X4 Structured logging — 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
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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:15— 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:532— 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/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: src/web.rs crates/koharu-canvas/src/web.rs— FileTooLong — 1534 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 1034 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 — 929 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 429 over it, 1.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: 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 — 881 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 381 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: 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: editor/CanvasWorkspace.tsx packages/koharu/components/editor/CanvasWorkspace.tsx— FileTooLong — 772 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: CanvasWorkspace (83-812). The bar is 500 significant lines; this is 272 over it, 1.54× 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/compositor.rs crates/koharu-rasterizer/src/compositor.rs— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: GpuCompositor (2 blocks, 140-715). The bar is 500 significant lines; this is 196 over it, 1.39× 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 — 608 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: Model (3 blocks, 42-581). The bar is 500 significant lines; this is 108 over it, 1.22× 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:154— crates/koharu-app/src/commands/canvas.rs:154-159 | crates/koharu-app/src/commands/canvas.rs:186-191 — both copies are in the same file, so extract the block into 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:799— crates/koharu-diffusion/src/params.rs:799-804 | crates/koharu-diffusion/src/params.rs:1007-1012 — both copies are in the same file, so extract the block into 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:83— FunctionTooLong — CanvasWorkspace runs 606 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 506 over it, 6.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: 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_app::app::run crates/koharu-app/src/app.rs:68— FunctionTooLong — koharu_app::app::run runs 173 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 73 over it, 1.73× 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_app::commands::processing::process crates/koharu-app/src/commands/processing.rs:77— FunctionTooLong — koharu_app::commands::processing::process 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: 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: 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: 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:83— packages/koharu/components/editor/CanvasWorkspace.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in CanvasWorkspace.CanvasWorkspace at line 83. 2 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-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. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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/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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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: packages/koharu/components/editor/CanvasOverlay.tsx packages/koharu/components/editor/CanvasOverlay.tsx:33— packages/koharu/components/editor/CanvasOverlay.tsx changed 7 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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: 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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: crates/koharu-diffusion/src/enums.rs crates/koharu-diffusion/src/enums.rs:69— crates/koharu-diffusion/src/enums.rs changed 3 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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: 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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:248-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/koharu-app/src/commands/canvas.rs:426— crates/koharu-app/src/commands/canvas.rs:426-430 | 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/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-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-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.
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:239— 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: 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: 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: 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: VideoGenerationParams.to_native crates/koharu-diffusion/src/params.rs:991— MethodTooLong — to_native runs 113 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 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.
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: ContextParams.to_native crates/koharu-diffusion/src/params.rs:181— MethodTooLong — to_native 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: 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: GpuCompositor.render crates/koharu-rasterizer/src/compositor.rs:389— MethodTooLong — render 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.
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-rasterizer/src/native.rs:276— crates/koharu-rasterizer/src/native.rs:276-282 | crates/koharu-rasterizer/src/native.rs:335-341 — both copies are in the same file, so extract the block into 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-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.
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_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_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::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::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::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::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::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::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.
R4 · Test Coverage· No test reaches this file · ×11
No test reaches this file packages/koharu/components/editor/AgentPanel.tsx— 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— 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/release.ts— 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— 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— 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— 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— 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— 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— 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— 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— 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:59:19 +09:00' --until='2026-09-30 00:59:19 +09: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.
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.
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:134— 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.
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.
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.
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.
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: 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: CanvasWorkspace packages/koharu/components/editor/CanvasWorkspace.tsx:1— ClassTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 206 over it, 1.52× 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: GpuCompositor crates/koharu-rasterizer/src/compositor.rs:140— 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), 17 methods, 2 blocks, lines 140-715. 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:1089— 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 1089-1754. 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-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.
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/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-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-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/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.
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.
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-metrics — koharu-metrics: abstractness 0.11, instability 0.00, distance 0.89 — zone of pain — concrete and depended on by 2 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.
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:180— crates/koharu-rasterizer/src/native.rs:180-191 | crates/koharu-rasterizer/src/native.rs:235-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 (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.
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.
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.
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.
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.
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.
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.
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 (10 lines × 2) crates/koharu-app/src/commands/canvas.rs:161— crates/koharu-app/src/commands/canvas.rs:161-170 | crates/koharu-app/src/commands/canvas.rs:193-202 — both copies are in the same file, so extract the block into 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 (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 (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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×4
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 (18 lines × 2) crates/koharu-rasterizer/src/native.rs:297— crates/koharu-rasterizer/src/native.rs:297-314 | crates/koharu-rasterizer/src/native.rs:357-374 — both copies are in the same file, so extract the block into 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-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:1841— crates/koharu-canvas/src/web.rs:1841-1854 | 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::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.
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.
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: 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.
TooManyFields: ContextParams crates/koharu-diffusion/src/params.rs:74— TooManyFields — 45 stored fields beside 1 method. 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 (7 lines × 3) crates/koharu-app/src/commands/editing.rs:53— crates/koharu-app/src/commands/editing.rs:53-59 | crates/koharu-app/src/commands/editing.rs:134-140 | crates/koharu-app/src/commands/editing.rs:165-171 — 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:78— crates/koharu-canvas/src/web.rs:78-84 | 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:414— 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:788— 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:657— 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:814— packages/koharu/components/editor/CanvasWorkspace.tsx:814 · 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 / name, and nothing it renders carries one either. 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>.
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 141) packages/koharu/components/editor/CanvasWorkspace.tsx:83— CanvasWorkspace.CanvasWorkspace has cyclomatic complexity 141 (threshold 15). Most of this is not in the body itself: 15 of the 141 points are its own statements and the rest belongs to 24 function literals inside it that branch (lines 542, 320, 465, …). 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.
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 literals inside it that branch (lines 115, 167, 138, …). 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.
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 literals inside it that branch (lines 552, 598, 512, …). 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.
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: 14 of the 36 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 293, 120, 170, …). 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.
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 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.
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 literals inside it that branch (lines 149, 385, 414, …). 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.
useCanvas.useCanvas (cyclomatic 24) packages/koharu/components/editor/useCanvas.ts:25— useCanvas.useCanvas has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 11 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.
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 literals inside it that branch (lines 144, 86, 77, …). 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:389— GpuCompositor::render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
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.
CanvasWorkspace.CanvasWorkspace (cognitive 147) packages/koharu/components/editor/CanvasWorkspace.tsx:83— CanvasWorkspace.CanvasWorkspace has cognitive complexity 147 (threshold 15). Drivers by points: if/else 61 (73 pts), boolean chains 34, ternaries 16 (28 pts), error handling 6 (10 pts), loops 1 (2 pts) (nesting depth added 29). Most of this is not in the body itself: 10 of the 147 points are its own statements and the rest belongs to 24 function literals inside it that branch (lines 542, 320, 465, …). 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.
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 literals inside it that branch (lines 115, 167, 138, …). 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.
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 literals inside it that branch (lines 552, 512, 598, …). 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.
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). Of this number, 17 points are the body's own statements and 12 belong to 7 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.
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.
GpuCompositor::render (cognitive 25) crates/koharu-rasterizer/src/compositor.rs:389— GpuCompositor::render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 3 (5 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
useCanvas.useCanvas (cognitive 25) packages/koharu/components/editor/useCanvas.ts:25— useCanvas.useCanvas has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 95, 130, 53, …). 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.
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 literals inside it that branch (lines 385, 149, 414, …). 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. Most of this is not in the body itself: 0 of the 22 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 144, 86, 77, …). 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.
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 literals inside it that branch (lines 133, 162, 181, …). 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.
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:414— 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 88, 57, 75). 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.
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 literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:697— 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). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs 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.
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.
D22 · Internal API Consistency· Redundant cancellation state checking. `cancel()` is an action, but `cancelled()` and `is_cancelled()` appear to serve the same purpose of checking the cancellation state. Having two methods with nearly identical names for the same intent is confusing. · ×1
Redundant cancellation state checking. `cancel()` is an action, but `cancelled()` and `is_cancelled()` appear to serve the same purpose of checking the cancellation state. Having two methods with nearly identical names for the same intent is confusing. — Remove `cancelled()` and keep only `is_cancelled()` (or vice versa, depending on naming convention preference, but `is_cancelled` is more idiomatic for boolean checks). Ensure `cancel()` is the only mutation method. (signatures: koharu_agent.control.Control.cancel() | koharu_agent.control.Control.cancelled() | koharu_agent.control.Control.is_cancelled())
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— `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:338-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:161— crates/koharu-app/src/commands/canvas.rs:161-167 | crates/koharu-app/src/commands/canvas.rs:193-199 | crates/koharu-app/src/commands/canvas.rs:299-307 — 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 (25 lines × 2) crates/koharu-canvas/src/surface.rs:22— crates/koharu-canvas/src/surface.rs:22-46 | crates/koharu-rasterizer/src/compositor.rs:172-198 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 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 34, cognitive 41) packages/koharu/components/editor/CanvasWorkspace.tsx:542— (anonymous) has cyclomatic complexity 34 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function 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:320— 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 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 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 ModelOptions (cyclomatic 16, cognitive 7) packages/koharu/components/preferences/PipelinePreferences.tsx:104— ModelOptions has cyclomatic complexity 16 and cognitive complexity 7; 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 15, cognitive 19) packages/koharu/components/editor/CanvasWorkspace.tsx:465— finishGesture has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function moveGesture (cyclomatic 15, cognitive 14) packages/koharu/components/editor/CanvasWorkspace.tsx:408— moveGesture has cyclomatic complexity 15 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 15, cognitive 12) packages/koharu/components/editor/CanvasWorkspace.tsx:83— CanvasWorkspace has cyclomatic complexity 15 and cognitive complexity 12; 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:691— (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.
README/code drift — README omits the Tauri frontend project — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
README/code drift — omits the UI/bridge package (packages/ui) — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
README/code drift — omits the agent-based workflow project — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
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.
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 24 project(s) overshoot their size bounds, lowering Project Cohesion to 9.2/10. The most over is `crates/koharu-ml` (30203 LoC, 177 public 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 16/18 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.
Outdated (npm): @tanstack/react-query — @tanstack/react-query is pinned at 5.102.8; registry.npmjs.org publishes 5.104.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @tanstack/react-virtual — @tanstack/react-virtual is pinned at 3.14.11; registry.npmjs.org publishes 3.14.13 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): lucide-react — lucide-react is pinned at 1.43.0; registry.npmjs.org publishes 1.49.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): next — next is pinned at 16.3.4; registry.npmjs.org publishes 16.3.7 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): react-i18next — react-i18next is pinned at 17.0.13; registry.npmjs.org publishes 17.0.15 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): react-resizable-panels — react-resizable-panels is pinned at 4.12.4; registry.npmjs.org publishes 4.14.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): tailwind-merge — tailwind-merge is pinned at 3.6.0; registry.npmjs.org publishes 3.7.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
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 01a0efe1-f842-7b89-8274-92941d07d3c7 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 50 · Warnings: 592 · Recommendations: 13 · Info: 7 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 30-09-2026 @ 01:15 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.