Public report of microsoft/edit, published 14 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 14 November 2026, 15:18 UTC · Survey ID cd_61c3184058eb47cfafac9cd2762cd4c6

microsoft/edit

Measured 14 November 2026, 15:18 UTC, at code version b7f8322

CAI score 61out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 3 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 30,214 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 0.2 person-years · Weakest lens: Production Readiness, 46

Findings by how serious they are

2 critical 272 serious 12 minor

9 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 15:18 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

41of 41 dimensions measured by tools.
274of 286 findings point to an exact file and line, so you can open each one in the code. The other 12 concern the repository as a whole, such as missing documentation.
41dimensions across 5 lenses, read from 30,214 lines of product code in 3 projects.
Chapters

Executive summary

microsoft/edit falls short of our standard for production, in part because we found no logging, tracing or health checks in the code. It scores 61 out of 100 and is rated Adequate, and both of its critical findings are security problems in the build pipeline.

Production Readiness, at 46, is the weakest lens and counts most in the score. The best first step for the work it takes is adding tests for untested code, worth about 8 points. Adding a diagnostic log would lift Production Readiness itself, worth about 9 points. Raising Production Readiness to 70 would lift the score to about 72.

One pipeline step runs a download nobody checks. Checking the download against a checksum would close this risk. Correcting the flagged pipeline settings would fix the weakness in the build pipeline's configuration.

The product code is 30,214 lines, about €36,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 46 · counts for 47%Maturity 66 · counts for 26%Security and Compliance 79 · counts for 14%Code Health 80 · counts for 8%Architecture 97 · counts for 4%

If Production Readiness rose from 46 to 70, the lowest score rated Strong, the score would rise from 61 to about 72.

Code composition: what the lines of code are
Business logic 9%Supporting code 19%Tests 72%
New since the last survey: 58 findings

These 58 critical or serious findings weren't in the previous survey, on 27 October 2026.

  • Code Duplication · Edited copy of a member (193 corresponding lines) crates/unicode-gen/src/main.rs
  • Code Duplication · Edited copy of a member (44 corresponding lines) crates/edit/src/simd/memset.rs
  • Code Duplication · Edited copy of a member (46 corresponding lines) crates/edit/src/simd/memset.rs
  • Code Duplication · Edited copy of a member (39 corresponding lines) crates/edit/src/json.rs
  • Code Duplication · Edited copy of a member (30 corresponding lines) crates/edit/src/simd/memchr2.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) crates/edit/src/collections/vec.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) crates/edit/src/arena/release.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) crates/lsh/src/runtime.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) crates/edit/src/tui.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) crates/edit/src/tui.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) crates/edit/src/collections/vec.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) crates/edit/src/bin/edit/documents.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) crates/lsh/src/compiler/frontend.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) crates/edit/src/collections/vec.rs
  • Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) crates/edit/src/simd/lines_bwd.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) crates/edit/src/simd/lines_fwd.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) crates/edit/src/buffer/gap_buffer.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) crates/edit/src/icu.rs
  • Code Duplication · Edited copy of a member (6 corresponding lines) crates/edit/src/collections/string.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) crates/edit/src/arena/fs.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/edit/src/framebuffer.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/edit/src/simd/lines_fwd.rs
  • Code Duplication · Duplicated block (13 lines × 2) crates/unicode-gen/src/main.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/edit/src/simd/lines_fwd.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/lsh/src/compiler/generator.rs
  • Code Duplication · Duplicated block (7 lines × 2) crates/edit/src/bin/edit/draw_statusbar.rs
  • Code Duplication · Duplicated block (6 lines × 2) crates/edit/src/tui.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/edit/src/arena/release.rs
  • Code Coverage · Low coverage: crates/edit/src/alloc.rs crates/edit/src/alloc.rs
  • Code Coverage · Low coverage: crates/edit/src/arena/fs.rs crates/edit/src/arena/fs.rs
  • Code Coverage · Low coverage: crates/edit/src/collections/string.rs crates/edit/src/collections/string.rs
  • Code Coverage · Low coverage: crates/edit/src/collections/vec.rs crates/edit/src/collections/vec.rs
  • Code Coverage · Low coverage: crates/edit/src/document.rs crates/edit/src/document.rs
  • Code Coverage · Low coverage: crates/edit/src/framebuffer.rs crates/edit/src/framebuffer.rs
  • Code Coverage · Low coverage: crates/edit/src/fuzzy.rs crates/edit/src/fuzzy.rs
  • Code Coverage · Low coverage: crates/edit/src/icu.rs crates/edit/src/icu.rs
  • Code Coverage · Low coverage: crates/edit/src/input.rs crates/edit/src/input.rs
  • Code Coverage · Low coverage: crates/edit/src/lsh/cache.rs crates/edit/src/lsh/cache.rs
  • Code Coverage · Low coverage: crates/edit/src/lsh/highlighter.rs crates/edit/src/lsh/highlighter.rs
  • Code Coverage · Low coverage: crates/edit/src/lsh/mod.rs crates/edit/src/lsh/mod.rs
  • Code Coverage · Low coverage: crates/edit/src/sys/unix.rs crates/edit/src/sys/unix.rs
  • Code Coverage · Low coverage: crates/edit/src/tui.rs crates/edit/src/tui.rs
  • Code Coverage · Low coverage: crates/edit/src/vt.rs crates/edit/src/vt.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/backend.rs crates/lsh/src/compiler/backend.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/charset.rs crates/lsh/src/compiler/charset.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/frontend.rs crates/lsh/src/compiler/frontend.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/generator.rs crates/lsh/src/compiler/generator.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/index_vec.rs crates/lsh/src/compiler/index_vec.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/ir.rs crates/lsh/src/compiler/ir.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/mod.rs crates/lsh/src/compiler/mod.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/optimizer.rs crates/lsh/src/compiler/optimizer.rs
  • Code Coverage · Low coverage: crates/lsh/src/compiler/regex.rs crates/lsh/src/compiler/regex.rs
  • Code Coverage · Low coverage: crates/lsh/src/main.rs crates/lsh/src/main.rs
  • Code Coverage · Low coverage: crates/lsh/src/runtime.rs crates/lsh/src/runtime.rs
  • Code Coverage · Low coverage: crates/unicode-gen/src/main.rs crates/unicode-gen/src/main.rs
  • Churn × Complexity Hotspots · Hotspot: crates/edit/src/icu.rs crates/edit/src/icu.rs
  • Explicit Debt · TodoComment crates/edit/src/icu.rs
  • Explicit Debt · TodoComment crates/edit/src/icu.rs

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 12 findings

These 12 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one.

  • Code Duplication · Duplicated block (15 lines × 2) crates/edit/src/simd/lines_fwd.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/edit/src/framebuffer.rs
  • Code Duplication · Duplicated block (13 lines × 2) crates/unicode-gen/src/main.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/edit/src/icu.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/edit/src/simd/lines_fwd.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/edit/src/tui.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/lsh/src/compiler/generator.rs
  • Code Duplication · Duplicated block (6 lines × 2) crates/edit/src/bin/edit/draw_statusbar.rs
  • Churn × Complexity Hotspots · Hotspot: crates/edit/src/tui.rs crates/edit/src/tui.rs
  • Churn × Complexity Hotspots · Hotspot: crates/edit/src/bin/edit/main.rs crates/edit/src/bin/edit/main.rs
  • Churn × Complexity Hotspots · Hotspot: crates/lsh/src/main.rs crates/lsh/src/main.rs
  • Explicit Debt · TodoComment crates/edit/src/icu.rs
Rebuild cost: about €36,000 · Estimate
Cost to rebuild€12,000 to €60,000, for 200 to 635 hours of work, about 0.2 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 61. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 30,214 lines of product code
Comment linesThe estimate prices 30,207 lines. Comment lines count towards the size of 30,214 lines but aren't priced as work.
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 27 Low coverage finding(s) in Code Coverage — start with mod.rs (2), main.rs (2), alloc.rs.
Raises the score by about 8 points · Medium effort · Code Coverage
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs.
Raises the score by about 5 points · Low effort · ADR Quality
3
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag.
Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Raises the score by about 9 points · Medium effort · Observability

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Files that change often carry extra risk · Combined risk
4 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (4 files) · Code Coverage (25 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: mod.rs, unix.rs and framebuffer.rs
What to do: Add tests to these files and have a second person review every change to them, starting with mod.rs, unix.rs and framebuffer.rs.
Where the investment is most exposed · Value at risk
This code would cost about €36,000 to build again, about 0.2 person-years of work. Its weakest lens is Production Readiness, at 46 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 27 Low coverage finding(s) in Code Coverage. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for medium effort, because it clears the 27 Code Coverage findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 8,372 lines over the last 90 days, which is about 33,953 lines a year. At that pace, the extra work comes to an estimated 3.8 to 22.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch edit edit lsh lsh edit->lsh unicode-gen unicode-gen

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

70 modules, with 114 dependencies between them. 2 loops run through 9 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 30 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 edit.alloc2 edit.buffer.gap_buffer3 edit.cell.release4 edit.clipboard5 edit.collections.vec6 edit.helpers7 edit.oklab8 lsh.compiler.charset9 lsh.runtime10 edit.arena.debug11 edit.collections.string12 edit.vt13 lsh.compiler.ir14 edit.arena.scratch15 edit.base6416 edit.fuzzy17 edit.icu18 edit.input19 edit.lsh.highlighter20 edit.unicode.sanitize21 lsh.compiler.backend22 edit.arena.scratch.multi_threaded23 edit.arena.scratch.single_threaded24 edit.framebuffer25 edit.lsh.cache26 edit.tui27 edit.unicode.measurement28 edit.buffer29 edit.bin.edit.apperr30 edit.bin.edit.settings31 edit.bin.edit.state32 edit.json33 edit.sys.unix34 edit.sys.windows35 edit.bin.edit.documents36 edit.bin.edit.draw_editor37 edit.bin.edit.draw_filepicker38 edit.bin.edit.draw_menubar39 edit.bin.edit.draw_statusbar40 edit.bin.edit.main
1 edit.alloc
2 edit.buffer.gap_buffer
3 edit.cell.release
4 edit.clipboard
5 edit.collections.vec
6 edit.helpers
7 edit.oklab
8 lsh.compiler.charset
9 lsh.runtime
10 edit.arena.debug1
11 edit.collections.string1
12 edit.vt21
13 lsh.compiler.ir11
14 edit.arena.scratch1
15 edit.base6411
16 edit.fuzzy11
17 edit.icu222
18 edit.input11
19 edit.lsh.highlighter242
20 edit.unicode.sanitize111
21 lsh.compiler.backend1111
22 edit.arena.scratch.multi_threaded11
23 edit.arena.scratch.single_threaded11
24 edit.framebuffer92111
25 edit.lsh.cache112
26 edit.tui221245245
27 edit.unicode.measurement21
28 edit.buffer111151133111
29 edit.bin.edit.apperr1
30 edit.bin.edit.settings21
31 edit.bin.edit.state111131
32 edit.json11321
33 edit.sys.unix1111
34 edit.sys.windows111
35 edit.bin.edit.documents1111
36 edit.bin.edit.draw_editor111
37 edit.bin.edit.draw_filepicker11
38 edit.bin.edit.draw_menubar11
39 edit.bin.edit.draw_statusbar11
40 edit.bin.edit.main11221
Uses a module listed above itPart of a loopThe module itself
1 edit.alloc2 edit.buffer.gap_buffer3 edit.cell.release4 edit.clipboard5 edit.collections.vec6 edit.helpers7 edit.oklab8 lsh.compiler.charset9 lsh.runtime10 edit.arena.debug11 edit.collections.string12 edit.vt13 lsh.compiler.ir14 edit.arena.scratch15 edit.base6416 edit.fuzzy17 edit.icu18 edit.input19 edit.lsh.highlighter20 edit.unicode.sanitize21 lsh.compiler.backend22 edit.arena.scratch.multi_threaded23 edit.arena.scratch.single_threaded24 edit.framebuffer25 edit.lsh.cache26 edit.tui27 edit.unicode.measurement28 edit.buffer29 edit.bin.edit.apperr30 edit.bin.edit.settings31 edit.bin.edit.state32 edit.json33 edit.sys.unix34 edit.sys.windows35 edit.bin.edit.documents36 edit.bin.edit.draw_editor37 edit.bin.edit.draw_filepicker38 edit.bin.edit.draw_menubar39 edit.bin.edit.draw_statusbar40 edit.bin.edit.mainedit.alloc1edit.buffer.gap_buffer2edit.cell.release3edit.clipboard4edit.collections.vec5edit.helpers6edit.oklab7lsh.compiler.charset8lsh.runtime9edit.arena.debug10edit.collections.string11edit.vt12lsh.compiler.ir13edit.arena.scratch14edit.base6415edit.fuzzy16edit.icu17edit.input18edit.lsh.highlighter19edit.unicode.sanitize20lsh.compiler.backend21edit.arena.scratch.multi_threaded22edit.arena.scratch.single_threaded23edit.framebuffer24edit.lsh.cache25edit.tui26edit.unicode.measurement27edit.buffer28edit.bin.edit.apperr29edit.bin.edit.settings30edit.bin.edit.state31edit.json32edit.sys.unix33edit.sys.windows34edit.bin.edit.documents35edit.bin.edit.draw_editor36edit.bin.edit.draw_filepicker37edit.bin.edit.draw_menubar38edit.bin.edit.draw_statusbar39edit.bin.edit.main401121111111122211242111111111119211111222124524521111151133111121111131113211111111111111111111111221+30 more modules (most-connected shown)

At a glance — Code Health · 80% · Adequate · gated by D2 ·

At a glance — Architecture · 97% · Exemplary ·

At a glance — Maturity · 66% · Adequate · gated by M2 ·

At a glance — Readiness · 46% · Weak · gated by P2, P4 ·

At a glance — Security · 79% · Adequate · gated by D36 ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures4Medium
A05:2025 — Injection2High / Critical

Roadmap

Top priorities: Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce; Resolve the 27 Low coverage finding(s) in Code Coverage — start with mod.rs (2), main.rs (2), alloc.rs; Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 27 Low coverage finding(s) in Code Coverage — start with mod.rs (2), main.rs (2), alloc.rs.+7.6 ptsMediumCode Coverage
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs.+4.9 ptsLowADR Quality
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.+8.5 ptsMediumObservability
Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.+6.0 ptsMediumDeployment & Rollback
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+4.2 ptsMediumArchitecture documentation
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor.+1.8 ptsLowBus Factor
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+1.8 ptsLowBus Factor
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+3.1 ptsMediumRelease Hygiene

File quality

Per-file score 0–10 — a quality signature. Of 57 files carrying findings, judged against the Production bar: 0% slop · 65% mixed · 35% near-clean.

FileScoreBandWorst signal
crates/unicode-gen/src/main.rs5.0MixedCyclomatic Complexity: unicode_gen::extract_values_from_ucd (cyclomatic 53)
crates/edit/src/collections/vec.rs5.6MixedGod Classes: TooManyMethods: BVec
crates/lsh/src/compiler/regex.rs5.6MixedCyclomatic Complexity: RegexParser::parse_char_class (cyclomatic 19)
crates/edit/src/tui.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/vt.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/buffer/mod.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/sys/unix.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/input.rs6.0MixedExplicit Debt: TodoComment
crates/lsh/src/compiler/backend.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/framebuffer.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/icu.rs6.0MixedExplicit Debt: TodoComment
crates/lsh/src/compiler/generator.rs6.0MixedExplicit Debt: TodoComment
crates/lsh/src/compiler/optimizer.rs6.0MixedExplicit Debt: TodoComment
crates/lsh/src/compiler/frontend.rs6.0MixedExplicit Debt: TodoComment
crates/lsh/src/runtime.rs6.0MixedExplicit Debt: TodoComment
crates/edit/src/buffer/gap_buffer.rs6.0MixedExplicit Debt: TodoComment
crates/lsh/src/main.rs6.3MixedCyclomatic Complexity: lsh::run_render (cyclomatic 34)
crates/edit/src/fuzzy.rs6.3MixedCyclomatic Complexity: edit::fuzzy::score_fuzzy (cyclomatic 28)
crates/lsh/src/compiler/charset.rs7.0MixedCognitive Complexity: Charset::fmt (cognitive 16)
crates/edit/src/simd/lines_bwd.rs7.0MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)

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 — 2

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 — 272

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 — 12

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 9

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 41 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 41 dimensions across the health lenses
D1D2D3D4D5D6D8D11D12D13D14D15D16D17D19D20D28D29D30D34D35D36D37D43D44AX10AX3AX4AX9GD1M1M2M3M4P1P10P2P3P4P6X5

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
  1. 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, 274 of 286 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1daa3-3b41-77a7-b0a4-83f0ae0d4c8b.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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.

  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • 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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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.

Dimensions

D1 · Cyclomatic Complexity5.0 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

36 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Context::textarea_handle_input at 126. A further 2 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 Instruction::mnemonic at 21 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/lsh/src/runtime.rs (Instruction::mnemonic at 21). 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.

edit::bin::edit::draw_filepicker::draw_file_picker (cyclomatic 50) · ×13crates/edit/src/bin/edit/draw_filepicker.rs:19
TextBuffer::render (cyclomatic 38) · ×6crates/edit/src/buffer/mod.rs:1828
Context::textarea_handle_input (cyclomatic 126) · ×3crates/edit/src/tui.rs:2246
unicode_gen::extract_values_from_ucd (cyclomatic 53) · ×2crates/unicode-gen/src/main.rs:752
Stream::next (cyclomatic 42) · ×2crates/edit/src/vt.rs:149

+ 7 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with Context::textarea_handle_input (cyclomatic 126). — Refactoring it lifts Cyclomatic Complexity from 5.0 to about 6.0/10.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

75 method(s) exceeded the cognitive complexity threshold of 15; the worst was Context::textarea_handle_input at 253.

edit::bin::edit::draw_filepicker::draw_file_picker (cognitive 73) · ×24crates/edit/src/bin/edit/draw_filepicker.rs:19
TextBuffer::render (cognitive 93) · ×10crates/edit/src/buffer/mod.rs:1828
Context::textarea_handle_input (cognitive 253) · ×8crates/edit/src/tui.rs:2246
unicode_gen::extract_values_from_ucd (cognitive 41) · ×4crates/unicode-gen/src/main.rs:752
lsh::glob::slow_path (cognitive 27) · ×4crates/lsh/src/glob.rs:84

+ 16 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with Context::textarea_handle_input (cognitive 253), Stream::next (cognitive 100), MeasurementConfig::measure_forward (cognitive 95). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 2.0 to about 3.9/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes7.5 / 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.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Prevented

33 god class(es) detected.

MethodTooLong: Context.textarea_handle_input · ×9crates/edit/src/tui.rs:2246
FileTooLong: src/tui.rs · ×7crates/edit/src/tui.rs
FunctionTooLong: edit::bin::edit::draw_filepicker::draw_file_picker · ×6crates/edit/src/bin/edit/draw_filepicker.rs:19
TooManyMethods: TextBuffer · ×5crates/edit/src/buffer/mod.rs:271
ClassTooLong: TextBuffer · ×4crates/edit/src/buffer/mod.rs:271

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 9 MethodTooLong finding(s) in God Classes — start with tui.rs (3), mod.rs, measurement.rs. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 7 FileTooLong finding(s) in God Classes — start with tui.rs, mod.rs, icu.rs. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 6 FunctionTooLong finding(s) in God Classes — start with main.rs (3), draw_filepicker.rs, draw_statusbar.rs. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication7.8 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Verified

33 duplicated block group(s) detected. 5.4 % of the production lines (1,598 of 29,673) are in a reported copy. A further 22 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Edited copy of a member (12 corresponding lines) · ×3crates/edit/src/tui.rs:3883
Duplicated block (15 lines × 2) · ×3crates/edit/src/framebuffer.rs:878
Duplicated block (12 lines × 2) · ×3crates/edit/src/collections/vec.rs:430
Duplicated block (6 lines × 2) · ×3crates/edit/src/bin/edit/draw_editor.rs:238
Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2crates/edit/src/simd/lines_bwd.rs:95

+ 37 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 3 Edited copy of a member (12 corresponding lines) finding(s) in Code Duplication — start with tui.rs, frontend.rs, vec.rs. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 3 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with framebuffer.rs, lines_bwd.rs, lines_fwd.rs. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with vec.rs, lines_fwd.rs, memset.rs. — One of this dimension's main actionable groups (3 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling7.3 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 7.3 / 10 · rule-coverage 100% · ceiling Prevented

3 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.

Off the main sequence: lsh

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 57 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D8 · Code Coverage6.8 / 10Adequate✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.8 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 32.8% — 27 file(s) below 50%. Measured from the Rust suite (repository root: `cargo test --workspace` instrumented over 62 production file(s), 5 test binaries and 1 doc-test binaries).

Low coverage: crates/edit/src/alloc.rs · ×27crates/edit/src/alloc.rs:1

What to do

  1. Resolve the 27 Low coverage finding(s) in Code Coverage — start with mod.rs (2), main.rs (2), alloc.rs. — One of this dimension's main actionable groups (27 warning-level).

Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). Rust (repository root, 22 test files): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene10.0 9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.2 / 10 · rule-coverage 92% · ceiling Verified

0 outdated, 0 yanked direct Cargo dependencies. 11 of 12 direct crates were graded against crates.io (0 not published there, 1 not resolved by a committed Cargo.lock). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from Cargo.lock there.

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 59 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's Cargo.lock closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 4 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: crates/edit/src/buffer/mod.rs (10×27=270); crates/edit/src/sys/unix.rs (8×33=264); crates/edit/src/framebuffer.rs (4×26=104)

Hotspot: crates/edit/src/buffer/mod.rs · ×4crates/edit/src/buffer/mod.rs:2347

What to do

  1. Resolve the 4 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs, unix.rs, framebuffer.rs. — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor5.9 / 10Adequate✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 5.9 / 10 · rule-coverage 100% · ceiling Documented

20 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/edit/src/framebuffer.rs. Counted over 49 of the 69 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.8 / 10Stronggated by 38 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

38 deducted task-comment markers across 29673 LoC (0.1/KLoC) → score 9.8. 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.

TodoComment · ×38crates/unicode-gen/src/rules.rs:106

What to do

  1. Resolve the 38 TodoComment finding(s) in Explicit Debt — start with tui.rs (9), icu.rs (4), mod.rs (4). — One of this dimension's main actionable groups (38 warning-level).

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 7 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundcrates/unicode-gen/src/main.rs:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)7.1 / 10Adequategated by 2 critical findings✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 7.1 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. semgrep hit a parse error in 11 file(s) — `assets/highlighting-tests/c.c` (line 79), `assets/highlighting-tests/csharp.cs` (lines 16–43, line 48, line 49, …), `assets/highlighting-tests/java.java` (line 12, line 111, line 112, …), `assets/highlighting-tests/python.py`, `assets/highlighting-tests/ruby.rb` (line 118), … (+6 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable dependencies in any ecosystem this repository declares.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 49 of the 69 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

M1 · Documentation (README)8.2 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

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's code 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.

P2 · Observability0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.

What to do

  • Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

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.

  • `.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `nuget`, `cargo`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — .github/dependabot.yml:2

What to do

  • Dependabot is configured but does not watch `nuget`, `cargo` — add those `package-ecosystem` entries to .github/dependabot.yml 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.
P4 · Deployment & Rollback2.0 / 10Critical✓ Tool-verified

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.

  • No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.

What to do

  • Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
X5 · Nullable reference types10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

Reference — by lens

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.

LensScoreRatingImpact
Code Health80%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture97%ExemplaryStrongest area.
Maturity66%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness46%Weak — gated by P2, P4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security79%Adequate — gated by D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 72 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • 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 — no public interfaces
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D10 Test Quality — ~341 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .go, .java, .py, .rb, .rs source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 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.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 26 value object(s)
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • IC1 Incompleteness & stubs — IC1 reached only 0% of this repository's production lines — rust (29,076 lines), zig (185 lines), python (125 lines), ruby (113 lines), go (112 lines), javascript (112 lines), java (109 lines), c (95 lines), lua (80 lines), cpp (69 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 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 — coverage data present for 62 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (29,076 lines), zig (185 lines), python (125 lines), ruby (113 lines), go (112 lines), javascript (112 lines), java (109 lines), c (95 lines), lua (80 lines), cpp (69 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — rust (29,076 lines), zig (185 lines), python (125 lines), ruby (113 lines), go (112 lines), javascript (112 lines), java (109 lines), c (95 lines), lua (80 lines), cpp (69 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no async method does work a token could cancel
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 0% of this repository's production lines — rust (29,076 lines), zig (185 lines), python (125 lines), ruby (113 lines), go (112 lines), javascript (112 lines), java (109 lines), c (95 lines), lua (80 lines), cpp (69 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.

Critical — 2 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 272 finding(s)
D17 · Explicit Debt · TodoComment · ×38
  • TodoComment crates/unicode-gen/src/rules.rs:106 — // TODO: I should go through this and cross check: https://www.unicode.org/Public/draft/ucd/auxiliary/LineBreakTest.html
  • TodoComment crates/lsh/src/lib.rs:41 — //! ## TODO — 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/lsh/src/compiler/backend.rs:48 — //! ## TODO — 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/lsh/src/compiler/generator.rs:6 — //! ## TODO — 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/lsh/src/compiler/optimizer.rs:10 — //! ## TODO — 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/lsh/src/runtime.rs:281 — // TODO: http://0x80.pl/notesen/2018-10-18-simd-byte-lookup.html#alternative-implementation
  • TodoComment crates/lsh/src/compiler/backend.rs:236 — // TODO: current interval gets spilled — 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/lsh/src/compiler/backend.rs:390 — // TODO: If you think about it, this should kinda go into optimizer.rs, because it could — 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/lsh/src/compiler/frontend.rs:136 — // TODO: a bit inoptimal to always allocate a noop node — 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/lsh/src/compiler/generator.rs:105 — // TODO: This is kind of stupid. There should be per-instruction annotations. — 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/lsh/src/compiler/generator.rs:239 — // TODO: This is kind of stupid. There should be per-instruction annotations. — 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/lsh/src/compiler/optimizer.rs:140 — // TODO: Technically we could also optimize vreg --> vreg assignments, but for that we — 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/edit/src/framebuffer.rs:416 — /// TODO: The current approach blends foreground/background independently, — 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/edit/src/framebuffer.rs:425 — /// TODO: The current approach blends foreground/background independently, — 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/edit/src/framebuffer.rs:523 — // TODO: Ideally, we should properly diff the contents and so if — 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/edit/src/icu.rs:385 — // TODO: I'm somewhat unsure whether we have to preserve the `chunk_offset`. — 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/edit/src/icu.rs:452 — // TODO: Due to borrowing issues in stable Rust 1.99 (and possibly subsequent versions), — 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/edit/src/icu.rs:482 — // TODO: It may be worth avoiding this if requested index — 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/edit/src/icu.rs:875 — // TODO: What's a good heuristic here? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/edit/src/input.rs:16 — /// TODO: Is this a good idea? I did it to allow typing `kbmod::CTRL | vk::A`. — 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/edit/src/tui.rs:564 — // TODO: the .len()==1 check causes us to ignore keyboard inputs that are faster than we process them. — 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/edit/src/tui.rs:710 — // TODO: There should be a way to do this without unsafe. — 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/edit/src/tui.rs:1411 — // TODO: — 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/edit/src/tui.rs:1478 — // TODO: HashMap — 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/edit/src/tui.rs:2365 — // TODO: Untested because Windows Terminal surprisingly doesn't support Shift+Click. — 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.
  • + 13 more in this group — see findings.md.
D8 · Code Coverage · Low coverage · ×27
  • Low coverage: crates/edit/src/alloc.rs crates/edit/src/alloc.rs:1 — 0.0% line coverage (0/23).
  • Low coverage: crates/edit/src/arena/fs.rs crates/edit/src/arena/fs.rs:1 — 0.0% line coverage (0/34).
  • Low coverage: crates/edit/src/collections/string.rs crates/edit/src/collections/string.rs:1 — 30.1% line coverage (59/196).
  • Low coverage: crates/edit/src/collections/vec.rs crates/edit/src/collections/vec.rs:1 — 30.4% line coverage (116/381).
  • Low coverage: crates/edit/src/document.rs crates/edit/src/document.rs:1 — 24.2% line coverage (8/33).
  • Low coverage: crates/edit/src/framebuffer.rs crates/edit/src/framebuffer.rs:1 — 45.7% line coverage (246/538).
  • Low coverage: crates/edit/src/fuzzy.rs crates/edit/src/fuzzy.rs:1 — 0.0% line coverage (0/129).
  • Low coverage: crates/edit/src/icu.rs crates/edit/src/icu.rs:1 — 5.8% line coverage (32/555).
  • Low coverage: crates/edit/src/input.rs crates/edit/src/input.rs:1 — 0.0% line coverage (0/213).
  • Low coverage: crates/edit/src/lsh/cache.rs crates/edit/src/lsh/cache.rs:1 — 20.5% line coverage (9/44).
  • Low coverage: crates/edit/src/lsh/highlighter.rs crates/edit/src/lsh/highlighter.rs:1 — 0.0% line coverage (0/78).
  • Low coverage: crates/edit/src/lsh/mod.rs crates/edit/src/lsh/mod.rs:1 — 0.0% line coverage (0/13).
  • Low coverage: crates/edit/src/sys/unix.rs crates/edit/src/sys/unix.rs:1 — 8.9% line coverage (34/384).
  • Low coverage: crates/edit/src/tui.rs crates/edit/src/tui.rs:1 — 25.0% line coverage (627/2508).
  • Low coverage: crates/edit/src/vt.rs crates/edit/src/vt.rs:1 — 0.0% line coverage (0/152).
  • Low coverage: crates/lsh/src/compiler/backend.rs crates/lsh/src/compiler/backend.rs:1 — 0.0% line coverage (0/441).
  • Low coverage: crates/lsh/src/compiler/charset.rs crates/lsh/src/compiler/charset.rs:1 — 20.5% line coverage (27/132).
  • Low coverage: crates/lsh/src/compiler/frontend.rs crates/lsh/src/compiler/frontend.rs:1 — 0.0% line coverage (0/559).
  • Low coverage: crates/lsh/src/compiler/generator.rs crates/lsh/src/compiler/generator.rs:1 — 0.0% line coverage (0/227).
  • Low coverage: crates/lsh/src/compiler/index_vec.rs crates/lsh/src/compiler/index_vec.rs:1 — 0.0% line coverage (0/43).
  • Low coverage: crates/lsh/src/compiler/ir.rs crates/lsh/src/compiler/ir.rs:1 — 0.0% line coverage (0/172).
  • Low coverage: crates/lsh/src/compiler/mod.rs crates/lsh/src/compiler/mod.rs:1 — 0.0% line coverage (0/17).
  • Low coverage: crates/lsh/src/compiler/optimizer.rs crates/lsh/src/compiler/optimizer.rs:1 — 0.0% line coverage (0/116).
  • Low coverage: crates/lsh/src/compiler/regex.rs crates/lsh/src/compiler/regex.rs:1 — 0.0% line coverage (0/430).
  • Low coverage: crates/lsh/src/main.rs crates/lsh/src/main.rs:1 — 0.0% line coverage (0/125).
  • + 2 more in this group — see findings.md.
D2 · Cognitive Complexity · edit · ×24
  • edit::bin::edit::draw_filepicker::draw_file_picker (cognitive 73) crates/edit/src/bin/edit/draw_filepicker.rs:19 — edit::bin::edit::draw_filepicker::draw_file_picker has cognitive complexity 73 (threshold 15). Drivers by points: if/else 31 (49 pts), boolean chains 14, loops 3 (5 pts), match/switch 2 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::sys::unix::read_stdin (cognitive 72) crates/edit/src/sys/unix.rs:282 — edit::sys::unix::read_stdin has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (52 pts), loops 4 (10 pts), match/switch 2 (8 pts), boolean chains 2 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • edit::fuzzy::score_fuzzy (cognitive 62) crates/edit/src/fuzzy.rs:14 — edit::fuzzy::score_fuzzy has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::main::setup_terminal (cognitive 59) crates/edit/src/bin/edit/main.rs:591 — edit::bin::edit::main::setup_terminal has cognitive complexity 59 (threshold 15). Drivers by points: if/else 10 (35 pts), match/switch 4 (16 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::draw_statusbar::draw_statusbar (cognitive 55) crates/edit/src/bin/edit/draw_statusbar.rs:17 — edit::bin::edit::draw_statusbar::draw_statusbar has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (50 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • edit::float::parse_f64_approx (cognitive 42) crates/edit/src/float.rs:13 — edit::float::parse_f64_approx has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 8, loops 3 (5 pts), match/switch 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.
  • edit::buffer::navigation::word_select (cognitive 40) crates/edit/src/buffer/navigation.rs:211 — edit::buffer::navigation::word_select has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (6 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • edit::icu::utext_access_impl (cognitive 38) crates/edit/src/icu.rs:434 — edit::icu::utext_access_impl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::sys::windows::read_stdin (cognitive 38) crates/edit/src/sys/windows.rs:310 — edit::sys::windows::read_stdin has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (6 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::build::i18n::generate (cognitive 37) crates/edit/build/i18n.rs:9 — edit::build::i18n::generate has cognitive complexity 37 (threshold 15). Drivers by points: loops 13 (16 pts), if/else 7 (11 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 11). Of this number, 34 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::main::handle_args (cognitive 33) crates/edit/src/bin/edit/main.rs:242 — edit::bin::edit::main::handle_args has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 5, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::unicode::sanitize::sanitize_control_chars_impl (cognitive 32) crates/edit/src/unicode/sanitize.rs:32 — edit::unicode::sanitize::sanitize_control_chars_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 15). Of this number, 30 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::main::draw (cognitive 27) crates/edit/src/bin/edit/main.rs:341 — edit::bin::edit::main::draw has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24 (25 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • edit::bin::edit::draw_editor::draw_search (cognitive 26) crates/edit/src/bin/edit/draw_editor.rs:37 — edit::bin::edit::draw_editor::draw_search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • edit::bin::edit::draw_filepicker::draw_dialog_saveas_refresh_files (cognitive 23) crates/edit/src/bin/edit/draw_filepicker.rs:305 — edit::bin::edit::draw_filepicker::draw_dialog_saveas_refresh_files has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::sys::unix::write_stdout (cognitive 23) crates/edit/src/sys/unix.rs:457 — edit::sys::unix::write_stdout has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::icu::get_available_encodings (cognitive 21) crates/edit/src/icu.rs:71 — edit::icu::get_available_encodings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::draw_menubar::draw_menu_file (cognitive 18) crates/edit/src/bin/edit/draw_menubar.rs:41 — edit::bin::edit::draw_menubar::draw_menu_file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::draw_statusbar::draw_dialog_encoding_change (cognitive 18) crates/edit/src/bin/edit/draw_statusbar.rs:259 — edit::bin::edit::draw_statusbar::draw_dialog_encoding_change has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, 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.
  • edit::build::configure_icu (cognitive 18) crates/edit/build/main.rs:61 — edit::build::configure_icu has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • edit::bin::edit::main::draw_handle_clipboard_change (cognitive 17) crates/edit/src/bin/edit/main.rs:465 — edit::bin::edit::main::draw_handle_clipboard_change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • edit::simd::memset::memset_lasx (cognitive 17) crates/edit/src/simd/memset.rs:241 — edit::simd::memset::memset_lasx has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::bin::edit::draw_filepicker::update_autocomplete_suggestions (cognitive 16) crates/edit/src/bin/edit/draw_filepicker.rs:356 — edit::bin::edit::draw_filepicker::update_autocomplete_suggestions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • edit::simd::memset::memset_avx2 (cognitive 16) crates/edit/src/simd/memset.rs:158 — edit::simd::memset::memset_avx2 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D1 · Cyclomatic Complexity · edit · ×13
  • edit::bin::edit::draw_filepicker::draw_file_picker (cyclomatic 50) crates/edit/src/bin/edit/draw_filepicker.rs:19 — edit::bin::edit::draw_filepicker::draw_file_picker has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • edit::sys::unix::read_stdin (cyclomatic 33) crates/edit/src/sys/unix.rs:282 — edit::sys::unix::read_stdin has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • edit::float::parse_f64_approx (cyclomatic 32) crates/edit/src/float.rs:13 — edit::float::parse_f64_approx has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • edit::build::i18n::generate (cyclomatic 29) crates/edit/build/i18n.rs:9 — edit::build::i18n::generate has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
  • edit::fuzzy::score_fuzzy (cyclomatic 28) crates/edit/src/fuzzy.rs:14 — edit::fuzzy::score_fuzzy 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.
  • edit::bin::edit::main::draw (cyclomatic 26) crates/edit/src/bin/edit/main.rs:341 — edit::bin::edit::main::draw has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • edit::bin::edit::main::setup_terminal (cyclomatic 23) crates/edit/src/bin/edit/main.rs:591 — edit::bin::edit::main::setup_terminal 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.
  • edit::sys::windows::read_stdin (cyclomatic 23) crates/edit/src/sys/windows.rs:310 — edit::sys::windows::read_stdin 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.
  • edit::bin::edit::draw_editor::draw_search (cyclomatic 22) crates/edit/src/bin/edit/draw_editor.rs:37 — edit::bin::edit::draw_editor::draw_search has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • edit::bin::edit::draw_statusbar::draw_statusbar (cyclomatic 22) crates/edit/src/bin/edit/draw_statusbar.rs:17 — edit::bin::edit::draw_statusbar::draw_statusbar has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • edit::icu::utext_access_impl (cyclomatic 19) crates/edit/src/icu.rs:434 — edit::icu::utext_access_impl 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.
  • edit::bin::edit::main::handle_args (cyclomatic 18) crates/edit/src/bin/edit/main.rs:242 — edit::bin::edit::main::handle_args has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • edit::unicode::sanitize::sanitize_control_chars_impl (cyclomatic 17) crates/edit/src/unicode/sanitize.rs:32 — edit::unicode::sanitize::sanitize_control_chars_impl has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · TextBuffer · ×10
  • TextBuffer::render (cognitive 93) crates/edit/src/buffer/mod.rs:1828 — TextBuffer::render has cognitive complexity 93 (threshold 15). Drivers by points: if/else 28 (71 pts), loops 4 (13 pts), boolean chains 8, match/switch 1 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextBuffer::write (cognitive 48) crates/edit/src/buffer/mod.rs:2347 — TextBuffer::write has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 5 (13 pts), boolean chains 4 (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.
  • TextBuffer::read_file (cognitive 42) crates/edit/src/buffer/mod.rs:714 — TextBuffer::read_file has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (34 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.
  • TextBuffer::find_parse_replacement (cognitive 37) crates/edit/src/buffer/mod.rs:1407 — TextBuffer::find_parse_replacement has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (8 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextBuffer::render_apply_highlights (cognitive 37) crates/edit/src/buffer/mod.rs:2141 — TextBuffer::render_apply_highlights has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (6 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextBuffer::goto_line_start (cognitive 27) crates/edit/src/buffer/mod.rs:1540 — TextBuffer::goto_line_start has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (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.
  • TextBuffer::cursor_move_delta_internal (cognitive 25) crates/edit/src/buffer/mod.rs:1697 — TextBuffer::cursor_move_delta_internal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 2 (4 pts), match/switch 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.
  • TextBuffer::write_file (cognitive 24) crates/edit/src/buffer/mod.rs:989 — TextBuffer::write_file has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextBuffer::undo_redo (cognitive 19) crates/edit/src/buffer/mod.rs:3167 — TextBuffer::undo_redo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextBuffer::indent_change (cognitive 17) crates/edit/src/buffer/mod.rs:2550 — TextBuffer::indent_change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · MethodTooLong · ×9
  • MethodTooLong: Context.textarea_handle_input crates/edit/src/tui.rs:2246 — MethodTooLong — textarea_handle_input runs 351 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 251 over it, 3.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TextBuffer.render crates/edit/src/buffer/mod.rs:1828 — MethodTooLong — render runs 196 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 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MeasurementConfig.measure_forward crates/edit/src/unicode/measurement.rs:140 — MethodTooLong — measure_forward runs 171 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 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Tui.create_context crates/edit/src/tui.rs:519 — MethodTooLong — create_context runs 132 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 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Tui.render_node crates/edit/src/tui.rs:881 — MethodTooLong — render_node runs 126 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 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.
  • MethodTooLong: Stream.next crates/edit/src/vt.rs:149 — MethodTooLong — next 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: Framebuffer.render crates/edit/src/framebuffer.rs:473 — MethodTooLong — render 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: Stream.next crates/edit/src/input.rs:310 — MethodTooLong — next 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: Backend.generate_code crates/lsh/src/compiler/backend.rs:250 — MethodTooLong — generate_code runs 102 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 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D2 · Cognitive Complexity · Context · ×8
  • Context::textarea_handle_input (cognitive 253) crates/edit/src/tui.rs:2246 — Context::textarea_handle_input has cognitive complexity 253 (threshold 15). Drivers by points: if/else 82 (206 pts), match/switch 17 (39 pts), boolean chains 8 (nesting depth added 146). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Context::list_end (cognitive 34) crates/edit/src/tui.rs:3087 — Context::list_end has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 6 (9 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Context::scrollarea_end (cognitive 31) crates/edit/src/tui.rs:2887 — Context::scrollarea_end has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Context::textarea_internal (cognitive 23) crates/edit/src/tui.rs:2125 — Context::textarea_internal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Context::table_move_focus (cognitive 20) crates/edit/src/tui.rs:1908 — Context::table_move_focus has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (18 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.
  • Context::button_label (cognitive 19) crates/edit/src/tui.rs:3358 — Context::button_label has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Context::block_end_move_focus (cognitive 17) crates/edit/src/tui.rs:1500 — Context::block_end_move_focus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 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.
  • Context::menubar_menu_end (cognitive 17) crates/edit/src/tui.rs:3320 — Context::menubar_menu_end has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D3 · God Classes · FileTooLong · ×7
  • FileTooLong: src/tui.rs crates/edit/src/tui.rs — FileTooLong — 2343 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 1843 over it, 4.69× 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: buffer/mod.rs crates/edit/src/buffer/mod.rs — FileTooLong — 1901 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: TextBuffer (2 blocks, 271-3288). The bar is 500 significant lines; this is 1401 over it, 3.80× 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/icu.rs crates/edit/src/icu.rs — FileTooLong — 823 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 323 over it, 1.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/main.rs crates/unicode-gen/src/main.rs — FileTooLong — 756 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 256 over it, 1.51× 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/runtime.rs crates/lsh/src/runtime.rs — FileTooLong — 654 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 154 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: src/framebuffer.rs crates/edit/src/framebuffer.rs — FileTooLong — 567 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 67 over it, 1.13× 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: compiler/frontend.rs crates/lsh/src/compiler/frontend.rs — FileTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: Parser (2 blocks, 47-836). The bar is 500 significant lines; this is 32 over it, 1.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D1 · Cyclomatic Complexity · TextBuffer · ×6
  • TextBuffer::render (cyclomatic 38) crates/edit/src/buffer/mod.rs:1828 — TextBuffer::render has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TextBuffer::render_apply_highlights (cyclomatic 38) crates/edit/src/buffer/mod.rs:2141 — TextBuffer::render_apply_highlights has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • TextBuffer::write (cyclomatic 27) crates/edit/src/buffer/mod.rs:2347 — TextBuffer::write has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TextBuffer::read_file (cyclomatic 22) crates/edit/src/buffer/mod.rs:714 — TextBuffer::read_file has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TextBuffer::find_parse_replacement (cyclomatic 20) crates/edit/src/buffer/mod.rs:1407 — TextBuffer::find_parse_replacement has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TextBuffer::goto_line_start (cyclomatic 16) crates/edit/src/buffer/mod.rs:1540 — TextBuffer::goto_line_start has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D3 · God Classes · FunctionTooLong · ×6
  • FunctionTooLong: edit::bin::edit::draw_filepicker::draw_file_picker crates/edit/src/bin/edit/draw_filepicker.rs:19 — FunctionTooLong — edit::bin::edit::draw_filepicker::draw_file_picker runs 157 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 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: unicode_gen::generate_rust crates/unicode-gen/src/main.rs:531 — FunctionTooLong — unicode_gen::generate_rust runs 157 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 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: unicode_gen::generate_c crates/unicode-gen/src/main.rs:337 — FunctionTooLong — unicode_gen::generate_c runs 131 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: edit::bin::edit::draw_statusbar::draw_statusbar crates/edit/src/bin/edit/draw_statusbar.rs:17 — FunctionTooLong — edit::bin::edit::draw_statusbar::draw_statusbar runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: unicode_gen::extract_values_from_ucd crates/unicode-gen/src/main.rs:752 — FunctionTooLong — unicode_gen::extract_values_from_ucd runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: edit::sys::unix::read_stdin crates/edit/src/sys/unix.rs:282 — FunctionTooLong — edit::sys::unix::read_stdin runs 106 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 6 over it, 1.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.
D3 · God Classes · TooManyMethods · ×5
  • TooManyMethods: TextBuffer crates/edit/src/buffer/mod.rs:271 — TooManyMethods — 119 methods. The bar is 30 methods; this is 89 over it, 3.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Context crates/edit/src/tui.rs:1378 — TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.60× 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: Parser crates/lsh/src/compiler/frontend.rs:47 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BVec crates/edit/src/collections/vec.rs:25 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Tui crates/edit/src/tui.rs:303 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×4
  • Hotspot: crates/edit/src/buffer/mod.rs crates/edit/src/buffer/mod.rs:2347 — crates/edit/src/buffer/mod.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in TextBuffer::write at line 2347. 4 of those changes were fix/bug commits, and the other 6 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-08-04..2026-11-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-04 22:19:22 +01:00' --until='2026-11-02 22:19:22 +01:00' --full-history --no-merges -- crates/edit/src/buffer/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/edit/src/sys/unix.rs crates/edit/src/sys/unix.rs:282 — crates/edit/src/sys/unix.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in edit::sys::unix::read_stdin at line 282. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-04..2026-11-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-04 22:19:22 +01:00' --until='2026-11-02 22:19:22 +01:00' --full-history --no-merges -- crates/edit/src/sys/unix.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/edit/src/framebuffer.rs crates/edit/src/framebuffer.rs:473 — crates/edit/src/framebuffer.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Framebuffer::render at line 473. 1 of those changes was a fix/bug commit, and the other 3 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-08-04..2026-11-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-04 22:19:22 +01:00' --until='2026-11-02 22:19:22 +01:00' --full-history --no-merges -- crates/edit/src/framebuffer.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/edit/src/icu.rs crates/edit/src/icu.rs:434 — crates/edit/src/icu.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in edit::icu::utext_access_impl at line 434. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-04..2026-11-02, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-04 22:19:22 +01:00' --until='2026-11-02 22:19:22 +01:00' --full-history --no-merges -- crates/edit/src/icu.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.
D2 · Cognitive Complexity · unicode_gen · ×4
  • unicode_gen::extract_values_from_ucd (cognitive 41) crates/unicode-gen/src/main.rs:752 — unicode_gen::extract_values_from_ucd has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 5 (17 pts), loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • unicode_gen::generate_rust (cognitive 24) crates/unicode-gen/src/main.rs:531 — unicode_gen::generate_rust has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 6 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • unicode_gen::generate_c (cognitive 22) crates/unicode-gen/src/main.rs:337 — unicode_gen::generate_c has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 6 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • unicode_gen::build_trie (cognitive 16) crates/unicode-gen/src/main.rs:1031 — unicode_gen::build_trie has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lsh · ×4
  • lsh::glob::slow_path (cognitive 27) crates/lsh/src/glob.rs:84 — lsh::glob::slow_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lsh::compiler::optimizer::optimize_redundant_offset_backup_restore (cognitive 24) crates/lsh/src/compiler/optimizer.rs:83 — lsh::compiler::optimizer::optimize_redundant_offset_backup_restore has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (6 pts), boolean chains 3, match/switch 1 (3 pts) (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.
  • lsh::run_render (cognitive 23) crates/lsh/src/main.rs:105 — lsh::run_render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • lsh::compiler::optimizer::optimize_noop (cognitive 19) crates/lsh/src/compiler/optimizer.rs:29 — lsh::compiler::optimizer::optimize_noop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · ClassTooLong · ×4
  • ClassTooLong: TextBuffer crates/edit/src/buffer/mod.rs:271 — ClassTooLong — 1680 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 119 methods, 2 blocks, lines 271-3288. The bar is 400 significant lines; this is 1280 over it, 4.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Context crates/edit/src/tui.rs:1378 — ClassTooLong — 1207 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 78 methods, 3 blocks, lines 1378-3441. The bar is 400 significant lines; this is 807 over it, 3.02× 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: Tui crates/edit/src/tui.rs:303 — ClassTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 303-1374. The bar is 400 significant lines; this is 234 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Parser crates/lsh/src/compiler/frontend.rs:47 — ClassTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 2 blocks, lines 47-836. The bar is 400 significant lines; this is 109 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D1 · Cyclomatic Complexity · Context · ×3
  • Context::textarea_handle_input (cyclomatic 126) crates/edit/src/tui.rs:2246 — Context::textarea_handle_input has cyclomatic complexity 126 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Context::list_end (cyclomatic 21) crates/edit/src/tui.rs:3087 — Context::list_end has cyclomatic complexity 21 (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.
  • Context::scrollarea_end (cyclomatic 20) crates/edit/src/tui.rs:2887 — Context::scrollarea_end has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · Stream · ×3
  • Stream::next (cognitive 100) crates/edit/src/vt.rs:149 — Stream::next has cognitive complexity 100 (threshold 15). Drivers by points: if/else 12 (40 pts), match/switch 9 (30 pts), loops 7 (25 pts), boolean chains 5 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Stream::next (cognitive 41) crates/edit/src/input.rs:310 — Stream::next has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 6 (18 pts), loops 1 (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.
  • Stream::parse_xterm_mouse (cognitive 18) crates/edit/src/input.rs:543 — Stream::parse_xterm_mouse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Tui · ×3
  • Tui::create_context (cognitive 49) crates/edit/src/tui.rs:519 — Tui::create_context has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Tui::render_node (cognitive 22) crates/edit/src/tui.rs:881 — Tui::render_node has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Tui::render_styled_text (cognitive 18) crates/edit/src/tui.rs:1069 — Tui::render_styled_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) crates/edit/src/tui.rs:3883 — crates/edit/src/tui.rs:3883-3894 | crates/edit/src/tui.rs:3898-3914 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/lsh/src/compiler/frontend.rs:297 — crates/lsh/src/compiler/frontend.rs:297-308 | crates/lsh/src/compiler/frontend.rs:310-321 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/edit/src/collections/vec.rs:206 — crates/edit/src/collections/vec.rs:206-223 | crates/edit/src/collections/vec.rs:227-238 — These two members are one piece of code written twice and then edited apart: 12 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 · Duplicated block (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) crates/edit/src/framebuffer.rs:878 — crates/edit/src/framebuffer.rs:878-892 | crates/edit/src/framebuffer.rs:981-995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/framebuffer.rs:878` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/edit/src/simd/lines_bwd.rs:268 — crates/edit/src/simd/lines_bwd.rs:268-282 | crates/edit/src/simd/lines_fwd.rs:273-287 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/edit/src/simd/lines_fwd.rs:249 — crates/edit/src/simd/lines_fwd.rs:249-263 | crates/edit/src/simd/lines_fwd.rs:320-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_fwd.rs:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `sum` to `m256i` in one and `m128i` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) crates/edit/src/collections/vec.rs:430 — crates/edit/src/collections/vec.rs:430-441 | crates/edit/src/helpers.rs:234-245 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/collections/vec.rs:430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/edit/src/simd/lines_fwd.rs:233 — crates/edit/src/simd/lines_fwd.rs:233-244 | crates/edit/src/simd/lines_fwd.rs:304-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_fwd.rs:233` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `sum` to `m256i` in one and `m128i` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) crates/edit/src/simd/memset.rs:78 — crates/edit/src/simd/memset.rs:78-89 | crates/edit/src/simd/memset.rs:379-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/memset.rs:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×3
  • Duplicated block (6 lines × 2) crates/edit/src/bin/edit/draw_editor.rs:238 — crates/edit/src/bin/edit/draw_editor.rs:238-243 | crates/edit/src/bin/edit/draw_filepicker.rs:207-212 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/edit/src/bin/edit/draw_filepicker.rs:206` calls `attr_overflow` and `crates/edit/src/bin/edit/draw_editor.rs:237` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/edit/src/tui.rs:2001 — crates/edit/src/tui.rs:2001-2006 | crates/edit/src/tui.rs:2017-2022 — both copies are in the same file, so extract the block into 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/unicode-gen/src/main.rs:359 — crates/unicode-gen/src/main.rs:359-364 | crates/unicode-gen/src/main.rs:555-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/unicode-gen/src/main.rs:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · unicode_gen · ×2
  • unicode_gen::extract_values_from_ucd (cyclomatic 53) crates/unicode-gen/src/main.rs:752 — unicode_gen::extract_values_from_ucd has cyclomatic complexity 53 (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.
  • unicode_gen::generate_rust (cyclomatic 16) crates/unicode-gen/src/main.rs:531 — unicode_gen::generate_rust 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.
D1 · Cyclomatic Complexity · Stream · ×2
  • Stream::next (cyclomatic 42) crates/edit/src/vt.rs:149 — Stream::next has cyclomatic complexity 42 (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.
  • Stream::next (cyclomatic 30) crates/edit/src/input.rs:310 — Stream::next has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Tui · ×2
  • Tui::create_context (cyclomatic 31) crates/edit/src/tui.rs:519 — Tui::create_context has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Tui::render_node (cyclomatic 18) crates/edit/src/tui.rs:881 — Tui::render_node has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RegexParser · ×2
  • RegexParser::parse_char_class (cyclomatic 19) crates/lsh/src/compiler/regex.rs:361 — RegexParser::parse_char_class 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.
  • RegexParser::parse_atom (cyclomatic 16) crates/lsh/src/compiler/regex.rs:455 — RegexParser::parse_atom has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Generator · ×2
  • Generator::generate_assembly (cyclomatic 17) crates/lsh/src/compiler/generator.rs:78 — Generator::generate_assembly 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.
  • Generator::generate_rust (cyclomatic 16) crates/lsh/src/compiler/generator.rs:170 — Generator::generate_rust has cyclomatic complexity 16 (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.
D2 · Cognitive Complexity · Backend · ×2
  • Backend::generate_code (cognitive 43) crates/lsh/src/compiler/backend.rs:250 — Backend::generate_code has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 4 (16 pts), loops 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Backend::linear_scan_allocation (cognitive 20) crates/lsh/src/compiler/backend.rs:188 — Backend::linear_scan_allocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser · ×2
  • Parser::skip_whitespace_and_comments (cognitive 33) crates/edit/src/json.rs:441 — Parser::skip_whitespace_and_comments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (13 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_if_comparison (cognitive 17) crates/lsh/src/compiler/frontend.rs:415 — Parser::parse_if_comparison has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · Generator · ×2
  • Generator::generate_assembly (cognitive 33) crates/lsh/src/compiler/generator.rs:78 — Generator::generate_assembly has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Generator::generate_rust (cognitive 25) crates/lsh/src/compiler/generator.rs:170 — Generator::generate_rust has cognitive complexity 25 (threshold 15). Drivers by points: loops 10 (13 pts), if/else 6 (12 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Node · ×2
  • Node::compute_intrinsic_size (cognitive 18) crates/edit/src/tui.rs:3917 — Node::compute_intrinsic_size has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (8 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Node::layout_children (cognitive 18) crates/edit/src/tui.rs:4005 — Node::layout_children has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), match/switch 3 (7 pts), boolean chains 1, if/else 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CodeGen · ×2
  • CodeGen::emit_charset (cognitive 18) crates/lsh/src/compiler/regex.rs:744 — CodeGen::emit_charset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CodeGen::emit_repeat (cognitive 16) crates/lsh/src/compiler/regex.rs:644 — CodeGen::emit_repeat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 2 (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.
D3 · God Classes · TooManyFields · ×2
  • TooManyFields: State crates/edit/src/bin/edit/state.rs:133 — TooManyFields — 37 stored fields beside 2 methods. The bar is 30 stored fields; this is 7 over it, 1.23× 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: TextBuffer crates/edit/src/buffer/mod.rs:271 — TooManyFields — 32 stored fields beside 119 methods. The bar is 30 stored fields; this is 2 over it, 1.07× 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.
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/edit/src/simd/lines_bwd.rs:95 — crates/edit/src/simd/lines_bwd.rs:95-163 | crates/edit/src/simd/lines_bwd.rs:192-258 | crates/edit/src/simd/lines_bwd.rs:267-331 | crates/edit/src/simd/lines_bwd.rs:339-393 — 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/edit/src/simd/lines_fwd.rs:95 — crates/edit/src/simd/lines_fwd.rs:95-170 | crates/edit/src/simd/lines_fwd.rs:199-263 | crates/edit/src/simd/lines_fwd.rs:272-334 | crates/edit/src/simd/lines_fwd.rs:342-396 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×2
  • Edited copy of a member (13 corresponding lines) crates/edit/src/collections/vec.rs:377 — crates/edit/src/collections/vec.rs:377-389 | crates/edit/src/collections/vec.rs:411-423 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/edit/src/buffer/gap_buffer.rs:376 — crates/edit/src/buffer/gap_buffer.rs:376-388 | crates/edit/src/buffer/gap_buffer.rs:390-402 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) crates/edit/src/simd/memset.rs:137 — crates/edit/src/simd/memset.rs:137-154 | crates/edit/src/simd/memset.rs:205-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/memset.rs:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/edit/src/simd/memset.rs:280 — crates/edit/src/simd/memset.rs:280-297 | crates/edit/src/simd/memset.rs:327-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/memset.rs:280` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) crates/edit/src/simd/lines_bwd.rs:228 — crates/edit/src/simd/lines_bwd.rs:228-240 | crates/edit/src/simd/lines_bwd.rs:301-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `sum` to `m256i` in one and `m128i` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) crates/unicode-gen/src/main.rs:513 — crates/unicode-gen/src/main.rs:513-525 | crates/unicode-gen/src/main.rs:723-735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/unicode-gen/src/main.rs:513` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) crates/edit/src/simd/memset.rs:34 — crates/edit/src/simd/memset.rs:34-38 | crates/edit/src/simd/memset.rs:40-44 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/memset.rs:34` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) crates/edit/src/arena/release.rs:120 — crates/edit/src/arena/release.rs:120-124 | crates/edit/src/arena/release.rs:148-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · MeasurementConfig · ×1
  • MeasurementConfig::measure_forward (cyclomatic 40) crates/edit/src/unicode/measurement.rs:140 — MeasurementConfig::measure_forward has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lsh · ×1
  • lsh::run_render (cyclomatic 34) crates/lsh/src/main.rs:105 — lsh::run_render has cyclomatic complexity 34 (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.
D1 · Cyclomatic Complexity · Backend · ×1
  • Backend::generate_code (cyclomatic 30) crates/lsh/src/compiler/backend.rs:250 — Backend::generate_code has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Framebuffer · ×1
  • Framebuffer::render (cyclomatic 26) crates/edit/src/framebuffer.rs:473 — Framebuffer::render has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · MeasurementConfig · ×1
  • MeasurementConfig::measure_forward (cognitive 95) crates/edit/src/unicode/measurement.rs:140 — MeasurementConfig::measure_forward has cognitive complexity 95 (threshold 15). Drivers by points: if/else 28 (75 pts), loops 4 (10 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Framebuffer · ×1
  • Framebuffer::render (cognitive 72) crates/edit/src/framebuffer.rs:473 — Framebuffer::render has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegexParser · ×1
  • RegexParser::parse_char_class (cognitive 28) crates/lsh/src/compiler/regex.rs:361 — RegexParser::parse_char_class has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (6 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.
D2 · Cognitive Complexity · Utf8Chars · ×1
  • Utf8Chars::next_slow (cognitive 21) crates/edit/src/unicode/utf8.rs:62 — Utf8Chars::next_slow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 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.
D2 · Cognitive Complexity · LivenessAnalysis · ×1
  • LivenessAnalysis::compute_liveness (cognitive 21) crates/lsh/src/compiler/backend.rs:611 — LivenessAnalysis::compute_liveness has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 4 (10 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Program.Main (cognitive 20) · ×1
  • Program.Main (cognitive 20) assets/highlighting-tests/csharp.cs:108 — Program.Main has cognitive complexity 20 (threshold 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.
D2 · Cognitive Complexity · Tree · ×1
  • Tree::visit_all (cognitive 18) crates/edit/src/tui.rs:3604 — Tree::visit_all has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Settings · ×1
  • Settings::load (cognitive 16) crates/edit/src/bin/edit/settings.rs:48 — Settings::load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Charset · ×1
  • Charset::fmt (cognitive 16) crates/lsh/src/compiler/charset.rs:140 — Charset::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (193 corresponding lines) · ×1
  • Edited copy of a member (193 corresponding lines) crates/unicode-gen/src/main.rs:337 — crates/unicode-gen/src/main.rs:337-529 | crates/unicode-gen/src/main.rs:531-750 — These two members are one piece of code written twice and then edited apart: 193 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) crates/edit/src/simd/memset.rs:241 — crates/edit/src/simd/memset.rs:241-297 | crates/edit/src/simd/memset.rs:301-344 — These two members are one piece of code written twice and then edited apart: 44 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) crates/edit/src/simd/memset.rs:109 — crates/edit/src/simd/memset.rs:109-154 | crates/edit/src/simd/memset.rs:158-222 — These two members are one piece of code written twice and then edited apart: 46 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 (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) crates/edit/src/json.rs:344 — crates/edit/src/json.rs:344-382 | crates/edit/src/json.rs:384-433 — These two members are one piece of code written twice and then edited apart: 39 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 (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) crates/edit/src/simd/memchr2.rs:124 — crates/edit/src/simd/memchr2.rs:124-155 | crates/edit/src/simd/memchr2.rs:159-188 — These two members are one piece of code written twice and then edited apart: 30 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 (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) crates/edit/src/collections/vec.rs:427 — crates/edit/src/collections/vec.rs:427-459 | crates/edit/src/helpers.rs:231-263 — These two members are one piece of code written twice and then edited apart: 33 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 (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) crates/edit/src/arena/release.rs:109 — crates/edit/src/arena/release.rs:109-128 | crates/edit/src/arena/release.rs:132-157 — These two members are one piece of code written twice and then edited apart: 20 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/lsh/src/runtime.rs:304 — crates/lsh/src/runtime.rs:304-326 | crates/lsh/src/runtime.rs:330-355 — 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 (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) crates/edit/src/tui.rs:2000 — crates/edit/src/tui.rs:2000-2013 | crates/edit/src/tui.rs:2016-2029 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) crates/edit/src/bin/edit/documents.rs:29 — crates/edit/src/bin/edit/documents.rs:29-47 | crates/edit/src/bin/edit/documents.rs:49-63 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) crates/edit/src/simd/lines_bwd.rs:36 — crates/edit/src/simd/lines_bwd.rs:36-45 | crates/edit/src/simd/lines_fwd.rs:34-43 | crates/edit/src/simd/memchr2.rs:25-34 | crates/edit/src/simd/memset.rs:54-63 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) crates/edit/src/simd/lines_fwd.rs:19 — crates/edit/src/simd/lines_fwd.rs:19-27 | crates/edit/src/simd/memchr2.rs:13-23 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×1
  • Edited copy of a member (8 corresponding lines) crates/edit/src/icu.rs:589 — crates/edit/src/icu.rs:589-597 | crates/edit/src/icu.rs:599-606 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) crates/edit/src/collections/string.rs:247 — crates/edit/src/collections/string.rs:247-252 | crates/edit/src/collections/vec.rs:335-340 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) crates/edit/src/arena/fs.rs:53 — crates/edit/src/arena/fs.rs:53-59 | crates/edit/src/helpers.rs:278-284 — These two members are one piece of code written twice and then edited apart: 7 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 · Duplicated block (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) crates/edit/src/unicode/measurement.rs:209 — crates/edit/src/unicode/measurement.rs:209-247 | crates/edit/src/unicode/measurement.rs:388-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/unicode/measurement.rs:209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/edit/src/unicode/measurement.rs:248` calls `cold_path` and `crates/edit/src/unicode/measurement.rs:428` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) crates/edit/src/unicode/measurement.rs:185 — crates/edit/src/unicode/measurement.rs:185-207 | crates/edit/src/unicode/measurement.rs:361-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/unicode/measurement.rs:185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) crates/edit/src/simd/lines_bwd.rs:193 — crates/edit/src/simd/lines_bwd.rs:193-209 | crates/edit/src/simd/lines_fwd.rs:200-216 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) crates/edit/src/simd/lines_bwd.rs:96 — crates/edit/src/simd/lines_bwd.rs:96-111 | crates/edit/src/simd/lines_fwd.rs:96-111 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) crates/edit/src/simd/lines_bwd.rs:121 — crates/edit/src/simd/lines_bwd.rs:121-132 | crates/edit/src/simd/lines_fwd.rs:122-136 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) crates/unicode-gen/src/main.rs:346 — crates/unicode-gen/src/main.rs:346-356 | crates/unicode-gen/src/main.rs:537-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/unicode-gen/src/main.rs:346` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) crates/edit/src/simd/lines_bwd.rs:354 — crates/edit/src/simd/lines_bwd.rs:354-364 | crates/edit/src/simd/lines_fwd.rs:355-367 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×1
  • Duplicated block (11 lines × 2) crates/edit/src/json.rs:346 — crates/edit/src/json.rs:346-356 | crates/edit/src/json.rs:386-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/json.rs:346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/edit/src/json.rs:357` calls `Some` and `crates/edit/src/json.rs:397` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×1
  • Duplicated block (10 lines × 2) crates/edit/src/collections/vec.rs:378 — crates/edit/src/collections/vec.rs:378-387 | crates/edit/src/collections/vec.rs:412-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) crates/edit/src/simd/lines_fwd.rs:112 — crates/edit/src/simd/lines_fwd.rs:112-120 | crates/edit/src/simd/lines_fwd.rs:217-223 | crates/edit/src/simd/lines_fwd.rs:288-294 | crates/edit/src/simd/lines_fwd.rs:347-353 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_fwd.rs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) crates/edit/src/tui.rs:890 — crates/edit/src/tui.rs:890-898 | crates/edit/src/tui.rs:909-917 | crates/edit/src/tui.rs:931-939 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×1
  • Duplicated block (9 lines × 2) crates/lsh/src/compiler/generator.rs:106 — crates/lsh/src/compiler/generator.rs:106-114 | crates/lsh/src/compiler/generator.rs:240-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/lsh/src/compiler/generator.rs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×1
  • Duplicated block (8 lines × 2) crates/edit/src/bin/edit/draw_editor.rs:240 — crates/edit/src/bin/edit/draw_editor.rs:240-247 | crates/edit/src/bin/edit/main.rs:508-515 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/bin/edit/draw_editor.rs:240` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) crates/edit/src/simd/lines_bwd.rs:112 — crates/edit/src/simd/lines_bwd.rs:112-118 | crates/edit/src/simd/lines_bwd.rs:211-217 | crates/edit/src/simd/lines_bwd.rs:284-290 | crates/edit/src/simd/lines_bwd.rs:345-351 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×1
  • Duplicated block (7 lines × 2) crates/edit/src/bin/edit/draw_statusbar.rs:216 — crates/edit/src/bin/edit/draw_statusbar.rs:216-222 | crates/edit/src/bin/edit/draw_statusbar.rs:368-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/bin/edit/draw_statusbar.rs:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–6 lines × 3) · ×1
  • Duplicated block (5–6 lines × 3) crates/edit/src/tui.rs:4020 — crates/edit/src/tui.rs:4020-4025 | crates/edit/src/tui.rs:4035-4040 | crates/edit/src/tui.rs:4102-4106 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/edit/src/tui.rs:4025` calls `outer_to_inner` and `crates/edit/src/tui.rs:4106` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) crates/edit/src/simd/lines_bwd.rs:82 — crates/edit/src/simd/lines_bwd.rs:82-86 | crates/edit/src/simd/lines_fwd.rs:82-86 | crates/edit/src/simd/memchr2.rs:67-71 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) crates/edit/src/simd/lines_bwd.rs:171 — crates/edit/src/simd/lines_bwd.rs:171-183 | crates/edit/src/simd/lines_fwd.rs:178-190 | crates/edit/src/simd/memchr2.rs:108-120 — before extracting anything, compare `crates/edit/src/simd/lines_bwd.rs` and `crates/edit/src/simd/lines_fwd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/edit/src/simd/lines_bwd.rs:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: lsh — lsh: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
P4 · Deployment & Rollback · No deployment automation · ×1
  • No deployment automation — No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.
SC1 · Supply-chain hygiene · NuGet dependencies are not locked · ×1
  • NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Minor — 12 finding(s)
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 18 significant file(s) lose their only recent owner: crates/edit/src/framebuffer.rs, crates/edit/src/unicode/measurement.rs, crates/unicode-gen/src/main.rs, crates/lsh/src/runtime.rs, crates/lsh/src/compiler/frontend.rs, crates/lsh/src/compiler/backend.rs, crates/edit/src/collections/vec.rs, crates/edit/src/json.rs (+10 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (20 single-owned of 49 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 49 of the 69 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: assets/highlighting-tests/rust.rs, assets/highlighting-tests/csharp.cs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found crates/unicode-gen/src/main.rs:1 — 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/`. ADRs are expected here because `crates/unicode-gen/src/main.rs` makes this repository a deployable product (line 1).
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • 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.
P3 · Security & performance tooling · Dependabot does not watch nuget/cargo · ×1
  • Dependabot does not watch nuget/cargo .github/dependabot.yml:2 — `.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `nuget`, `cargo`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X10 · Duplicated predicate · Duplicated predicate · ×1
  • Duplicated predicate crates/edit/src/simd/lines_bwd.rs:113 — `off != 0 && off < end.offset_from_unsigned(beg)` appears character-identically in 3 files — crates/edit/src/simd/lines_bwd.rs, crates/edit/src/simd/lines_fwd.rs, crates/edit/src/simd/memchr2.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X7 · Silent fallback defaults · Silent fallback default on Err · ×1
  • Silent fallback default on Err crates/edit/src/icu.rs:29 — `format` (in `fmt`) turns every `Err` into `""` — 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.

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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-8179960707d3422ea1231ac8f03cc1de/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-8179960707d3422ea1231ac8f03cc1de/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .2artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—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.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1daa3-3b41-77a7-b0a4-83f0ae0d4c8b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md